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

Commit 3fb8e13

Browse files
Update Mappings interface to take a diff as an argument to Lookup
1 parent deb0315 commit 3fb8e13

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
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.StorageKey)
45+
metadata, lookupErr := transformer.Mappings.Lookup(diff)
4646
if lookupErr != nil {
4747
return lookupErr
4848
}

libraries/shared/mocks/storage_mappings.go

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

1919
import (
20-
"github.com/ethereum/go-ethereum/common"
21-
2220
"github.com/vulcanize/vulcanizedb/libraries/shared/storage/utils"
2321
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
2422
)
@@ -29,7 +27,7 @@ type MockMappings struct {
2927
LookupErr error
3028
}
3129

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

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(key common.Hash) (utils.StorageValueMetadata, error)
30+
Lookup(diff utils.StorageDiff) (utils.StorageValueMetadata, error)
3131
SetDB(db *postgres.DB)
3232
}
3333

0 commit comments

Comments
 (0)