Skip to content

Commit

Permalink
Accepts contract functions without any arguments
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Russo <[email protected]>
  • Loading branch information
russanto committed Jun 9, 2019
1 parent c50289f commit 3347ae3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/caliper-ethereum/lib/ethereum.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ class Ethereum extends BlockchainInterface {
let status = new TxStatus();
try {
context.engine.submitCallback(1);
let receipt = await context.contracts[contractID].methods[methodCall.verb](...methodCall.args).send({from: context.fromAddress});
let receipt = null;
if (methodCall.args) {
receipt = await context.contracts[contractID].methods[methodCall.verb](...methodCall.args).send({from: context.fromAddress});
} else {
receipt = await context.contracts[contractID].methods[methodCall.verb]().send({from: context.fromAddress});
}
status.SetID(receipt.transactionHash);
status.SetResult(receipt);
status.SetVerification(true);
Expand Down

0 comments on commit 3347ae3

Please sign in to comment.