Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit f574407

Browse files
Rob Mulholandelizabethengelman
authored andcommitted
Revert "Update Mappings interface to take a diff as an argument to Lookup"
This reverts commit cda646b.
1 parent 8111f4e commit f574407

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

libraries/shared/factories/storage/transformer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (transformer Transformer) ContractAddress() common.Address {
4242
}
4343

4444
func (transformer Transformer) Execute(diff utils.StorageDiff) error {
45-
metadata, lookupErr := transformer.Mappings.Lookup(diff)
45+
metadata, lookupErr := transformer.Mappings.Lookup(diff.StorageKey)
4646
if lookupErr != nil {
4747
return lookupErr
4848
}

libraries/shared/mocks/storage_mappings.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package mocks
1818

1919
import (
20+
"github.com/ethereum/go-ethereum/common"
21+
2022
"github.com/vulcanize/vulcanizedb/libraries/shared/storage/utils"
2123
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
2224
)
@@ -27,7 +29,7 @@ type MockMappings struct {
2729
LookupErr error
2830
}
2931

30-
func (mappings *MockMappings) Lookup(diff utils.StorageDiff) (utils.StorageValueMetadata, error) {
32+
func (mappings *MockMappings) Lookup(key common.Hash) (utils.StorageValueMetadata, error) {
3133
mappings.LookupCalled = true
3234
return mappings.Metadata, mappings.LookupErr
3335
}

libraries/shared/storage/mappings.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
)
2828

2929
type Mappings interface {
30-
Lookup(diff utils.StorageDiff) (utils.StorageValueMetadata, error)
30+
Lookup(key common.Hash) (utils.StorageValueMetadata, error)
3131
SetDB(db *postgres.DB)
3232
}
3333

0 commit comments

Comments
 (0)