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

This commit is contained in:
Elizabeth Engelman 2019-08-09 15:20:03 -04:00
parent deb0315a49
commit 3fb8e13979
3 changed files with 3 additions and 5 deletions

View File

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

View File

@ -17,8 +17,6 @@
package mocks
import (
"github.com/ethereum/go-ethereum/common"
"github.com/vulcanize/vulcanizedb/libraries/shared/storage/utils"
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
)
@ -29,7 +27,7 @@ type MockMappings struct {
LookupErr error
}
func (mappings *MockMappings) Lookup(key common.Hash) (utils.StorageValueMetadata, error) {
func (mappings *MockMappings) Lookup(diff utils.StorageDiff) (utils.StorageValueMetadata, error) {
mappings.LookupCalled = true
return mappings.Metadata, mappings.LookupErr
}

View File

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