diff --git a/tests/unit/vault/test_executexSwapAndCall.py b/tests/unit/vault/test_executexSwapAndCall.py index 066cc35b..50d6430d 100644 --- a/tests/unit/vault/test_executexSwapAndCall.py +++ b/tests/unit/vault/test_executexSwapAndCall.py @@ -290,53 +290,3 @@ def test_executexSwapAndCallToken( ] -def test_executexSwapAndCallToken_gasTest400( - cf, - cfTester, - token, -): - # Hardcode variables to speed up the test - srcChain = 1 - amount = TEST_AMNT - st_srcAddress = bytes.fromhex(cf.ALICE.address[2:]) - - token.transfer(cf.vault, amount * 2, {"from": cf.SAFEKEEPER}) - - # Currently the gasLimit is hardcoded at 400k in the state chain. - - ## GasTest 270k makes the whole transaction consume 392k with ccmTestGasUsed: 272k - # => overhead = 120k, that's including a bunch of logic in the receiver contract. - # With no code in the receiver (except checking the vault address) it's 112k - # Depending on the tx number it reverts between 270 and 300k. - message = encode_abi(["string", "uint256"], ["GasTest", 270000]) - args = [ - [token, cfTester.address, amount], - srcChain, - st_srcAddress, - message, - ] - sigData = AGG_SIGNER_1.getSigDataWithNonces( - cf.keyManager, cf.vault.executexSwapAndCall, nonces, *args - ) - tx = cf.vault.executexSwapAndCall( - sigData, - *args, - {"from": cf.ALICE, "gas": 400000}, - ) - - assert tx.events["ReceivedxSwapAndCall"]["ccmTestGasUsed"] >= 270000 - - # overhead = tx.gas_used - tx.events["ReceivedxSwapAndCall"]["ccmTestGasUsed"] - message = encode_abi(["string", "uint256"], ["GasTest", 300000]) - args[3] = message - sigData = AGG_SIGNER_1.getSigDataWithNonces( - cf.keyManager, cf.vault.executexSwapAndCall, nonces, *args - ) - - # Reverts - run out of gas - with reverts(""): - cf.vault.executexSwapAndCall( - sigData, - *args, - {"from": cf.ALICE, "gas": 400000}, - )