diff --git a/core/blockchain_test.go b/core/blockchain_test.go index e201df414..ac748319f 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -2408,6 +2408,9 @@ func TestProcessingStateDiffs(t *testing.T) { moreBlocks := makeBlockChain(blocks[len(blocks)-1], 1, engine, db, canonicalSeed) _, err = blockchain.InsertChain(moreBlocks) + if err != nil { + t.Error(err) + } //a root hash can be dereferenced when it's state diff and it's child's state diff have been processed //(i.e. it has a count of 2 in stateDiffsProcessed) diff --git a/statediff/testhelpers/mocks/api_test.go b/statediff/testhelpers/mocks/api_test.go index 89e51db08..886372691 100644 --- a/statediff/testhelpers/mocks/api_test.go +++ b/statediff/testhelpers/mocks/api_test.go @@ -166,6 +166,9 @@ func testHTTPAPI(t *testing.T) { streamBlock: true, } payload, err := mockService.StateDiffAt(block1.Number().Uint64()) + if err != nil { + t.Error(err) + } expectedBlockRlp, _ := rlp.EncodeToBytes(block1) if !bytes.Equal(payload.BlockRlp, expectedBlockRlp) { t.Errorf("payload does not have expected block\r\actual block rlp: %v\r\nexpected block rlp: %v", payload.BlockRlp, expectedBlockRlp) diff --git a/statediff/types.go b/statediff/types.go index 3bfb598a5..95aef777d 100644 --- a/statediff/types.go +++ b/statediff/types.go @@ -64,8 +64,8 @@ func (sd *Payload) Encode() ([]byte, error) { // StateDiff is the final output structure from the builder type StateDiff struct { - BlockNumber *big.Int `json:"blockNumber" gencodec:"required"` - BlockHash common.Hash `json:"blockHash" gencodec:"required"` + BlockNumber *big.Int `json:"blockNumber" gencodec:"required"` + BlockHash common.Hash `json:"blockHash" gencodec:"required"` CreatedAccounts []AccountDiff `json:"createdAccounts" gencodec:"required"` DeletedAccounts []AccountDiff `json:"deletedAccounts" gencodec:"required"` UpdatedAccounts []AccountDiff `json:"updatedAccounts" gencodec:"required"` @@ -76,7 +76,7 @@ type StateDiff struct { // AccountDiff holds the data for a single state diff node type AccountDiff struct { - Leaf bool `json:"leaf" gencodec:"required"` + Leaf bool `json:"leaf" gencodec:"required"` Key []byte `json:"key" gencodec:"required"` Value []byte `json:"value" gencodec:"required"` Proof [][]byte `json:"proof" gencodec:"required"` @@ -86,7 +86,7 @@ type AccountDiff struct { // StorageDiff holds the data for a single storage diff node type StorageDiff struct { - Leaf bool `json:"leaf" gencodec:"required"` + Leaf bool `json:"leaf" gencodec:"required"` Key []byte `json:"key" gencodec:"required"` Value []byte `json:"value" gencodec:"required"` Proof [][]byte `json:"proof" gencodec:"required"`