Add test cases around new EXTCODEHASH behavior
fulldecent opened this issue · comments
The behavior of this implementation was changed slightly with the switch to EXTCODEHASH. Let's document this using test cases.
Mocks:
- Contract R
- Has a token receive function which emits an event Received
- Contract A
is R
- Has constructor
- Deploys NFToken
- Mints token id=1
- Transfers token id=1 to self
- Has constructor
- Contract B
- Has constructor
- Deploys NFToken
- Deploys R
- Transfers token id=1 to R
- Has constructor
Tests:
- Test 1
- Transaction 1 -- Deploy NFToken
- Transaction 2 -- Mint token id=1
- Transaction 3 -- Deploy Contract R
- Transaction 4 -- Transfer token id=1 to R
- Expect NO event on Constantinople
- Test 2
- Transaction 1 -- Deploy NFToken
- Transaction 2 -- Mint token id=1
- Transaction 3 -- Deploy Contract R
- Expect NO event on Constantinople
- Test 3
- Transaction 1 -- Deploy Contract B
- Expect event on Constantinople (but no event with same test using old version of implementation)
@fulldecent do you have time to add these? The rest of the team is overbooked at the moment.
You bet, I'm on it.
I think there should be another test for a transfer to a contract that has selfdestructed, since the result of extcodehash will be different.
Progress on a test is here #241
Requesting help with this line:
https://github.com/0xcert/ethereum-erc721/pull/241/files#diff-1eaa4a12fea6a0a32769fb056436a04aR408
I need to check logs from a deploy transaction.