Skip to content

Commit

Permalink
Merge pull request #29 from trustwallet/fix/nodereal-hex-gas
Browse files Browse the repository at this point in the history
fix: convert decimal gas to hex
  • Loading branch information
a6-dou authored May 17, 2023
2 parents 6f304bc + 557d298 commit 769a9f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/simulator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export default class Simulator {
data?.forEach((call) => {
if (call.error) {
throw new WizardError(
`Transaction will fail with error: '${decodeErrorMessage(call.output)}'`
`Transaction will fail with error: '${
call.output ? decodeErrorMessage(call.output) : call.error
}'`
);
}
// handle native ETH transfers
Expand Down
4 changes: 2 additions & 2 deletions src/simulator/providers/nodeReal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type CallTracerParams = {
to: string;
value: string;
data: string;
gas: number;
gas: string;
};

const baseURLs: { [chainId: number]: string } = {};
Expand All @@ -27,7 +27,7 @@ export const nodeRealFactory = (apiKey: string, chainId: number): DebugProvider
to: input.to,
data: input.calldata,
value: input.value || "0x0",
gas: input.gas,
gas: `0x${input.gas.toString(16)}`,
},
baseURLs[chainId]
),
Expand Down

0 comments on commit 769a9f0

Please sign in to comment.