Skip to content

Commit

Permalink
Merge pull request #333 from multiversx/func-name
Browse files Browse the repository at this point in the history
Allow "func" to be a simple string
  • Loading branch information
andreibancioiu committed Sep 19, 2023
2 parents 233c495 + 0236f2e commit ece6a7a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-core",
"version": "12.8.1",
"version": "12.9.0",
"description": "MultiversX SDK for JavaScript and TypeScript",
"main": "out/index.js",
"types": "out/index.d.js",
Expand Down
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 ece6a7a

Please sign in to comment.