Skip to content

Commit 788ed02

Browse files
cleanup tests
1 parent 685d967 commit 788ed02

File tree

1 file changed

+16
-24
lines changed

1 file changed

+16
-24
lines changed

ethereum/client_test.go

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ import (
3939
"golang.org/x/sync/semaphore"
4040
)
4141

42-
func int64Pointer(i int64) *int64 {
43-
return &i
44-
}
45-
46-
func stringPointer(s string) *string {
47-
return &s
48-
}
49-
5042
func TestStatus_NotReady(t *testing.T) {
5143
mockJSONRPC := &mocks.JSONRPC{}
5244
mockGraphQL := &mocks.GraphQL{}
@@ -274,8 +266,8 @@ func TestStatus_Syncing(t *testing.T) {
274266
}, block)
275267
assert.Equal(t, int64(1603225195000), timestamp)
276268
assert.Equal(t, &RosettaTypes.SyncStatus{
277-
CurrentIndex: 25,
278-
TargetIndex: int64Pointer(8916760),
269+
CurrentIndex: RosettaTypes.Int64(25),
270+
TargetIndex: RosettaTypes.Int64(8916760),
279271
}, syncStatus)
280272
assert.Equal(t, []*RosettaTypes.Peer{
281273
{
@@ -428,10 +420,10 @@ func TestBalance_Historical_Hash(t *testing.T) {
428420
Address: "0x2f93B2f047E05cdf602820Ac4B3178efc2b43D55",
429421
},
430422
&RosettaTypes.PartialBlockIdentifier{
431-
Hash: stringPointer(
423+
Hash: RosettaTypes.String(
432424
"0x9999286598edf07606228ba0233736e544a086a8822c61f9db3706887fc25dda",
433425
),
434-
Index: int64Pointer(8165),
426+
Index: RosettaTypes.Int64(8165),
435427
},
436428
)
437429
assert.Equal(t, &RosettaTypes.AccountBalanceResponse{
@@ -496,7 +488,7 @@ func TestBalance_Historical_Index(t *testing.T) {
496488
Address: "0x2f93B2f047E05cdf602820Ac4B3178efc2b43D55",
497489
},
498490
&RosettaTypes.PartialBlockIdentifier{
499-
Index: int64Pointer(8165),
491+
Index: RosettaTypes.Int64(8165),
500492
},
501493
)
502494
assert.Equal(t, &RosettaTypes.AccountBalanceResponse{
@@ -605,7 +597,7 @@ func TestBalance_InvalidHash(t *testing.T) {
605597
Address: "0x2f93B2f047E05cdf602820Ac4B3178efc2b43D55",
606598
},
607599
&RosettaTypes.PartialBlockIdentifier{
608-
Hash: stringPointer(
600+
Hash: RosettaTypes.String(
609601
"0x7d2a2713026a0e66f131878de2bb2df2fff6c24562c1df61ec0265e5fedf2626",
610602
),
611603
},
@@ -879,7 +871,7 @@ func TestBlock_Hash(t *testing.T) {
879871
resp, err := c.Block(
880872
ctx,
881873
&RosettaTypes.PartialBlockIdentifier{
882-
Hash: stringPointer(
874+
Hash: RosettaTypes.String(
883875
"0xba9ded5ca1ec9adb9451bf062c9de309d9552fa0f0254a7b982d3daf7ae436ae",
884876
),
885877
},
@@ -955,7 +947,7 @@ func TestBlock_Index(t *testing.T) {
955947
resp, err := c.Block(
956948
ctx,
957949
&RosettaTypes.PartialBlockIdentifier{
958-
Index: int64Pointer(10992),
950+
Index: RosettaTypes.Int64(10992),
959951
},
960952
)
961953
assert.Equal(t, correct.Block, resp)
@@ -1071,7 +1063,7 @@ func TestBlock_10994(t *testing.T) {
10711063
resp, err := c.Block(
10721064
ctx,
10731065
&RosettaTypes.PartialBlockIdentifier{
1074-
Index: int64Pointer(10994),
1066+
Index: RosettaTypes.Int64(10994),
10751067
},
10761068
)
10771069
assert.NoError(t, err)
@@ -1180,7 +1172,7 @@ func TestBlock_10991(t *testing.T) {
11801172
resp, err := c.Block(
11811173
ctx,
11821174
&RosettaTypes.PartialBlockIdentifier{
1183-
Index: int64Pointer(10991),
1175+
Index: RosettaTypes.Int64(10991),
11841176
},
11851177
)
11861178
assert.Equal(t, correct.Block, resp)
@@ -1282,7 +1274,7 @@ func TestBlock_239782(t *testing.T) {
12821274
resp, err := c.Block(
12831275
ctx,
12841276
&RosettaTypes.PartialBlockIdentifier{
1285-
Index: int64Pointer(239782),
1277+
Index: RosettaTypes.Int64(239782),
12861278
},
12871279
)
12881280
assert.NoError(t, err)
@@ -1394,7 +1386,7 @@ func TestBlock_363415(t *testing.T) {
13941386
resp, err := c.Block(
13951387
ctx,
13961388
&RosettaTypes.PartialBlockIdentifier{
1397-
Index: int64Pointer(363415),
1389+
Index: RosettaTypes.Int64(363415),
13981390
},
13991391
)
14001392
assert.NoError(t, err)
@@ -1506,7 +1498,7 @@ func TestBlock_363753(t *testing.T) {
15061498
resp, err := c.Block(
15071499
ctx,
15081500
&RosettaTypes.PartialBlockIdentifier{
1509-
Index: int64Pointer(363753),
1501+
Index: RosettaTypes.Int64(363753),
15101502
},
15111503
)
15121504
assert.NoError(t, err)
@@ -1618,7 +1610,7 @@ func TestBlock_468179(t *testing.T) {
16181610
resp, err := c.Block(
16191611
ctx,
16201612
&RosettaTypes.PartialBlockIdentifier{
1621-
Index: int64Pointer(468179),
1613+
Index: RosettaTypes.Int64(468179),
16221614
},
16231615
)
16241616
assert.NoError(t, err)
@@ -1731,7 +1723,7 @@ func TestBlock_363366(t *testing.T) {
17311723
resp, err := c.Block(
17321724
ctx,
17331725
&RosettaTypes.PartialBlockIdentifier{
1734-
Index: int64Pointer(363366),
1726+
Index: RosettaTypes.Int64(363366),
17351727
},
17361728
)
17371729
assert.NoError(t, err)
@@ -1843,7 +1835,7 @@ func TestBlock_468194(t *testing.T) {
18431835
resp, err := c.Block(
18441836
ctx,
18451837
&RosettaTypes.PartialBlockIdentifier{
1846-
Index: int64Pointer(468194),
1838+
Index: RosettaTypes.Int64(468194),
18471839
},
18481840
)
18491841
assert.NoError(t, err)

0 commit comments

Comments
 (0)