Skip to content

Commit

Permalink
Remove redundant deferences for pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdul Rabbani committed Apr 6, 2022
1 parent 3477d35 commit e6ac85f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions statediff/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ func TestBuilder(t *testing.T) {
if err != nil {
t.Error(err)
}
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected)
expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -965,7 +965,7 @@ func TestBuilderWithIntermediateNodes(t *testing.T) {
if err != nil {
t.Error(err)
}
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected)
expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -1155,7 +1155,7 @@ func TestBuilderWithWatchedAddressList(t *testing.T) {
if err != nil {
t.Error(err)
}
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected)
expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -1385,7 +1385,7 @@ func TestBuilderWithRemovedAccountAndStorage(t *testing.T) {
if err != nil {
t.Error(err)
}
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected)
expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -1583,7 +1583,7 @@ func TestBuilderWithRemovedAccountAndStorageWithoutIntermediateNodes(t *testing.
t.Error(err)
}

expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected)
expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -1701,7 +1701,7 @@ func TestBuilderWithRemovedNonWatchedAccount(t *testing.T) {
t.Error(err)
}

expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected)
expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -1871,7 +1871,7 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) {
t.Error(err)
}

expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected)
expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -2103,7 +2103,7 @@ func TestBuilderWithMovedAccount(t *testing.T) {
if err != nil {
t.Error(err)
}
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected)
expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -2239,7 +2239,7 @@ func TestBuilderWithMovedAccountOnlyLeafs(t *testing.T) {
if err != nil {
t.Error(err)
}
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected)
expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -2470,7 +2470,7 @@ func TestBuildStateTrie(t *testing.T) {
if err != nil {
t.Error(err)
}
expectedStateTrieRlp, err := rlp.EncodeToBytes(&test.expected)
expectedStateTrieRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil {
t.Error(err)
}
Expand Down
2 changes: 1 addition & 1 deletion statediff/indexer/ipld/eth_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var _ node.Node = (*EthHeader)(nil)

// NewEthHeader converts a *types.Header into an EthHeader IPLD node
func NewEthHeader(header *types.Header) (*EthHeader, error) {
headerRLP, err := rlp.EncodeToBytes(&header)
headerRLP, err := rlp.EncodeToBytes(header)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions statediff/mainnet_tests/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ func init() {
}
db = rawdb.NewMemoryDatabase()
genesisBlock = core.DefaultGenesisBlock().MustCommit(db)
genBy, err := rlp.EncodeToBytes(&genesisBlock)
genBy, err := rlp.EncodeToBytes(genesisBlock)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -671,7 +671,7 @@ func TestBuilderOnMainnetBlocks(t *testing.T) {
if err != nil {
t.Error(err)
}
receivedStateDiffRlp, err := rlp.EncodeToBytes(&diff)
receivedStateDiffRlp, err := rlp.EncodeToBytes(diff)
if err != nil {
t.Error(err)
}
Expand Down
4 changes: 2 additions & 2 deletions statediff/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func testErrorInStateDiffAt(t *testing.T) {
if err != nil {
t.Error(err)
}
expectedBlockRlp, err := rlp.EncodeToBytes(&testBlock1)
expectedBlockRlp, err := rlp.EncodeToBytes(testBlock1)
if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -269,7 +269,7 @@ func testErrorInStateDiffAt(t *testing.T) {
if err != nil {
t.Error(err)
}
stateDiffPayloadRlp, err := rlp.EncodeToBytes(&stateDiffPayload)
stateDiffPayloadRlp, err := rlp.EncodeToBytes(stateDiffPayload)
if err != nil {
t.Error(err)
}
Expand Down
4 changes: 2 additions & 2 deletions statediff/test_helpers/mocks/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func testSubscriptionAPI(t *testing.T) {
defer chain.Stop()
block0 = test_helpers.Genesis
block1 = blocks[0]
expectedBlockRlp, _ := rlp.EncodeToBytes(&block1)
expectedBlockRlp, _ := rlp.EncodeToBytes(block1)
mockReceipt := &types.Receipt{
BlockNumber: block1.Number(),
BlockHash: block1.Hash(),
Expand Down Expand Up @@ -189,7 +189,7 @@ func testHTTPAPI(t *testing.T) {
defer chain.Stop()
block0 = test_helpers.Genesis
block1 = blocks[0]
expectedBlockRlp, _ := rlp.EncodeToBytes(&block1)
expectedBlockRlp, _ := rlp.EncodeToBytes(block1)
mockReceipt := &types.Receipt{
BlockNumber: block1.Number(),
BlockHash: block1.Hash(),
Expand Down

0 comments on commit e6ac85f

Please sign in to comment.