(VDB-950) Write raw diffs before transforming
- Raw field we can reference by FK for related data - Enables replay for unwatched or mistransformed diffs
This commit is contained in:
committed by
Ian Norden
parent
1178940047
commit
56ce8bdb41
@@ -33,12 +33,12 @@ var topic0 = "0x" + randomString(64)
|
||||
var GenericTestLog = func() types.Log {
|
||||
return types.Log{
|
||||
Address: fakeAddress(),
|
||||
Topics: []common.Hash{common.HexToHash(topic0), fakeHash()},
|
||||
Data: hexutil.MustDecode(fakeHash().Hex()),
|
||||
Topics: []common.Hash{common.HexToHash(topic0), FakeHash()},
|
||||
Data: hexutil.MustDecode(FakeHash().Hex()),
|
||||
BlockNumber: uint64(startingBlockNumber),
|
||||
TxHash: fakeHash(),
|
||||
TxHash: FakeHash(),
|
||||
TxIndex: uint(rand.Int31()),
|
||||
BlockHash: fakeHash(),
|
||||
BlockHash: FakeHash(),
|
||||
Index: uint(rand.Int31()),
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ func fakeAddress() common.Address {
|
||||
return common.HexToAddress("0x" + randomString(40))
|
||||
}
|
||||
|
||||
func fakeHash() common.Hash {
|
||||
func FakeHash() common.Hash {
|
||||
return common.HexToHash("0x" + randomString(64))
|
||||
}
|
||||
|
||||
|
||||
@@ -150,32 +150,28 @@ var (
|
||||
StateDiffRlp: MockStateDiff2Bytes,
|
||||
}
|
||||
|
||||
CreatedExpectedStorageDiff = utils.StorageDiff{
|
||||
ID: 0,
|
||||
CreatedExpectedStorageDiff = utils.StorageDiffInput{
|
||||
HashedAddress: common.BytesToHash(ContractLeafKey[:]),
|
||||
BlockHash: common.HexToHash(BlockHash),
|
||||
BlockHeight: int(BlockNumber.Int64()),
|
||||
StorageKey: common.BytesToHash(StorageKey),
|
||||
StorageValue: common.BytesToHash(SmallStorageValue),
|
||||
}
|
||||
UpdatedExpectedStorageDiff = utils.StorageDiff{
|
||||
ID: 0,
|
||||
UpdatedExpectedStorageDiff = utils.StorageDiffInput{
|
||||
HashedAddress: common.BytesToHash(AnotherContractLeafKey[:]),
|
||||
BlockHash: common.HexToHash(BlockHash),
|
||||
BlockHeight: int(BlockNumber.Int64()),
|
||||
StorageKey: common.BytesToHash(StorageKey),
|
||||
StorageValue: common.BytesToHash(LargeStorageValue),
|
||||
}
|
||||
UpdatedExpectedStorageDiff2 = utils.StorageDiff{
|
||||
ID: 0,
|
||||
UpdatedExpectedStorageDiff2 = utils.StorageDiffInput{
|
||||
HashedAddress: common.BytesToHash(AnotherContractLeafKey[:]),
|
||||
BlockHash: common.HexToHash(BlockHash2),
|
||||
BlockHeight: int(BlockNumber2.Int64()),
|
||||
StorageKey: common.BytesToHash(StorageKey),
|
||||
StorageValue: common.BytesToHash(SmallStorageValue),
|
||||
}
|
||||
DeletedExpectedStorageDiff = utils.StorageDiff{
|
||||
ID: 0,
|
||||
DeletedExpectedStorageDiff = utils.StorageDiffInput{
|
||||
HashedAddress: common.BytesToHash(AnotherContractLeafKey[:]),
|
||||
BlockHash: common.HexToHash(BlockHash),
|
||||
BlockHeight: int(BlockNumber.Int64()),
|
||||
|
||||
Reference in New Issue
Block a user