-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transaction reverted with encoded error but string was expected #2821
Comments
It appears some events are not emitted for the following tests within Axelargateway: should allow the operators to burn external tokens Sample Transaction Hashes for Tests: One of their partners faced similar issues, which was related to NOTE: This is a separate issue. New issue created: hashgraph/hedera-smart-contracts#898 |
these 3 fail as well: |
Hi @blockchainguyy and @mgarbs, thanks for reporting this. After some investigation, we were able to reproduce the error. However, the error happens on Sepolia as well. Could you to confirm that's the case? (that the error happens in both Hedera Testnet and Sepolia). If yes, it might be better to change the test to wait for the transaction. Also FYI, I had to modify |
The tests for Ethereum Sepolia and Fantom networks appear to be running successfully:
However, this might be related to this issue for which I have added the below mentioned workaround for Hedera:
The tests that passed on the Fantom and Ethereum Sepolia networks were executed from the main branch in |
We have detected the root cause of the issue. Essentially, the How to ReproduceCreate an empty Hardhat project, set up // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
contract RevertOnReceive {
error NativeCurrencyNotAccepted();
receive() external payable {
revert NativeCurrencyNotAccepted();
}
} const { expect } = require("chai");
const { ethers } = require("hardhat");
describe("RevertOnReceive", function () {
it("should revert with custom error on `receive`", async function () {
const [signer] = await ethers.getSigners();
const ContractFactory = await ethers.getContractFactory("RevertOnReceive");
const contract = await ContractFactory.deploy();
await expect(signer.sendTransaction({
to: await contract.getAddress(),
value: 10_000_000_001,
})).to.be.revertedWithCustomError(contract, "NativeCurrencyNotAccepted");
});
}); Then run $ npx hardhat test --network local
[...]
1) RevertOnReceive
should revert with custom error on `receive`:
AssertionError: Expected transaction to be reverted with custom error 'NativeCurrencyNotAccepted', but it didn't revert
[...] In the Relay logs, you can notice the line
This is the {
method: 'eth_estimateGas',
params: [
{
value: '0x2540be401',
from: '0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69',
to: '0x23f5e49569a835d7bf9aefd30e4f60cdd570f225'
},
'pending'
]
} |
Thank you for bringing this issue to our attention. After further investigation, I have identified the following:
As a result of this investigation, I have created the following issues:
We will prioritize these issues as soon as possible. In the meantime, if you have any additional concerns or questions, please feel free to add them in the comments. |
Great findings, thanks @victor-yanev. |
Still getting reports of failures on reverts and timeouts as before- @blockchainguyy can you confirm? `canhaxelar@Canhs-MBP axelar-cgp-solidity % npx hardhat test --network hedera --grep 'AxelarGateway' AxelarGateway AxelarGatewayUpgrade 17 passing (18m)
canhaxelar@Canhs-MBP axelar-cgp-solidity `% |
Hi @mgarbs, @blockchainguyy. Timeout errors are still expected. We are working on a definitive fix to improve this. See #2808 (comment) for a workaround. The fix for expected event errors (related to The revert tests also work in $ npx hardhat test --network hedera-testnet --grep 'should fail on receiving native value'
AxelarGateway
axelar gateway proxy
✔ should fail on receiving native value (68975ms) $ npx hardhat test --network hedera-testnet --grep 'check external methods that should only be called by self'
AxelarGateway
check external methods that should only be called by self
✔ should fail on external call to deployToken (620ms)
✔ should fail on external call to mintToken (447ms)
✔ should fail on external call to burnToken (354ms)
✔ should fail on external call to approveContractCall (524ms)
✔ should fail on external call to approveContractCallWithMint (297ms)
✔ should fail on external call to transferOperatorship (384ms) $ npx hardhat test --network hedera-testnet --grep 'should fail if chain id mismatches'
AxelarGateway
chain id
✔ should fail if chain id mismatches (1686ms) |
Description
The Axelar team is encountering an issue where they are expecting a revert message to be a string but it is coming back encoded. Below are the details of the scenario:
AssertionError: Expected transaction to be reverted with custom error 'NativeCurrencyNotAccepted', but it didn't revert
Steps to Reproduce
AxelarGateway.js
test file.Expected Behavior The transaction should revert with
NativeCurrencyNotAccepted
in the string.Actual Behavior The transaction reverts with the right error but it is encoded and Axelar is expecting it to be a string in parity with many other evms they've integrated
Environment
The text was updated successfully, but these errors were encountered: