You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
contract ERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
function transferFrom(address from, address to, uint256 value) public returns (bool) {
emit Transfer(from, to, value);
}
}
and
contract ERC721 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
function transferFrom(address from, address to, uint256 tokenId) public {
emit Transfer(from, to, tokenId);
}
}
Then, there is a third contract which calls both ERC20 and ERC721 contracts within a single transaction, so that both issue their Transfer events within the tx.
contract Main {
function main(
address addrERC20, address addrERC721,
address from, address to,
uint256 value, uint256 tokenId) {
ERC20(addrERC20).transferFrom(from, to, value);
ERC721(addrERC721).transferFrom(from, to, tokenId);
}
}
The problem is that such a tx gets stuck and then fails due to timeout.
Different events with the same name and signature issued within a single transaction should work as fine as any other different events issued within a single transaction.
Actual behavior
(as reported by Truffle/Mocha):
Error: Timeout of 300000ms exceeded. For async tests and hooks, ensure "done()" is called;
if returning a Promise, ensure it resolves. (/path/to/my/test.js)
I re-tested on all version from 1.0.0-beta.49 to 1.0.0-beta.55. This issue was fixed in 1.0.0-beta.51 and is not present in higher versions.
The timeout might be because I tried to use multiple Web3 instances in a Truffle test, the first one is the Truffle's embedded web3, and the second one is a project-level web3@latest.
Description
I have two contracts:
and
Then, there is a third contract which calls both ERC20 and ERC721 contracts within a single transaction, so that both issue their Transfer events within the tx.
The problem is that such a tx gets stuck and then fails due to timeout.
Making the event names different fixes the issue.
E.g.,
and
works just fine.
There is a related but closed issue: #2542
Expected behavior
Different events with the same name and signature issued within a single transaction should work as fine as any other different events issued within a single transaction.
Actual behavior
(as reported by Truffle/Mocha):
Versions
The text was updated successfully, but these errors were encountered: