Skip to content

Commit

Permalink
Update builder tests to use geth statediff test helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
nikugogoi committed May 11, 2022
1 parent 32724ff commit 9f11fbe
Show file tree
Hide file tree
Showing 5 changed files with 232 additions and 534 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## Build docker image
.PHONY: docker-build
docker-build:
docker build -t vulcanize/eth-statediff-service .
docker build -t vulcanize/eth-statediff-service .

.PHONY: test
test: | $(GOOSE)
go get github.com/stretchr/testify/[email protected]
go test -p 1 ./pkg/... -v
4 changes: 2 additions & 2 deletions pkg/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (sdb *builder) buildStateTrie(it trie.NodeIterator) ([]sdtypes.StateNode, [
return nil, nil, fmt.Errorf("failed building eventual storage diffs for account %+v\r\nerror: %v", account, err)
}
node.StorageNodes = storageNodes
// emit codehash => code mappings for cod
// emit codehash => code mappings for code
codeHash := common.BytesToHash(account.CodeHash)
code, err := sdb.stateCache.ContractCode(common.Hash{}, codeHash)
if err != nil {
Expand Down Expand Up @@ -576,7 +576,7 @@ func (sdb *builder) buildAccountCreations(accounts AccountMap, intermediateStora
return fmt.Errorf("failed building eventual storage diffs for node %x\r\nerror: %v", val.Path, err)
}
diff.StorageNodes = storageDiffs
// emit codehash => code mappings for cod
// emit codehash => code mappings for code
codeHash := common.BytesToHash(val.Account.CodeHash)
code, err := sdb.stateCache.ContractCode(common.Hash{}, codeHash)
if err != nil {
Expand Down
Loading

0 comments on commit 9f11fbe

Please sign in to comment.