(VDB-280) Consume vat contract storage diffs
This commit is contained in:
@@ -16,7 +16,9 @@
|
||||
|
||||
package shared
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type ErrContractNotFound struct {
|
||||
Contract string
|
||||
@@ -36,6 +38,14 @@ func (e ErrHeaderMismatch) Error() string {
|
||||
return fmt.Sprintf("header hash in row does not match db at height %d - row: %s, db: %s", e.BlockHeight, e.DbHash, e.DiffHash)
|
||||
}
|
||||
|
||||
type ErrMetadataMalformed struct {
|
||||
MissingData Key
|
||||
}
|
||||
|
||||
func (e ErrMetadataMalformed) Error() string {
|
||||
return fmt.Sprintf("storage metadata malformed: missing %s", e.MissingData)
|
||||
}
|
||||
|
||||
type ErrRowMalformed struct {
|
||||
Length int
|
||||
}
|
||||
|
||||
@@ -24,10 +24,11 @@ const (
|
||||
Address
|
||||
)
|
||||
|
||||
type Key int
|
||||
type Key string
|
||||
|
||||
const (
|
||||
Ilk Key = iota
|
||||
Ilk Key = "ilk"
|
||||
Guy Key = "guy"
|
||||
)
|
||||
|
||||
type StorageValueMetadata struct {
|
||||
@@ -35,3 +36,11 @@ type StorageValueMetadata struct {
|
||||
Keys map[Key]string
|
||||
Type ValueType
|
||||
}
|
||||
|
||||
func GetStorageValueMetadata(name string, keys map[Key]string, t ValueType) StorageValueMetadata {
|
||||
return StorageValueMetadata{
|
||||
Name: name,
|
||||
Keys: keys,
|
||||
Type: t,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user