Remove redundant deferences for pointers

This commit is contained in:
Abdul Rabbani 2022-04-06 13:51:03 -04:00
parent c55f7d3098
commit 04f08a0ae0
5 changed files with 16 additions and 16 deletions

View File

@ -702,7 +702,7 @@ func TestBuilder(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected) expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -965,7 +965,7 @@ func TestBuilderWithIntermediateNodes(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected) expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -1155,7 +1155,7 @@ func TestBuilderWithWatchedAddressList(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected) expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -1385,7 +1385,7 @@ func TestBuilderWithRemovedAccountAndStorage(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected) expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -1989,7 +1989,7 @@ func TestBuilderWithRemovedNonWatchedAccount(t *testing.T) {
t.Error(err) t.Error(err)
} }
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected) expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -2159,7 +2159,7 @@ func TestBuilderWithRemovedWatchedAccount(t *testing.T) {
t.Error(err) t.Error(err)
} }
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected) expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -2391,7 +2391,7 @@ func TestBuilderWithMovedAccount(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected) expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -2527,7 +2527,7 @@ func TestBuilderWithMovedAccountOnlyLeafs(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
expectedStateDiffRlp, err := rlp.EncodeToBytes(&test.expected) expectedStateDiffRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -2758,7 +2758,7 @@ func TestBuildStateTrie(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
expectedStateTrieRlp, err := rlp.EncodeToBytes(&test.expected) expectedStateTrieRlp, err := rlp.EncodeToBytes(test.expected)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }

View File

@ -46,7 +46,7 @@ var _ node.Node = (*EthHeader)(nil)
// NewEthHeader converts a *types.Header into an EthHeader IPLD node // NewEthHeader converts a *types.Header into an EthHeader IPLD node
func NewEthHeader(header *types.Header) (*EthHeader, error) { func NewEthHeader(header *types.Header) (*EthHeader, error) {
headerRLP, err := rlp.EncodeToBytes(&header) headerRLP, err := rlp.EncodeToBytes(header)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -420,7 +420,7 @@ func init() {
} }
db = rawdb.NewMemoryDatabase() db = rawdb.NewMemoryDatabase()
genesisBlock = core.DefaultGenesisBlock().MustCommit(db) genesisBlock = core.DefaultGenesisBlock().MustCommit(db)
genBy, err := rlp.EncodeToBytes(&genesisBlock) genBy, err := rlp.EncodeToBytes(genesisBlock)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@ -671,7 +671,7 @@ func TestBuilderOnMainnetBlocks(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
receivedStateDiffRlp, err := rlp.EncodeToBytes(&diff) receivedStateDiffRlp, err := rlp.EncodeToBytes(diff)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }

View File

@ -235,7 +235,7 @@ func testErrorInStateDiffAt(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
expectedBlockRlp, err := rlp.EncodeToBytes(&testBlock1) expectedBlockRlp, err := rlp.EncodeToBytes(testBlock1)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
@ -269,7 +269,7 @@ func testErrorInStateDiffAt(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
stateDiffPayloadRlp, err := rlp.EncodeToBytes(&stateDiffPayload) stateDiffPayloadRlp, err := rlp.EncodeToBytes(stateDiffPayload)
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }

View File

@ -97,7 +97,7 @@ func testSubscriptionAPI(t *testing.T) {
defer chain.Stop() defer chain.Stop()
block0 = test_helpers.Genesis block0 = test_helpers.Genesis
block1 = blocks[0] block1 = blocks[0]
expectedBlockRlp, _ := rlp.EncodeToBytes(&block1) expectedBlockRlp, _ := rlp.EncodeToBytes(block1)
mockReceipt := &types.Receipt{ mockReceipt := &types.Receipt{
BlockNumber: block1.Number(), BlockNumber: block1.Number(),
BlockHash: block1.Hash(), BlockHash: block1.Hash(),
@ -189,7 +189,7 @@ func testHTTPAPI(t *testing.T) {
defer chain.Stop() defer chain.Stop()
block0 = test_helpers.Genesis block0 = test_helpers.Genesis
block1 = blocks[0] block1 = blocks[0]
expectedBlockRlp, _ := rlp.EncodeToBytes(&block1) expectedBlockRlp, _ := rlp.EncodeToBytes(block1)
mockReceipt := &types.Receipt{ mockReceipt := &types.Receipt{
BlockNumber: block1.Number(), BlockNumber: block1.Number(),
BlockHash: block1.Hash(), BlockHash: block1.Hash(),