Skip to content

Commit

Permalink
Replace solidityParamToString with formatSolidityParam
Browse files Browse the repository at this point in the history
  • Loading branch information
alcuadrado committed Aug 29, 2023
1 parent 3a11856 commit 87b89cd
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions packages/core/src/new-api/internal/journal/utils/log.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SolidityParameterType } from "../../../types/module";
import { formatSolidityParameter } from "../../formatters";
import { ExecutionResultType } from "../../new-execution/types/execution-result";
import {
JournalMessage,
Expand Down Expand Up @@ -44,7 +44,7 @@ export function logJournalableMessage(message: JournalMessage): void {
console.log(
`Successfully completed the execution of static call future ${
message.futureId
} with result ${solidityParamToString(message.result.value)}`
} with result ${formatSolidityParameter(message.result.value)}`
);
} else {
console.log(`Execution of future ${message.futureId} failed`);
Expand Down Expand Up @@ -89,7 +89,7 @@ export function logJournalableMessage(message: JournalMessage): void {
console.log(
`Executed read event argument future ${
message.futureId
} with result ${solidityParamToString(message.result)}`
} with result ${formatSolidityParameter(message.result)}`
);
break;

Expand Down Expand Up @@ -149,15 +149,3 @@ export function logJournalableMessage(message: JournalMessage): void {
break;
}
}

function solidityParamToString(param: SolidityParameterType): string {
if (typeof param === "object") {
return JSON.stringify(param);
}

if (typeof param === "string") {
return param;
}

return param.toString();
}

0 comments on commit 87b89cd

Please sign in to comment.