From 35b24e075f0a09b31731d561bef531a15070610a Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Fri, 13 Nov 2020 10:08:21 -0800 Subject: [PATCH 1/7] Update circleci config --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a08c626..9871683 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ version: 2.1 executors: default: docker: - - image: circleci/golang:1.13 + - image: circleci/golang:1.15 user: root # go directory is owned by root working_directory: /go/src/github.com/coinbase/rosetta-ethereum environment: @@ -50,7 +50,7 @@ jobs: name: default steps: - *fast-checkout - - run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0 + - run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.32.2 - run: make lint check-license: executor: From 58d29e654ad103885b4d3fd53f1d26dc53533444 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Fri, 13 Nov 2020 10:09:11 -0800 Subject: [PATCH 2/7] Update rosetta-sdk-go --- go.mod | 4 ++-- go.sum | 21 ++++++--------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 829e352..edde874 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,8 @@ module github.com/coinbase/rosetta-ethereum require ( github.com/OneOfOne/xxhash v1.2.5 // indirect - github.com/coinbase/rosetta-sdk-go v0.5.9 - github.com/ethereum/go-ethereum v1.9.23 + github.com/coinbase/rosetta-sdk-go v0.6.1 + github.com/ethereum/go-ethereum v1.9.24 github.com/fatih/color v1.10.0 github.com/go-kit/kit v0.9.0 // indirect github.com/spf13/cobra v1.1.1 diff --git a/go.sum b/go.sum index 06331fe..c75106d 100644 --- a/go.sum +++ b/go.sum @@ -83,8 +83,8 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= -github.com/coinbase/rosetta-sdk-go v0.5.9 h1:CuGQE3HFmYwdEACJnuOtVI9cofqPsGvq6FdFIzaOPKI= -github.com/coinbase/rosetta-sdk-go v0.5.9/go.mod h1:xd4wYUhV3LkY78SPH8BUhc88rXfn2jYgN9BfiSjbcvM= +github.com/coinbase/rosetta-sdk-go v0.6.1 h1:aOb5qstlX0uqP9HRC7wCY+YAZDzZbS2C/i3Qy/lR3xM= +github.com/coinbase/rosetta-sdk-go v0.6.1/go.mod h1:t36UuaD4p2DSXaSH9IwMasZDJ7UPxt9cQi6alS5OPTo= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -124,12 +124,10 @@ github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c h1:JHHhtb9XWJrGNMcr github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.9.23 h1:SIKhg/z4Q7AbvqcxuPYvMxf36che/Rq/Pp0IdYEkbtw= -github.com/ethereum/go-ethereum v1.9.23/go.mod h1:JIfVb6esrqALTExdz9hRYvrP0xBDf6wCncIu1hNwHpM= +github.com/ethereum/go-ethereum v1.9.24 h1:6AK+ORt3EMDO+FTjzXy/AQwHMbu52J2nYHIjyQX9azQ= +github.com/ethereum/go-ethereum v1.9.24/go.mod h1:JIfVb6esrqALTExdz9hRYvrP0xBDf6wCncIu1hNwHpM= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc h1:jtW8jbpkO4YirRSyepBOH8E+2HEw6/hKkBvFPwhUN8c= @@ -264,19 +262,12 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -393,6 +384,8 @@ github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D6 github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/tidwall/gjson v1.6.1 h1:LRbvNuNuvAiISWg6gxLEFuCe72UKy5hDqhxW/8183ws= github.com/tidwall/gjson v1.6.1/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0= +github.com/tidwall/gjson v1.6.3 h1:aHoiiem0dr7GHkW001T1SMTJ7X5PvyekH5WX0whWGnI= +github.com/tidwall/gjson v1.6.3/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0= github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU= @@ -496,7 +489,6 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -506,7 +498,6 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From c0898aedfa3b7d6fd18a9894a1b88d0e9e0d2f5f Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Fri, 13 Nov 2020 10:17:53 -0800 Subject: [PATCH 3/7] Fix breaking changes --- cmd/run.go | 1 + ethereum/client.go | 14 +++++++------- ethereum/types.go | 3 +++ services/account_service.go | 8 ++++++++ services/account_service_test.go | 12 +++++++++++- 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/cmd/run.go b/cmd/run.go index 3ac6848..726e94a 100644 --- a/cmd/run.go +++ b/cmd/run.go @@ -69,6 +69,7 @@ func runRunCmd(cmd *cobra.Command, args []string) error { ethereum.HistoricalBalanceSupported, []*types.NetworkIdentifier{cfg.Network}, ethereum.CallMethods, + ethereum.IncludeMempoolCoins, ) if err != nil { return fmt.Errorf("%w: could not initialize server asserter", err) diff --git a/ethereum/client.go b/ethereum/client.go index 938fe47..d6a7150 100644 --- a/ethereum/client.go +++ b/ethereum/client.go @@ -599,7 +599,7 @@ func traceOps(calls []*flatCall, startIndex int) []*RosettaTypes.Operation { // Index: int64(len(ops) + startIndex), }, Type: trace.Type, - Status: opStatus, + Status: RosettaTypes.String(opStatus), Account: &RosettaTypes.AccountIdentifier{ Address: from, }, @@ -660,7 +660,7 @@ func traceOps(calls []*flatCall, startIndex int) []*RosettaTypes.Operation { // }, }, Type: trace.Type, - Status: opStatus, + Status: RosettaTypes.String(opStatus), Account: &RosettaTypes.AccountIdentifier{ Address: to, }, @@ -699,7 +699,7 @@ func traceOps(calls []*flatCall, startIndex int) []*RosettaTypes.Operation { // Index: ops[len(ops)-1].OperationIdentifier.Index + 1, }, Type: DestructOpType, - Status: SuccessStatus, + Status: RosettaTypes.String(SuccessStatus), Account: &RosettaTypes.AccountIdentifier{ Address: acct, }, @@ -762,7 +762,7 @@ func feeOps(tx *loadedTransaction) []*RosettaTypes.Operation { Index: 0, }, Type: FeeOpType, - Status: SuccessStatus, + Status: RosettaTypes.String(SuccessStatus), Account: &RosettaTypes.AccountIdentifier{ Address: MustChecksum(tx.From.String()), }, @@ -782,7 +782,7 @@ func feeOps(tx *loadedTransaction) []*RosettaTypes.Operation { }, }, Type: FeeOpType, - Status: SuccessStatus, + Status: RosettaTypes.String(SuccessStatus), Account: &RosettaTypes.AccountIdentifier{ Address: MustChecksum(tx.Miner), }, @@ -981,7 +981,7 @@ func (ec *Client) blockRewardTransaction( Index: 0, }, Type: MinerRewardOpType, - Status: SuccessStatus, + Status: RosettaTypes.String(SuccessStatus), Account: &RosettaTypes.AccountIdentifier{ Address: MustChecksum(miner), }, @@ -1008,7 +1008,7 @@ func (ec *Client) blockRewardTransaction( Index: int64(len(ops)), }, Type: UncleRewardOpType, - Status: SuccessStatus, + Status: RosettaTypes.String(SuccessStatus), Account: &RosettaTypes.AccountIdentifier{ Address: MustChecksum(uncleMiner), }, diff --git a/ethereum/types.go b/ethereum/types.go index cb56ee9..87c2d95 100644 --- a/ethereum/types.go +++ b/ethereum/types.go @@ -113,6 +113,9 @@ const ( // MainnetGethArguments are the arguments to start a mainnet geth instance. MainnetGethArguments = `--config=/app/ethereum/geth.toml --gcmode=archive --graphql` + + // IncludeMempoolCoins does not apply to rosetta-ethereum as it is not UTXO-based. + IncludeMempoolCoins = false ) var ( diff --git a/services/account_service.go b/services/account_service.go index a02c09f..7c1d202 100644 --- a/services/account_service.go +++ b/services/account_service.go @@ -59,3 +59,11 @@ func (s *AccountAPIService) AccountBalance( return balanceResponse, nil } + +// AccountCoins implements /account/coins. +func (s *AccountAPIService) AccountCoins( + ctx context.Context, + request *types.AccountCoinsRequest, +) (*types.AccountCoinsResponse, *types.Error) { + return nil, wrapErr(ErrUnimplemented, nil) +} diff --git a/services/account_service_test.go b/services/account_service_test.go index f80e844..685bfd3 100644 --- a/services/account_service_test.go +++ b/services/account_service_test.go @@ -38,6 +38,11 @@ func TestAccountBalance_Offline(t *testing.T) { assert.Nil(t, bal) assert.Equal(t, ErrUnavailableOffline.Code, err.Code) + coins, err := servicer.AccountCoins(ctx, nil) + assert.Nil(t, coins) + assert.Equal(t, ErrUnimplemented.Code, err.Code) + assert.Equal(t, ErrUnimplemented.Message, err.Message) + mockClient.AssertExpectations(t) } @@ -47,6 +52,7 @@ func TestAccountBalance_Online(t *testing.T) { } mockClient := &mocks.Client{} servicer := NewAccountAPIService(cfg, mockClient) + ctx := context.Background() account := &types.AccountIdentifier{ @@ -80,8 +86,12 @@ func TestAccountBalance_Online(t *testing.T) { BlockIdentifier: types.ConstructPartialBlockIdentifier(block), }) assert.Nil(t, err) - assert.Equal(t, resp, bal) + coins, err := servicer.AccountCoins(ctx, nil) + assert.Nil(t, coins) + assert.Equal(t, ErrUnimplemented.Code, err.Code) + assert.Equal(t, ErrUnimplemented.Message, err.Message) + mockClient.AssertExpectations(t) } From ed96615cb6a242c2fc7083e6f6eb149f01c26500 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Fri, 13 Nov 2020 10:21:32 -0800 Subject: [PATCH 4/7] Update versions --- configuration/configuration.go | 3 +++ ethereum/types.go | 5 +---- services/network_service.go | 2 +- services/network_service_test.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configuration/configuration.go b/configuration/configuration.go index f22984c..bf3e2fe 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -71,6 +71,9 @@ const ( // a running geth node. This is used // when GethEnv is not populated. DefaultGethURL = "http://localhost:8545" + + // MiddlewareVersion is the version of rosetta-ethereum. + MiddlewareVersion = "0.0.2" ) // Configuration determines how diff --git a/ethereum/types.go b/ethereum/types.go index 87c2d95..d167c0e 100644 --- a/ethereum/types.go +++ b/ethereum/types.go @@ -25,7 +25,7 @@ import ( const ( // NodeVersion is the version of geth we are using. - NodeVersion = "1.9.23" + NodeVersion = "1.9.24" // Blockchain is Ethereum. Blockchain string = "Ethereum" @@ -122,9 +122,6 @@ var ( // TestnetGethArguments are the arguments to start a ropsten geth instance. TestnetGethArguments = fmt.Sprintf("%s --ropsten", MainnetGethArguments) - // MiddlewareVersion is the version of rosetta-ethereum. - MiddlewareVersion = "0.0.1" - // MainnetGenesisBlockIdentifier is the *types.BlockIdentifier // of the mainnet genesis block. MainnetGenesisBlockIdentifier = &types.BlockIdentifier{ diff --git a/services/network_service.go b/services/network_service.go index 6ded797..f0807e5 100644 --- a/services/network_service.go +++ b/services/network_service.go @@ -60,7 +60,7 @@ func (s *NetworkAPIService) NetworkOptions( Version: &types.Version{ NodeVersion: ethereum.NodeVersion, RosettaVersion: types.RosettaAPIVersion, - MiddlewareVersion: ðereum.MiddlewareVersion, + MiddlewareVersion: types.String(configuration.MiddlewareVersion), }, Allow: &types.Allow{ Errors: Errors, diff --git a/services/network_service_test.go b/services/network_service_test.go index 8c8bec4..4a19fc6 100644 --- a/services/network_service_test.go +++ b/services/network_service_test.go @@ -27,11 +27,11 @@ import ( ) var ( - middlewareVersion = "0.0.1" + middlewareVersion = "0.0.2" defaultNetworkOptions = &types.NetworkOptionsResponse{ Version: &types.Version{ RosettaVersion: types.RosettaAPIVersion, - NodeVersion: "1.9.23", + NodeVersion: "1.9.24", MiddlewareVersion: &middlewareVersion, }, Allow: &types.Allow{ From 0bc530e440b19952a38c26e32757c196780c7e9d Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Fri, 13 Nov 2020 10:23:14 -0800 Subject: [PATCH 5/7] linting --- ethereum/geth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum/geth.go b/ethereum/geth.go index e87ca11..7dd33e8 100644 --- a/ethereum/geth.go +++ b/ethereum/geth.go @@ -43,7 +43,7 @@ func logPipe(pipe io.ReadCloser, identifier string) error { return err } - message := strings.Replace(str, "\n", "", -1) + message := strings.ReplaceAll(str, "\n", "") log.Println(identifier, message) } } From 868cd865e9043d9fbd5607b911f8c3b91fa486ad Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Fri, 13 Nov 2020 10:25:56 -0800 Subject: [PATCH 6/7] fix construction tests --- services/construction_service_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/construction_service_test.go b/services/construction_service_test.go index 1e8d08a..e468b5d 100644 --- a/services/construction_service_test.go +++ b/services/construction_service_test.go @@ -86,7 +86,7 @@ func TestConstructionService(t *testing.T) { }, deriveResponse) // Test Preprocess - intent := `[{"operation_identifier":{"index":0},"type":"CALL","status":"","account":{"address":"0xe3a5B4d7f79d64088C8d4ef153A7DDe2B2d47309"},"amount":{"value":"-42894881044106498","currency":{"symbol":"ETH","decimals":18}}},{"operation_identifier":{"index":1},"type":"CALL","status":"","account":{"address":"0x57B414a0332B5CaB885a451c2a28a07d1e9b8a8d"},"amount":{"value":"42894881044106498","currency":{"symbol":"ETH","decimals":18}}}]` // nolint + intent := `[{"operation_identifier":{"index":0},"type":"CALL","account":{"address":"0xe3a5B4d7f79d64088C8d4ef153A7DDe2B2d47309"},"amount":{"value":"-42894881044106498","currency":{"symbol":"ETH","decimals":18}}},{"operation_identifier":{"index":1},"type":"CALL","account":{"address":"0x57B414a0332B5CaB885a451c2a28a07d1e9b8a8d"},"amount":{"value":"42894881044106498","currency":{"symbol":"ETH","decimals":18}}}]` // nolint var ops []*types.Operation assert.NoError(t, json.Unmarshal([]byte(intent), &ops)) preprocessResponse, err := servicer.ConstructionPreprocess( @@ -157,7 +157,7 @@ func TestConstructionService(t *testing.T) { }, payloadsResponse) // Test Parse Unsigned - parseOpsRaw := `[{"operation_identifier":{"index":0},"type":"CALL","status":"","account":{"address":"0xe3a5B4d7f79d64088C8d4ef153A7DDe2B2d47309"},"amount":{"value":"-42894881044106498","currency":{"symbol":"ETH","decimals":18}}},{"operation_identifier":{"index":1},"related_operations":[{"index":0}],"type":"CALL","status":"","account":{"address":"0x57B414a0332B5CaB885a451c2a28a07d1e9b8a8d"},"amount":{"value":"42894881044106498","currency":{"symbol":"ETH","decimals":18}}}]` // nolint + parseOpsRaw := `[{"operation_identifier":{"index":0},"type":"CALL","account":{"address":"0xe3a5B4d7f79d64088C8d4ef153A7DDe2B2d47309"},"amount":{"value":"-42894881044106498","currency":{"symbol":"ETH","decimals":18}}},{"operation_identifier":{"index":1},"related_operations":[{"index":0}],"type":"CALL","account":{"address":"0x57B414a0332B5CaB885a451c2a28a07d1e9b8a8d"},"amount":{"value":"42894881044106498","currency":{"symbol":"ETH","decimals":18}}}]` // nolint var parseOps []*types.Operation assert.NoError(t, json.Unmarshal([]byte(parseOpsRaw), &parseOps)) parseUnsignedResponse, err := servicer.ConstructionParse(ctx, &types.ConstructionParseRequest{ From 00ff4203f39598585df5eccd6ad7c2fdc4c84145 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Fri, 13 Nov 2020 10:29:25 -0800 Subject: [PATCH 7/7] Update go and go-ethereum --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 021c016..654cdb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,8 +20,8 @@ RUN mkdir -p /app \ WORKDIR /app RUN apt-get update && apt-get install -y curl make gcc g++ git -ENV GOLANG_VERSION 1.15.2 -ENV GOLANG_DOWNLOAD_SHA256 b49fda1ca29a1946d6bb2a5a6982cf07ccd2aba849289508ee0f9918f6bb4552 +ENV GOLANG_VERSION 1.15.5 +ENV GOLANG_DOWNLOAD_SHA256 9a58494e8da722c3aef248c9227b0e9c528c7318309827780f16220998180a0d ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ @@ -36,10 +36,10 @@ RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" # Compile geth FROM golang-builder as geth-builder -# VERSION: go-ethereum v.1.9.23 +# VERSION: go-ethereum v.1.9.24 RUN git clone https://github.com/ethereum/go-ethereum \ && cd go-ethereum \ - && git checkout 8c2f271528f9cccf541c6ea1c022e98407f26872 + && git checkout cc05b050df5f88e80bb26aaf6d2f339c49c2d702 RUN cd go-ethereum \ && make geth