zilpay / zil-pay

ZilPay browser extension enables browsing Zilliqa blockchain enabled websites.
https://zilpay.io
Other
3 stars 1 forks source link

toDS always false #26

Closed VexyCats closed 4 years ago

VexyCats commented 4 years ago

Submitting a contract call transaction will never set toDS as true with the newest 0.4.6 changes.

Following code will always submit the transaction without toDS as true.

 const contractInstance = await getDeployedContract(DEXCode, address);
    const contractCall = await contractInstance.call(
      methodName,
      params,
      {
        version: VERSION,
        amount: new BN(0),
        gasPrice: myGasPrice,
        gasLimit: Long.fromNumber(10000),
        priority: true
      },
      true
    );
    return contractCall;
hicaru commented 4 years ago

thanks for your issue, it will fix in new version ZIlPay.

hicaru commented 4 years ago

for use toDS you need to set attributes as this:

        const tx = await contract.call(
          'Roll',
          [
            {
              vname: 'rol',
              type: 'Uint128',
              value: this.range.toString()
            }
          ],
          {
            amount,
            gasPrice,
            gasLimit: utils.Long.fromNumber(9000)
          },
          33,
          1000,
          true
        )