Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security] Update go and go-ethereum #13

Merged
merged 7 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions ethereum/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -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()),
},
Expand All @@ -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),
},
Expand Down Expand Up @@ -981,7 +981,7 @@ func (ec *Client) blockRewardTransaction(
Index: 0,
},
Type: MinerRewardOpType,
Status: SuccessStatus,
Status: RosettaTypes.String(SuccessStatus),
Account: &RosettaTypes.AccountIdentifier{
Address: MustChecksum(miner),
},
Expand All @@ -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),
},
Expand Down
2 changes: 1 addition & 1 deletion ethereum/geth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
8 changes: 4 additions & 4 deletions ethereum/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -113,15 +113,15 @@ 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 (
// 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{
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 6 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand All @@ -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=
Expand Down
8 changes: 8 additions & 0 deletions services/account_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
12 changes: 11 additions & 1 deletion services/account_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -47,6 +52,7 @@ func TestAccountBalance_Online(t *testing.T) {
}
mockClient := &mocks.Client{}
servicer := NewAccountAPIService(cfg, mockClient)

ctx := context.Background()

account := &types.AccountIdentifier{
Expand Down Expand Up @@ -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)
}
4 changes: 2 additions & 2 deletions services/construction_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion services/network_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (s *NetworkAPIService) NetworkOptions(
Version: &types.Version{
NodeVersion: ethereum.NodeVersion,
RosettaVersion: types.RosettaAPIVersion,
MiddlewareVersion: &ethereum.MiddlewareVersion,
MiddlewareVersion: types.String(configuration.MiddlewareVersion),
},
Allow: &types.Allow{
Errors: Errors,
Expand Down
4 changes: 2 additions & 2 deletions services/network_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down