Update Mappings interface to take a diff as an argument to Lookup
This commit is contained in:
parent
deb0315a49
commit
3fb8e13979
@ -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.StorageKey)
|
metadata, lookupErr := transformer.Mappings.Lookup(diff)
|
||||||
if lookupErr != nil {
|
if lookupErr != nil {
|
||||||
return lookupErr
|
return lookupErr
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
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"
|
||||||
)
|
)
|
||||||
@ -29,7 +27,7 @@ type MockMappings struct {
|
|||||||
LookupErr error
|
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
|
mappings.LookupCalled = true
|
||||||
return mappings.Metadata, mappings.LookupErr
|
return mappings.Metadata, mappings.LookupErr
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Mappings interface {
|
type Mappings interface {
|
||||||
Lookup(key common.Hash) (utils.StorageValueMetadata, error)
|
Lookup(diff utils.StorageDiff) (utils.StorageValueMetadata, error)
|
||||||
SetDB(db *postgres.DB)
|
SetDB(db *postgres.DB)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user