difftreelog
fix rename some methods
in: master
6 files changed
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -169,7 +169,7 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- fn get_sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
+ fn sponsor(&self, contract_address: address) -> Result<(address, uint256)> {
let sponsor =
Pallet::<T>::get_sponsor(contract_address).ok_or("Contract has no sponsor")?;
Ok(pallet_common::eth::convert_cross_account_to_tuple::<T>(
@@ -220,7 +220,7 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- fn get_sponsoring_rate_limit(&self, contract_address: address) -> Result<uint32> {
+ fn sponsoring_rate_limit(&self, contract_address: address) -> Result<uint32> {
self.recorder().consume_sload()?;
Ok(<SponsoringRateLimit<T>>::get(contract_address)
@@ -273,7 +273,7 @@
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {
+ fn sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {
self.recorder().consume_sload()?;
Ok(get_sponsoring_fee_limit::<T>(contract_address))
pallets/evm-contract-helpers/src/stubs/ContractHelpers.rawdiffbeforeafterbothbinary blob — no preview
pallets/evm-contract-helpers/src/stubs/ContractHelpers.soldiffbeforeafterboth1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7contract Dummy {8 uint8 dummy;9 string stub_error = "this contract is implemented in native";10}1112contract ERC165 is Dummy {13 function supportsInterface(bytes4 interfaceID) external view returns (bool) {14 require(false, stub_error);15 interfaceID;16 return true;17 }18}1920/// @dev inlined interface21contract ContractHelpersEvents {22 event ContractSponsorSet(address indexed contractAddress, address sponsor);23 event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor);24 event ContractSponsorRemoved(address indexed contractAddress);25}2627/// @title Magic contract, which allows users to reconfigure other contracts28/// @dev the ERC-165 identifier for this interface is 0x172cb4fb29contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents {30 /// Get user, which deployed specified contract31 /// @dev May return zero address in case if contract is deployed32 /// using uniquenetwork evm-migration pallet, or using other terms not33 /// intended by pallet-evm34 /// @dev Returns zero address if contract does not exists35 /// @param contractAddress Contract to get owner of36 /// @return address Owner of contract37 /// @dev EVM selector for this function is: 0x5152b14c,38 /// or in textual repr: contractOwner(address)39 function contractOwner(address contractAddress) public view returns (address) {40 require(false, stub_error);41 contractAddress;42 dummy;43 return 0x0000000000000000000000000000000000000000;44 }4546 /// Set sponsor.47 /// @param contractAddress Contract for which a sponsor is being established.48 /// @param sponsor User address who set as pending sponsor.49 /// @dev EVM selector for this function is: 0xf01fba93,50 /// or in textual repr: setSponsor(address,address)51 function setSponsor(address contractAddress, address sponsor) public {52 require(false, stub_error);53 contractAddress;54 sponsor;55 dummy = 0;56 }5758 /// Set contract as self sponsored.59 ///60 /// @param contractAddress Contract for which a self sponsoring is being enabled.61 /// @dev EVM selector for this function is: 0x89f7d9ae,62 /// or in textual repr: selfSponsoredEnable(address)63 function selfSponsoredEnable(address contractAddress) public {64 require(false, stub_error);65 contractAddress;66 dummy = 0;67 }6869 /// Remove sponsor.70 ///71 /// @param contractAddress Contract for which a sponsorship is being removed.72 /// @dev EVM selector for this function is: 0xef784250,73 /// or in textual repr: removeSponsor(address)74 function removeSponsor(address contractAddress) public {75 require(false, stub_error);76 contractAddress;77 dummy = 0;78 }7980 /// Confirm sponsorship.81 ///82 /// @dev Caller must be same that set via [`setSponsor`].83 ///84 /// @param contractAddress Сontract for which need to confirm sponsorship.85 /// @dev EVM selector for this function is: 0xabc00001,86 /// or in textual repr: confirmSponsorship(address)87 function confirmSponsorship(address contractAddress) public {88 require(false, stub_error);89 contractAddress;90 dummy = 0;91 }9293 /// Get current sponsor.94 ///95 /// @param contractAddress The contract for which a sponsor is requested.96 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.97 /// @dev EVM selector for this function is: 0x743fc745,98 /// or in textual repr: getSponsor(address)99 function getSponsor(address contractAddress) public view returns (Tuple0 memory) {100 require(false, stub_error);101 contractAddress;102 dummy;103 return Tuple0(0x0000000000000000000000000000000000000000, 0);104 }105106 /// Check tat contract has confirmed sponsor.107 ///108 /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.109 /// @return **true** if contract has confirmed sponsor.110 /// @dev EVM selector for this function is: 0x97418603,111 /// or in textual repr: hasSponsor(address)112 function hasSponsor(address contractAddress) public view returns (bool) {113 require(false, stub_error);114 contractAddress;115 dummy;116 return false;117 }118119 /// Check tat contract has pending sponsor.120 ///121 /// @param contractAddress The contract for which the presence of a pending sponsor is checked.122 /// @return **true** if contract has pending sponsor.123 /// @dev EVM selector for this function is: 0x39b9b242,124 /// or in textual repr: hasPendingSponsor(address)125 function hasPendingSponsor(address contractAddress) public view returns (bool) {126 require(false, stub_error);127 contractAddress;128 dummy;129 return false;130 }131132 /// @dev EVM selector for this function is: 0x6027dc61,133 /// or in textual repr: sponsoringEnabled(address)134 function sponsoringEnabled(address contractAddress) public view returns (bool) {135 require(false, stub_error);136 contractAddress;137 dummy;138 return false;139 }140141 /// @dev EVM selector for this function is: 0xfde8a560,142 /// or in textual repr: setSponsoringMode(address,uint8)143 function setSponsoringMode(address contractAddress, uint8 mode) public {144 require(false, stub_error);145 contractAddress;146 mode;147 dummy = 0;148 }149150 /// Get current contract sponsoring rate limit151 /// @param contractAddress Contract to get sponsoring rate limit of152 /// @return uint32 Amount of blocks between two sponsored transactions153 /// @dev EVM selector for this function is: 0x610cfabd,154 /// or in textual repr: getSponsoringRateLimit(address)155 function getSponsoringRateLimit(address contractAddress) public view returns (uint32) {156 require(false, stub_error);157 contractAddress;158 dummy;159 return 0;160 }161162 /// Set contract sponsoring rate limit163 /// @dev Sponsoring rate limit - is a minimum amount of blocks that should164 /// pass between two sponsored transactions165 /// @param contractAddress Contract to change sponsoring rate limit of166 /// @param rateLimit Target rate limit167 /// @dev Only contract owner can change this setting168 /// @dev EVM selector for this function is: 0x77b6c908,169 /// or in textual repr: setSponsoringRateLimit(address,uint32)170 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) public {171 require(false, stub_error);172 contractAddress;173 rateLimit;174 dummy = 0;175 }176177 /// Set contract sponsoring fee limit178 /// @dev Sponsoring fee limit - is maximum fee that could be spent by179 /// single transaction180 /// @param contractAddress Contract to change sponsoring fee limit of181 /// @param feeLimit Fee limit182 /// @dev Only contract owner can change this setting183 /// @dev EVM selector for this function is: 0x03aed665,184 /// or in textual repr: setSponsoringFeeLimit(address,uint256)185 function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) public {186 require(false, stub_error);187 contractAddress;188 feeLimit;189 dummy = 0;190 }191192 /// Get current contract sponsoring fee limit193 /// @param contractAddress Contract to get sponsoring fee limit of194 /// @return uint256 Maximum amount of fee that could be spent by single195 /// transaction196 /// @dev EVM selector for this function is: 0xc3fdc9ee,197 /// or in textual repr: getSponsoringFeeLimit(address)198 function getSponsoringFeeLimit(address contractAddress) public view returns (uint256) {199 require(false, stub_error);200 contractAddress;201 dummy;202 return 0;203 }204205 /// Is specified user present in contract allow list206 /// @dev Contract owner always implicitly included207 /// @param contractAddress Contract to check allowlist of208 /// @param user User to check209 /// @return bool Is specified users exists in contract allowlist210 /// @dev EVM selector for this function is: 0x5c658165,211 /// or in textual repr: allowed(address,address)212 function allowed(address contractAddress, address user) public view returns (bool) {213 require(false, stub_error);214 contractAddress;215 user;216 dummy;217 return false;218 }219220 /// Toggle user presence in contract allowlist221 /// @param contractAddress Contract to change allowlist of222 /// @param user Which user presence should be toggled223 /// @param isAllowed `true` if user should be allowed to be sponsored224 /// or call this contract, `false` otherwise225 /// @dev Only contract owner can change this setting226 /// @dev EVM selector for this function is: 0x4706cc1c,227 /// or in textual repr: toggleAllowed(address,address,bool)228 function toggleAllowed(229 address contractAddress,230 address user,231 bool isAllowed232 ) public {233 require(false, stub_error);234 contractAddress;235 user;236 isAllowed;237 dummy = 0;238 }239240 /// Is this contract has allowlist access enabled241 /// @dev Allowlist always can have users, and it is used for two purposes:242 /// in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist243 /// in case of allowlist access enabled, only users from allowlist may call this contract244 /// @param contractAddress Contract to get allowlist access of245 /// @return bool Is specified contract has allowlist access enabled246 /// @dev EVM selector for this function is: 0xc772ef6c,247 /// or in textual repr: allowlistEnabled(address)248 function allowlistEnabled(address contractAddress) public view returns (bool) {249 require(false, stub_error);250 contractAddress;251 dummy;252 return false;253 }254255 /// Toggle contract allowlist access256 /// @param contractAddress Contract to change allowlist access of257 /// @param enabled Should allowlist access to be enabled?258 /// @dev EVM selector for this function is: 0x36de20f5,259 /// or in textual repr: toggleAllowlist(address,bool)260 function toggleAllowlist(address contractAddress, bool enabled) public {261 require(false, stub_error);262 contractAddress;263 enabled;264 dummy = 0;265 }266}267268/// @dev anonymous struct269struct Tuple0 {270 address field_0;271 uint256 field_1;272}1// SPDX-License-Identifier: OTHER2// This code is automatically generated34pragma solidity >=0.8.0 <0.9.0;56/// @dev common stubs holder7contract Dummy {8 uint8 dummy;9 string stub_error = "this contract is implemented in native";10}1112contract ERC165 is Dummy {13 function supportsInterface(bytes4 interfaceID) external view returns (bool) {14 require(false, stub_error);15 interfaceID;16 return true;17 }18}1920/// @dev inlined interface21contract ContractHelpersEvents {22 event ContractSponsorSet(address indexed contractAddress, address sponsor);23 event ContractSponsorshipConfirmed(address indexed contractAddress, address sponsor);24 event ContractSponsorRemoved(address indexed contractAddress);25}2627/// @title Magic contract, which allows users to reconfigure other contracts28/// @dev the ERC-165 identifier for this interface is 0x30afad0429contract ContractHelpers is Dummy, ERC165, ContractHelpersEvents {30 /// Get user, which deployed specified contract31 /// @dev May return zero address in case if contract is deployed32 /// using uniquenetwork evm-migration pallet, or using other terms not33 /// intended by pallet-evm34 /// @dev Returns zero address if contract does not exists35 /// @param contractAddress Contract to get owner of36 /// @return address Owner of contract37 /// @dev EVM selector for this function is: 0x5152b14c,38 /// or in textual repr: contractOwner(address)39 function contractOwner(address contractAddress) public view returns (address) {40 require(false, stub_error);41 contractAddress;42 dummy;43 return 0x0000000000000000000000000000000000000000;44 }4546 /// Set sponsor.47 /// @param contractAddress Contract for which a sponsor is being established.48 /// @param sponsor User address who set as pending sponsor.49 /// @dev EVM selector for this function is: 0xf01fba93,50 /// or in textual repr: setSponsor(address,address)51 function setSponsor(address contractAddress, address sponsor) public {52 require(false, stub_error);53 contractAddress;54 sponsor;55 dummy = 0;56 }5758 /// Set contract as self sponsored.59 ///60 /// @param contractAddress Contract for which a self sponsoring is being enabled.61 /// @dev EVM selector for this function is: 0x89f7d9ae,62 /// or in textual repr: selfSponsoredEnable(address)63 function selfSponsoredEnable(address contractAddress) public {64 require(false, stub_error);65 contractAddress;66 dummy = 0;67 }6869 /// Remove sponsor.70 ///71 /// @param contractAddress Contract for which a sponsorship is being removed.72 /// @dev EVM selector for this function is: 0xef784250,73 /// or in textual repr: removeSponsor(address)74 function removeSponsor(address contractAddress) public {75 require(false, stub_error);76 contractAddress;77 dummy = 0;78 }7980 /// Confirm sponsorship.81 ///82 /// @dev Caller must be same that set via [`setSponsor`].83 ///84 /// @param contractAddress Сontract for which need to confirm sponsorship.85 /// @dev EVM selector for this function is: 0xabc00001,86 /// or in textual repr: confirmSponsorship(address)87 function confirmSponsorship(address contractAddress) public {88 require(false, stub_error);89 contractAddress;90 dummy = 0;91 }9293 /// Get current sponsor.94 ///95 /// @param contractAddress The contract for which a sponsor is requested.96 /// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.97 /// @dev EVM selector for this function is: 0x766c4f37,98 /// or in textual repr: sponsor(address)99 function sponsor(address contractAddress) public view returns (Tuple0 memory) {100 require(false, stub_error);101 contractAddress;102 dummy;103 return Tuple0(0x0000000000000000000000000000000000000000, 0);104 }105106 /// Check tat contract has confirmed sponsor.107 ///108 /// @param contractAddress The contract for which the presence of a confirmed sponsor is checked.109 /// @return **true** if contract has confirmed sponsor.110 /// @dev EVM selector for this function is: 0x97418603,111 /// or in textual repr: hasSponsor(address)112 function hasSponsor(address contractAddress) public view returns (bool) {113 require(false, stub_error);114 contractAddress;115 dummy;116 return false;117 }118119 /// Check tat contract has pending sponsor.120 ///121 /// @param contractAddress The contract for which the presence of a pending sponsor is checked.122 /// @return **true** if contract has pending sponsor.123 /// @dev EVM selector for this function is: 0x39b9b242,124 /// or in textual repr: hasPendingSponsor(address)125 function hasPendingSponsor(address contractAddress) public view returns (bool) {126 require(false, stub_error);127 contractAddress;128 dummy;129 return false;130 }131132 /// @dev EVM selector for this function is: 0x6027dc61,133 /// or in textual repr: sponsoringEnabled(address)134 function sponsoringEnabled(address contractAddress) public view returns (bool) {135 require(false, stub_error);136 contractAddress;137 dummy;138 return false;139 }140141 /// @dev EVM selector for this function is: 0xfde8a560,142 /// or in textual repr: setSponsoringMode(address,uint8)143 function setSponsoringMode(address contractAddress, uint8 mode) public {144 require(false, stub_error);145 contractAddress;146 mode;147 dummy = 0;148 }149150 /// Get current contract sponsoring rate limit151 /// @param contractAddress Contract to get sponsoring rate limit of152 /// @return uint32 Amount of blocks between two sponsored transactions153 /// @dev EVM selector for this function is: 0xf29694d8,154 /// or in textual repr: sponsoringRateLimit(address)155 function sponsoringRateLimit(address contractAddress) public view returns (uint32) {156 require(false, stub_error);157 contractAddress;158 dummy;159 return 0;160 }161162 /// Set contract sponsoring rate limit163 /// @dev Sponsoring rate limit - is a minimum amount of blocks that should164 /// pass between two sponsored transactions165 /// @param contractAddress Contract to change sponsoring rate limit of166 /// @param rateLimit Target rate limit167 /// @dev Only contract owner can change this setting168 /// @dev EVM selector for this function is: 0x77b6c908,169 /// or in textual repr: setSponsoringRateLimit(address,uint32)170 function setSponsoringRateLimit(address contractAddress, uint32 rateLimit) public {171 require(false, stub_error);172 contractAddress;173 rateLimit;174 dummy = 0;175 }176177 /// Set contract sponsoring fee limit178 /// @dev Sponsoring fee limit - is maximum fee that could be spent by179 /// single transaction180 /// @param contractAddress Contract to change sponsoring fee limit of181 /// @param feeLimit Fee limit182 /// @dev Only contract owner can change this setting183 /// @dev EVM selector for this function is: 0x03aed665,184 /// or in textual repr: setSponsoringFeeLimit(address,uint256)185 function setSponsoringFeeLimit(address contractAddress, uint256 feeLimit) public {186 require(false, stub_error);187 contractAddress;188 feeLimit;189 dummy = 0;190 }191192 /// Get current contract sponsoring fee limit193 /// @param contractAddress Contract to get sponsoring fee limit of194 /// @return uint256 Maximum amount of fee that could be spent by single195 /// transaction196 /// @dev EVM selector for this function is: 0x75b73606,197 /// or in textual repr: sponsoringFeeLimit(address)198 function sponsoringFeeLimit(address contractAddress) public view returns (uint256) {199 require(false, stub_error);200 contractAddress;201 dummy;202 return 0;203 }204205 /// Is specified user present in contract allow list206 /// @dev Contract owner always implicitly included207 /// @param contractAddress Contract to check allowlist of208 /// @param user User to check209 /// @return bool Is specified users exists in contract allowlist210 /// @dev EVM selector for this function is: 0x5c658165,211 /// or in textual repr: allowed(address,address)212 function allowed(address contractAddress, address user) public view returns (bool) {213 require(false, stub_error);214 contractAddress;215 user;216 dummy;217 return false;218 }219220 /// Toggle user presence in contract allowlist221 /// @param contractAddress Contract to change allowlist of222 /// @param user Which user presence should be toggled223 /// @param isAllowed `true` if user should be allowed to be sponsored224 /// or call this contract, `false` otherwise225 /// @dev Only contract owner can change this setting226 /// @dev EVM selector for this function is: 0x4706cc1c,227 /// or in textual repr: toggleAllowed(address,address,bool)228 function toggleAllowed(229 address contractAddress,230 address user,231 bool isAllowed232 ) public {233 require(false, stub_error);234 contractAddress;235 user;236 isAllowed;237 dummy = 0;238 }239240 /// Is this contract has allowlist access enabled241 /// @dev Allowlist always can have users, and it is used for two purposes:242 /// in case of allowlist sponsoring mode, users will be sponsored if they exist in allowlist243 /// in case of allowlist access enabled, only users from allowlist may call this contract244 /// @param contractAddress Contract to get allowlist access of245 /// @return bool Is specified contract has allowlist access enabled246 /// @dev EVM selector for this function is: 0xc772ef6c,247 /// or in textual repr: allowlistEnabled(address)248 function allowlistEnabled(address contractAddress) public view returns (bool) {249 require(false, stub_error);250 contractAddress;251 dummy;252 return false;253 }254255 /// Toggle contract allowlist access256 /// @param contractAddress Contract to change allowlist access of257 /// @param enabled Should allowlist access to be enabled?258 /// @dev EVM selector for this function is: 0x36de20f5,259 /// or in textual repr: toggleAllowlist(address,bool)260 function toggleAllowlist(address contractAddress, bool enabled) public {261 require(false, stub_error);262 contractAddress;263 enabled;264 dummy = 0;265 }266}267268/// @dev anonymous struct269struct Tuple0 {270 address field_0;271 uint256 field_1;272}tests/src/eth/api/ContractHelpers.soldiffbeforeafterboth--- a/tests/src/eth/api/ContractHelpers.sol
+++ b/tests/src/eth/api/ContractHelpers.sol
@@ -20,7 +20,7 @@
}
/// @title Magic contract, which allows users to reconfigure other contracts
-/// @dev the ERC-165 identifier for this interface is 0x172cb4fb
+/// @dev the ERC-165 identifier for this interface is 0x30afad04
interface ContractHelpers is Dummy, ERC165, ContractHelpersEvents {
/// Get user, which deployed specified contract
/// @dev May return zero address in case if contract is deployed
@@ -67,9 +67,9 @@
///
/// @param contractAddress The contract for which a sponsor is requested.
/// @return Tuble with sponsor address and his substrate mirror. If there is no confirmed sponsor error "Contract has no sponsor" throw.
- /// @dev EVM selector for this function is: 0x743fc745,
- /// or in textual repr: getSponsor(address)
- function getSponsor(address contractAddress) external view returns (Tuple0 memory);
+ /// @dev EVM selector for this function is: 0x766c4f37,
+ /// or in textual repr: sponsor(address)
+ function sponsor(address contractAddress) external view returns (Tuple0 memory);
/// Check tat contract has confirmed sponsor.
///
@@ -98,9 +98,9 @@
/// Get current contract sponsoring rate limit
/// @param contractAddress Contract to get sponsoring rate limit of
/// @return uint32 Amount of blocks between two sponsored transactions
- /// @dev EVM selector for this function is: 0x610cfabd,
- /// or in textual repr: getSponsoringRateLimit(address)
- function getSponsoringRateLimit(address contractAddress) external view returns (uint32);
+ /// @dev EVM selector for this function is: 0xf29694d8,
+ /// or in textual repr: sponsoringRateLimit(address)
+ function sponsoringRateLimit(address contractAddress) external view returns (uint32);
/// Set contract sponsoring rate limit
/// @dev Sponsoring rate limit - is a minimum amount of blocks that should
@@ -126,9 +126,9 @@
/// @param contractAddress Contract to get sponsoring fee limit of
/// @return uint256 Maximum amount of fee that could be spent by single
/// transaction
- /// @dev EVM selector for this function is: 0xc3fdc9ee,
- /// or in textual repr: getSponsoringFeeLimit(address)
- function getSponsoringFeeLimit(address contractAddress) external view returns (uint256);
+ /// @dev EVM selector for this function is: 0x75b73606,
+ /// or in textual repr: sponsoringFeeLimit(address)
+ function sponsoringFeeLimit(address contractAddress) external view returns (uint256);
/// Is specified user present in contract allow list
/// @dev Contract owner always implicitly included
tests/src/eth/contractSponsoring.test.tsdiffbeforeafterboth--- a/tests/src/eth/contractSponsoring.test.ts
+++ b/tests/src/eth/contractSponsoring.test.ts
@@ -223,7 +223,7 @@
const helpers = contractHelpers(web3, owner);
await helpers.methods.selfSponsoredEnable(flipper.options.address).send();
- const result = await helpers.methods.getSponsor(flipper.options.address).call();
+ const result = await helpers.methods.sponsor(flipper.options.address).call();
expect(result[0]).to.be.eq(flipper.options.address);
expect(result[1]).to.be.eq('0');
@@ -237,7 +237,7 @@
await helpers.methods.setSponsor(flipper.options.address, sponsor).send();
await helpers.methods.confirmSponsorship(flipper.options.address).send({from: sponsor});
- const result = await helpers.methods.getSponsor(flipper.options.address).call();
+ const result = await helpers.methods.sponsor(flipper.options.address).call();
expect(result[0]).to.be.eq(sponsor);
expect(result[1]).to.be.eq('0');
@@ -482,7 +482,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
- expect(await helpers.methods.getSponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
+ expect(await helpers.methods.sponsoringRateLimit(flipper.options.address).call()).to.be.equals('7200');
});
});
@@ -551,7 +551,7 @@
const owner = await createEthAccountWithBalance(api, web3, privateKeyWrapper);
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
- expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
+ expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('115792089237316195423570985008687907853269984665640564039457584007913129639935');
});
itWeb3('Set fee limit', async ({api, web3, privateKeyWrapper}) => {
@@ -559,7 +559,7 @@
const flipper = await deployFlipper(web3, owner);
const helpers = contractHelpers(web3, owner);
await helpers.methods.setSponsoringFeeLimit(flipper.options.address, 100).send();
- expect(await helpers.methods.getSponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
+ expect(await helpers.methods.sponsoringFeeLimit(flipper.options.address).call()).to.be.equals('100');
});
itWeb3('Negative test - set fee limit by non-owner', async ({api, web3, privateKeyWrapper}) => {
tests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth--- a/tests/src/eth/util/contractHelpersAbi.json
+++ b/tests/src/eth/util/contractHelpersAbi.json
@@ -111,18 +111,8 @@
"type": "address"
}
],
- "name": "getSponsor",
- "outputs": [
- {
- "components": [
- { "internalType": "address", "name": "field_0", "type": "address" },
- { "internalType": "uint256", "name": "field_1", "type": "uint256" }
- ],
- "internalType": "struct Tuple0",
- "name": "",
- "type": "tuple"
- }
- ],
+ "name": "hasPendingSponsor",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
@@ -134,8 +124,8 @@
"type": "address"
}
],
- "name": "getSponsoringFeeLimit",
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "name": "hasSponsor",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
"stateMutability": "view",
"type": "function"
},
@@ -147,9 +137,9 @@
"type": "address"
}
],
- "name": "getSponsoringRateLimit",
- "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
- "stateMutability": "view",
+ "name": "removeSponsor",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -160,9 +150,9 @@
"type": "address"
}
],
- "name": "hasPendingSponsor",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
- "stateMutability": "view",
+ "name": "selfSponsoredEnable",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -171,11 +161,12 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "address", "name": "sponsor", "type": "address" }
],
- "name": "hasSponsor",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
- "stateMutability": "view",
+ "name": "setSponsor",
+ "outputs": [],
+ "stateMutability": "nonpayable",
"type": "function"
},
{
@@ -184,9 +175,10 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "uint256", "name": "feeLimit", "type": "uint256" }
],
- "name": "removeSponsor",
+ "name": "setSponsoringFeeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -197,9 +189,10 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- }
+ },
+ { "internalType": "uint8", "name": "mode", "type": "uint8" }
],
- "name": "selfSponsoredEnable",
+ "name": "setSponsoringMode",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -211,9 +204,9 @@
"name": "contractAddress",
"type": "address"
},
- { "internalType": "address", "name": "sponsor", "type": "address" }
+ { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }
],
- "name": "setSponsor",
+ "name": "setSponsoringRateLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
@@ -224,12 +217,21 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint256", "name": "feeLimit", "type": "uint256" }
+ }
+ ],
+ "name": "sponsor",
+ "outputs": [
+ {
+ "components": [
+ { "internalType": "address", "name": "field_0", "type": "address" },
+ { "internalType": "uint256", "name": "field_1", "type": "uint256" }
+ ],
+ "internalType": "struct Tuple0",
+ "name": "",
+ "type": "tuple"
+ }
],
- "name": "setSponsoringFeeLimit",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "stateMutability": "view",
"type": "function"
},
{
@@ -238,12 +240,11 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint8", "name": "mode", "type": "uint8" }
+ }
],
- "name": "setSponsoringMode",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "name": "sponsoringEnabled",
+ "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "stateMutability": "view",
"type": "function"
},
{
@@ -252,12 +253,11 @@
"internalType": "address",
"name": "contractAddress",
"type": "address"
- },
- { "internalType": "uint32", "name": "rateLimit", "type": "uint32" }
+ }
],
- "name": "setSponsoringRateLimit",
- "outputs": [],
- "stateMutability": "nonpayable",
+ "name": "sponsoringFeeLimit",
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
+ "stateMutability": "view",
"type": "function"
},
{
@@ -268,8 +268,8 @@
"type": "address"
}
],
- "name": "sponsoringEnabled",
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
+ "name": "sponsoringRateLimit",
+ "outputs": [{ "internalType": "uint32", "name": "", "type": "uint32" }],
"stateMutability": "view",
"type": "function"
},