-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Description --- Simulation dialog didn't show the updated balances and shows 'failure' status every time. Error wasn't informative. Before: [Screencast from 21.11.2024 10:55:22.webm](https://github.com/user-attachments/assets/c4005d53-77c1-43ed-9a06-cad1b0f27de7) After: [Screencast from 21.11.2024 10:49:15.webm](https://github.com/user-attachments/assets/ed212139-8c64-472b-bd86-6dc6fe47066e) Motivation and Context --- Solves #101 How Has This Been Tested? --- What process can a PR reviewer use to test or verify this change? --- <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer --> <!-- BREAKING CHANGE: Description what the user should do, e.g. delete a database, resync the chain -->
- Loading branch information
Showing
9 changed files
with
172 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { TransactionStatus } from "@tari-project/tarijs" | ||
import { CallFunction, CallMethod } from "@tari-project/tarijs/dist/builders/types/Instruction" | ||
|
||
interface InstructionWithArgs { | ||
instructionName: string | ||
args: any[] | ||
} | ||
|
||
export function getFunctionOrMethod(instructions: object[]): InstructionWithArgs[] { | ||
let functionNames: InstructionWithArgs[] = [] | ||
instructions.forEach((instruction) => { | ||
if (typeof instruction === "object" && instruction !== null) { | ||
if ("CallFunction" in instruction) { | ||
const callFunction = instruction as CallFunction | ||
functionNames.push({ | ||
instructionName: callFunction.CallFunction.function, | ||
args: callFunction.CallFunction.args, | ||
}) | ||
} else if ("CallMethod" in instruction) { | ||
const callMethod = instruction as CallMethod | ||
functionNames.push({ instructionName: callMethod.CallMethod.method, args: callMethod.CallMethod.args }) | ||
} | ||
} | ||
}) | ||
return functionNames | ||
} | ||
|
||
export function getTransactionStatusName(status?: TransactionStatus): string { | ||
if (!status) return "" | ||
return TransactionStatus[status] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.