From f574407bb6c198c5faa621eb264e558be89f874e Mon Sep 17 00:00:00 2001 From: Rob Mulholand Date: Tue, 13 Aug 2019 19:52:49 -0500 Subject: [PATCH] Revert "Update Mappings interface to take a diff as an argument to Lookup" This reverts commit cda646b78ceb6714b132891ea4489a8ff4fc95e9. --- libraries/shared/factories/storage/transformer.go | 2 +- libraries/shared/mocks/storage_mappings.go | 4 +++- libraries/shared/storage/mappings.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/shared/factories/storage/transformer.go b/libraries/shared/factories/storage/transformer.go index f38b06f2..240924bd 100644 --- a/libraries/shared/factories/storage/transformer.go +++ b/libraries/shared/factories/storage/transformer.go @@ -42,7 +42,7 @@ func (transformer Transformer) ContractAddress() common.Address { } func (transformer Transformer) Execute(diff utils.StorageDiff) error { - metadata, lookupErr := transformer.Mappings.Lookup(diff) + metadata, lookupErr := transformer.Mappings.Lookup(diff.StorageKey) if lookupErr != nil { return lookupErr } diff --git a/libraries/shared/mocks/storage_mappings.go b/libraries/shared/mocks/storage_mappings.go index b44620ad..d2f681bb 100644 --- a/libraries/shared/mocks/storage_mappings.go +++ b/libraries/shared/mocks/storage_mappings.go @@ -17,6 +17,8 @@ package mocks import ( + "github.com/ethereum/go-ethereum/common" + "github.com/vulcanize/vulcanizedb/libraries/shared/storage/utils" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" ) @@ -27,7 +29,7 @@ type MockMappings struct { LookupErr error } -func (mappings *MockMappings) Lookup(diff utils.StorageDiff) (utils.StorageValueMetadata, error) { +func (mappings *MockMappings) Lookup(key common.Hash) (utils.StorageValueMetadata, error) { mappings.LookupCalled = true return mappings.Metadata, mappings.LookupErr } diff --git a/libraries/shared/storage/mappings.go b/libraries/shared/storage/mappings.go index 24740c59..9a534925 100644 --- a/libraries/shared/storage/mappings.go +++ b/libraries/shared/storage/mappings.go @@ -27,7 +27,7 @@ import ( ) type Mappings interface { - Lookup(diff utils.StorageDiff) (utils.StorageValueMetadata, error) + Lookup(key common.Hash) (utils.StorageValueMetadata, error) SetDB(db *postgres.DB) }