Revert "Update Mappings interface to take a diff as an argument to Lookup"

This reverts commit cda646b78ceb6714b132891ea4489a8ff4fc95e9.
This commit is contained in:
Rob Mulholand 2019-08-13 19:52:49 -05:00 committed by Elizabeth Engelman
parent 8111f4ec5e
commit f574407bb6
3 changed files with 5 additions and 3 deletions

View File

@ -42,7 +42,7 @@ func (transformer Transformer) ContractAddress() common.Address {
} }
func (transformer Transformer) Execute(diff utils.StorageDiff) error { func (transformer Transformer) Execute(diff utils.StorageDiff) error {
metadata, lookupErr := transformer.Mappings.Lookup(diff) metadata, lookupErr := transformer.Mappings.Lookup(diff.StorageKey)
if lookupErr != nil { if lookupErr != nil {
return lookupErr return lookupErr
} }

View File

@ -17,6 +17,8 @@
package mocks package mocks
import ( import (
"github.com/ethereum/go-ethereum/common"
"github.com/vulcanize/vulcanizedb/libraries/shared/storage/utils" "github.com/vulcanize/vulcanizedb/libraries/shared/storage/utils"
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres" "github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
) )
@ -27,7 +29,7 @@ type MockMappings struct {
LookupErr error 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 mappings.LookupCalled = true
return mappings.Metadata, mappings.LookupErr return mappings.Metadata, mappings.LookupErr
} }

View File

@ -27,7 +27,7 @@ import (
) )
type Mappings interface { type Mappings interface {
Lookup(diff utils.StorageDiff) (utils.StorageValueMetadata, error) Lookup(key common.Hash) (utils.StorageValueMetadata, error)
SetDB(db *postgres.DB) SetDB(db *postgres.DB)
} }