fix linter issues

This commit is contained in:
Ian Norden 2019-12-09 15:07:40 -06:00
parent 2395e70a61
commit 6e05b78bd0
3 changed files with 10 additions and 4 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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"`