Add support for contract tx call options

This allows to provide options like gas price/limit settings for the
state changing contract calls.
These options are simply passed to the ethers contract instance.

We need to provide the gas limit when using the jsonrpc provider.
(ganache failed with revert if not enought gas was provider)
This commit is contained in:
bumi 2018-04-20 02:09:30 +02:00
parent d4ca8d7c25
commit 6738abd0b3
2 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ class Contributor extends Base {
}); });
} }
add(contributorAttr) { add(contributorAttr, callOptions = {}) {
let json = ContributorSerializer.serialize(contributorAttr); let json = ContributorSerializer.serialize(contributorAttr);
// TODO: validate against schema // TODO: validate against schema
@ -49,7 +49,7 @@ class Contributor extends Base {
contributorAttr.isCore, contributorAttr.isCore,
]; ];
return this.functions.addContributor(...contributor); return this.functions.addContributor(...contributor, callOptions);
}); });
} }
} }

View File

@ -34,7 +34,7 @@ class Operator extends Base {
}); });
} }
addProposal(proposalAttr) { addProposal(proposalAttr, callOptions = {}) {
let json = ContributionSerializer.serialize(proposalAttr); let json = ContributionSerializer.serialize(proposalAttr);
// TODO: validate against schema // TODO: validate against schema
@ -49,7 +49,7 @@ class Operator extends Base {
ipfsHashAttr.hashSize, ipfsHashAttr.hashSize,
]; ];
return this.functions.addProposal(...proposal); return this.functions.addProposal(...proposal, callOptions);
}); });
} }
} }