v3.0.0
- Bump tronweb from 4.0.1 to 4.3.0
- Add support for Solidity compiler 0.8.7 and 0.8.11
- Add
tronWrap.sendfunction to test environment for supporting tronbox/tre docker image. - Add
tre_setAccountBalanceRPC method. The method can set the given account's balance to the specified SUN value. - Add
tre_setAccountCodeRPC method. The method can set the given account's code to the specified value. - Add
tre_setAccountStorageAtRPC method. The method can set the given account's storage slot to the specified data. - Add
tre_blockTimeRPC method. The method can set the blockTime in seconds for automatic mining. A blockTime of 0 enables "instamine mode", where new executable transactions will be mined instantly. - Add
tre_mineRPC method. The method can mine exactlyblocksnumber of blocks. - Add
tre_unlockedAccountsRPC method. The method can set up any arbitrary account to impersonate during development.
tre_setAccountBalance:
const address = "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL";
const balance = "0x3e8";
const result = await tronWrap.send("tre_setAccountBalance", [address, balance]);
console.log(result);tre_setAccountCode:
const address = "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL";
const data = "0xbaddad42";
const result = await tronWrap.send("tre_setAccountCode", [address, data]);
console.log(result);tre_setAccountStorageAt:
const address = "TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL";
const slot = "0x0000000000000000000000000000000000000000000000000000000000000005";
const data = "0xbaddad42";
const result = await tronWrap.send("tre_setAccountStorageAt", [address, slot, data]);
console.log(result);tre_blockTime:
const result = await tronWrap.send("tre_blockTime", [3]);
console.log(result);tre_mine:
const result = await tronWrap.send("tre_mine", [{ blocks: 5}]);
console.log(result);tre_unlockedAccounts:
const result = await tronWrap.send("tre_unlockedAccounts", [["TNPeeaaFB7K9cmo4uQpcU32zGK8G1NYqeL"]]);
console.log(result);