Remove redundant deferences for pointers

This commit is contained in:
Abdul Rabbani 2022-04-06 13:51:03 -04:00
parent 3477d35af4
commit e6ac85fefc
5 changed files with 17 additions and 17 deletions

View File

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

View File

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

View File

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

View File

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

View File

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