-
Notifications
You must be signed in to change notification settings - Fork 4
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
Vdb 833 more robust statediffing tests #15
Vdb 833 more robust statediffing tests #15
Conversation
0423e80
to
965dd84
Compare
965dd84
to
f5cab3a
Compare
… types Update test account variable names with block numbers
f5cab3a
to
f51d44d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for improving these tests :)
//slot 1: mapping(uint => TestStruct) | ||
// calculate key for TestStruct.var1 | ||
testStructVar1Key = calculateTestStructStorageKey() // cc69885fda6bcc1a4ace058b4a62bf5e179ea78fd58a1ccd71c22cc9b688792f | ||
keccakOfTestStructVar1Key = crypto.Keccak256Hash(testStructVar1Key.Bytes()) // the statediff service is currently emitting the key as a keccak hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see how the emitted keys are so confusing now, since calculateTestStructStorageKey
already returns a hash/the key itself is already a hash.
Modifications to message struct
* eth-sign: initial implementation * sighash: pre-refactor * sighash: refactor, all old tests pass * sighash: test ovmsigner code paths for eip155 and eth_sign * sighash: tx serialization tests * sighash: refactor to sign bytes * common/varbytes: use varbytes serialization from btcd * transactionmeta: implement and test * rawdb: add new index * types/transaction: use txmeta * blockchain: index tx meta on new block * rpc: fix sendrawethsigntransaction docstring * meta test: remove dead code * ethapi: clean up comment * lint: fix * txmeta: clean up compares * ethapi: remove rlp tag * signer: remove rlp encoding tags from struct * types: use factory pattern for getting sighash type * sighash: migrate to using const * tx pool: use ovmsigner for tx validation * tx signing: fix eth_sign serialization * sighash: new version * sighash: commit to chainid * sighash: bugfixes * core/types: prevent panic on tx sort * core/types: rename to transaction_meta * core/blockchain: index txmeta * sighash: no native value * ethapi: use ovm signer * sighash: move chainid
Updated the contract that's being used to test the statediffing work. The biggest change is that
TestContract
now has different data types in it's storage: bytes32, address, uint48, uint256[10], mapping(uint => TestStruct).Note: I was having trouble calculating the TestStruct storage key earlier, but I think it was a silly mistake that I figured out, and it is now working. i.e. common.HexToHash(“3”) !=common.Hex2Bytes(“03”) != common.Hex2Bytes(“3”) 🤦♀
This should be ready for review finally! 😅