difftreelog
Add new method to contract v2
in: master
1 file changed
tests/src/eth/proxyContract.test.tsdiffbeforeafterboth5149 await realContractV2proxy.methods.flip().send();52 await realContractV2proxy.methods.flip().send();50 await realContractV2proxy.methods.flip().send();53 await realContractV2proxy.methods.flip().send();54 await realContractV2proxy.methods.increaseFlipCount().send();51 const value2 = await realContractV2proxy.methods.getValue().call();55 const value2 = await realContractV2proxy.methods.getValue().call();52 const flipCount2 = await realContractV2proxy.methods.getFlipCount().call();56 const flipCount2 = await realContractV2proxy.methods.getFlipCount().call();53 expect(value2).to.be.equal(true);57 expect(value2).to.be.equal(true);54 expect(flipCount2).to.be.equal('1');58 expect(flipCount2).to.be.equal('6');55 });59 });566057 async function deployProxyContract(helper: EthUniqueHelper, deployer: string) {61 async function deployProxyContract(helper: EthUniqueHelper, deployer: string) {119 }123 }120124121 async function deployRealContractV2(helper: EthUniqueHelper, deployer: string) {125 async function deployRealContractV2(helper: EthUniqueHelper, deployer: string) {122 return await helper.ethContract.deployByCode(deployer, 'RealContractV2', `126 return await helper.ethContract.deployByCode(deployer, 'RealContractV2', `123 // SPDX-License-Identifier: UNLICENSED127 // SPDX-License-Identifier: UNLICENSED124 pragma solidity ^0.8.6;128 pragma solidity ^0.8.6;125 129 126 contract RealContractV2 {130 contract RealContractV2 {127 bool value = false;131 bool value = false;128 uint flipCount = 10;132 uint flipCount = 10;129 function flip() external {133 function flip() external {130 value = !value;134 value = !value;131 flipCount--;135 flipCount--;132 }136 }133 function getValue() external view returns (bool) {137 function increaseFlipCount() external {138 flipCount = flipCount + 5;139 }140 function getValue() external view returns (bool) {134 return value;141 return value;135 }142 }136 function getFlipCount() external view returns (uint) {143 function getFlipCount() external view returns (uint) {137 return flipCount;144 return flipCount;138 }145 }139 }`);146 }`);140 }147 }141});148});