Skip to content

Commit

Permalink
Allow "func" to be a simple string.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Sep 19, 2023
1 parent 233c495 commit 64d17f6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/smartcontracts/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,5 @@ export interface ICodeMetadata {
}

export interface IContractFunction {
name: string;
toString(): string;
}
2 changes: 1 addition & 1 deletion src/smartcontracts/transactionPayloadBuilders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class ContractCallPayloadBuilder {
build(): TransactionPayload {
guardValueIsSet("calledFunction", this.contractFunction);

let data = this.contractFunction!.name;
let data = this.contractFunction!.toString();
data = appendArgumentsToString(data, this.arguments);

return new TransactionPayload(data);
Expand Down
2 changes: 1 addition & 1 deletion src/testutils/mockProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class MockProvider {
}

mockQueryContractOnFunction(functionName: string, response: IContractQueryResponse) {
let predicate = (query: Query) => query.func.name == functionName;
let predicate = (query: Query) => query.func.toString() == functionName;
this.queryContractResponders.push(new QueryContractResponder(predicate, response));
}

Expand Down

0 comments on commit 64d17f6

Please sign in to comment.