Skip to content

Commit f81889b

Browse files
Merge pull request #18 from coinbase/patrick/update-sdk-go
[chore] Update `rosetta-sdk-go@v0.6.5`
2 parents bc8122d + 788ed02 commit f81889b

File tree

6 files changed

+23
-31
lines changed

6 files changed

+23
-31
lines changed

configuration/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const (
7373
DefaultGethURL = "http://localhost:8545"
7474

7575
// MiddlewareVersion is the version of rosetta-ethereum.
76-
MiddlewareVersion = "0.0.3"
76+
MiddlewareVersion = "0.0.4"
7777
)
7878

7979
// Configuration determines how

ethereum/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (ec *Client) Status(ctx context.Context) (
114114
targetIndex := int64(progress.HighestBlock)
115115

116116
syncStatus = &RosettaTypes.SyncStatus{
117-
CurrentIndex: currentIndex,
117+
CurrentIndex: &currentIndex,
118118
TargetIndex: &targetIndex,
119119
}
120120
}

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)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/coinbase/rosetta-ethereum
22

33
require (
44
github.com/OneOfOne/xxhash v1.2.5 // indirect
5-
github.com/coinbase/rosetta-sdk-go v0.6.3
5+
github.com/coinbase/rosetta-sdk-go v0.6.5
66
github.com/ethereum/go-ethereum v1.9.24
77
github.com/fatih/color v1.10.0
88
github.com/go-kit/kit v0.9.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+
8787
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
8888
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
8989
github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U=
90-
github.com/coinbase/rosetta-sdk-go v0.6.3 h1:PPj14tPJ7SFc8sY/hlwK8zddT7PKwWU2wicxyerDxlg=
91-
github.com/coinbase/rosetta-sdk-go v0.6.3/go.mod h1:MvQfsL2KlJ5786OdDviRIJE3agui2YcvS1CaQPDl1Yo=
90+
github.com/coinbase/rosetta-sdk-go v0.6.5 h1:RytFDCPXS64vEYwIOsxsoQGlZZyP9RQvzyYikxymI4w=
91+
github.com/coinbase/rosetta-sdk-go v0.6.5/go.mod h1:MvQfsL2KlJ5786OdDviRIJE3agui2YcvS1CaQPDl1Yo=
9292
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
9393
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
9494
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=

services/network_service_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
)
2828

2929
var (
30-
middlewareVersion = "0.0.3"
30+
middlewareVersion = "0.0.4"
3131
defaultNetworkOptions = &types.NetworkOptionsResponse{
3232
Version: &types.Version{
3333
RosettaVersion: types.RosettaAPIVersion,
@@ -100,7 +100,7 @@ func TestNetworkEndpoints_Online(t *testing.T) {
100100
currentTime := int64(1000000000000)
101101

102102
syncStatus := &types.SyncStatus{
103-
CurrentIndex: 100,
103+
CurrentIndex: types.Int64(100),
104104
}
105105

106106
peers := []*types.Peer{

0 commit comments

Comments
 (0)