feat: enable gas calculation
This commit is contained in:
@@ -218,11 +218,17 @@ function executeContract() {
|
||||
request.contractID = contract.id;
|
||||
request.operation = contract.exportedFunctions[selectedFunction.value].functionName;
|
||||
const arg = executeContractArgInput.value;
|
||||
const gasLimit = $('#gasLimit').val()
|
||||
request.gasLimit = gasLimit ? gasLimit : '1000'
|
||||
const gasLimit = $('#gasLimit').val()/1;
|
||||
request.pubkey = sm2Key.publicKey;
|
||||
var toSign = request.contractID + "|"
|
||||
+ request.operation + "|" + arg ;
|
||||
if (gasLimit>0){
|
||||
request.gasLimit = gasLimit;
|
||||
toSign+= "|" + gasLimit;
|
||||
}
|
||||
toSign+= "|" + sm2Key.publicKey;
|
||||
request.signature = sm2.doSignature(
|
||||
`${request.contractID}|${request.operation}|${arg}|${sm2Key.publicKey}`,
|
||||
toSign,
|
||||
sm2Key.privateKey,
|
||||
{hash: true, der: true});
|
||||
request.arg = arg;
|
||||
|
||||
Reference in New Issue
Block a user