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

Bump up go and go-ethereum version #101

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:

env:
go_version: 1.16
go_version: 1.19
GO111MODULE: on
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}

Expand Down
5 changes: 2 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
sdkTypes "github.com/coinbase/rosetta-geth-sdk/types"

"github.com/coinbase/rosetta-sdk-go/utils"
"github.com/ethereum/go-ethereum/core/types"

RosettaTypes "github.com/coinbase/rosetta-sdk-go/types"

"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -812,12 +812,11 @@ func (ec *SDKClient) GetLoadedTransaction(
}

signer := EthTypes.LatestSignerForChainID(ec.P.ChainID)
msg, err := tx.AsMessage(signer, header.BaseFee)
from, err := types.Sender(signer, tx)
if err != nil {
return nil, err
}
blockNumber := header.Number.String()
from := msg.From()
txHash := tx.Hash()

txInfo := TxExtraInfo{
Expand Down
14 changes: 7 additions & 7 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strconv"
"testing"

Expand Down Expand Up @@ -54,7 +54,7 @@ func TestOpenEthTraceAPI_EmptyTrace(t *testing.T) {
func(args mock.Arguments) {
r := args.Get(1).(*json.RawMessage)

file, err := ioutil.ReadFile(
file, err := os.ReadFile(
"testdata/trace_block_empty.json",
)
assert.NoError(t, err)
Expand Down Expand Up @@ -95,7 +95,7 @@ func TestTraceBlockByHash(t *testing.T) {
func(args mock.Arguments) {
r := args.Get(1).(*json.RawMessage)

file, err := ioutil.ReadFile(
file, err := os.ReadFile(
"testdata/block_trace_0xd88e8376ec3eef899d9fbc6349e8330ebfc102b245fef784a999ac854091cb64.json",
)
assert.NoError(t, err)
Expand Down Expand Up @@ -154,7 +154,7 @@ func TestOpenEthTraceAPI_1Txn(t *testing.T) {
func(args mock.Arguments) {
r := args.Get(1).(*json.RawMessage)

file, err := ioutil.ReadFile(
file, err := os.ReadFile(
"testdata/trace_block_1_tx.json",
)
assert.NoError(t, err)
Expand Down Expand Up @@ -206,7 +206,7 @@ func TestOpenEthTraceAPI_MultiTxns(t *testing.T) {
func(args mock.Arguments) {
r := args.Get(1).(*json.RawMessage)

file, err := ioutil.ReadFile(
file, err := os.ReadFile(
"testdata/trace_block_many_traces.json",
)
assert.NoError(t, err)
Expand Down Expand Up @@ -257,7 +257,7 @@ func TestBalance(t *testing.T) {
func(args mock.Arguments) {
r := args.Get(1).(**types.Header)

file, err := ioutil.ReadFile("testdata/block_10992.json")
file, err := os.ReadFile("testdata/block_10992.json")
assert.NoError(t, err)
err = json.Unmarshal(file, &r)
assert.NoError(t, err)
Expand Down Expand Up @@ -308,7 +308,7 @@ func TestBalance(t *testing.T) {
func(args mock.Arguments) {
r := args.Get(1).(*string)
var expected map[string]interface{}
file, err := ioutil.ReadFile("testdata/call_balance_token_10992.json")
file, err := os.ReadFile("testdata/call_balance_token_10992.json")
assert.NoError(t, err)

err = json.Unmarshal(file, &expected)
Expand Down
2 changes: 2 additions & 0 deletions client/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ func NewRPCClient(endpoint string) (*RPCClient, error) {
defaultTransport.MaxIdleConns = DefaultMaxConnections
defaultTransport.MaxIdleConnsPerHost = DefaultMaxConnections

// TODO: temporarily disable the deprecate warning, need to fix later.
// nolint:staticcheck
client, err := rpc.DialHTTPWithClient(endpoint, &http.Client{
Timeout: gethHTTPTimeout,
Transport: defaultTransport,
Expand Down
4 changes: 2 additions & 2 deletions client/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package client
import (
"encoding/json"
"fmt"
"io/ioutil"
"math/big"
"os"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
Expand Down Expand Up @@ -47,7 +47,7 @@ func GetTraceConfig(useNative bool) (*tracers.TraceConfig, error) {
}

func loadTraceConfig() (*tracers.TraceConfig, error) {
loadedFile, err := ioutil.ReadFile(tracerPath)
loadedFile, err := os.ReadFile(tracerPath)
if err != nil {
return nil, fmt.Errorf("could not load tracer file: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions client/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ package client

import (
"encoding/json"
"log"
"math/big"
"strings"
"log"

"github.com/coinbase/rosetta-geth-sdk/configuration"

Expand Down Expand Up @@ -181,7 +181,7 @@ func GenerateErc20TransferData(toAddress string, value *big.Int) []byte {
}

func (tx *LoadedTransaction) GetMint() *big.Int {
if tx.Mint == "" {
if tx.Mint == "" {
return big.NewInt(0)
}
hexString := tx.Mint[2:]
Expand Down
15 changes: 0 additions & 15 deletions examples/ethereum/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ var (
Index: GenesisBlockIndex,
}

// RopstenGenesisBlockIdentifier is the *types.BlockIdentifier
// of the Ropsten genesis block.
RopstenGenesisBlockIdentifier = &types.BlockIdentifier{
Hash: params.RopstenGenesisHash.Hex(),
Index: GenesisBlockIndex,
}

// RinkebyGenesisBlockIdentifier is the *types.BlockIdentifier
// of the Ropsten genesis block.
RinkebyGenesisBlockIdentifier = &types.BlockIdentifier{
Expand Down Expand Up @@ -197,14 +190,6 @@ func LoadConfiguration() (*configuration.Configuration, error) {
config.GenesisBlockIdentifier = MainnetGenesisBlockIdentifier
config.ChainConfig = params.MainnetChainConfig
config.GethArguments = MainnetGethArguments
case Testnet, Ropsten, "":
config.Network = &types.NetworkIdentifier{
Blockchain: Blockchain,
Network: RopstenNetwork,
}
config.GenesisBlockIdentifier = RopstenGenesisBlockIdentifier
config.ChainConfig = params.RopstenChainConfig
config.GethArguments = RopstenGethArguments
case Rinkeby:
config.Network = &types.NetworkIdentifier{
Blockchain: Blockchain,
Expand Down
4 changes: 2 additions & 2 deletions examples/ethereum/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.16.8
ENV GOLANG_DOWNLOAD_SHA256 f32501aeb8b7b723bc7215f6c373abb6981bbc7e1c7b44e9f07317e1a300dce2
ENV GOLANG_VERSION 1.19
ENV GOLANG_DOWNLOAD_SHA256 464b6b66591f6cf055bc5df90a9750bf5fbc9d038722bb84a9d56a2bea974be6
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 Down
72 changes: 68 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,76 @@
module github.com/coinbase/rosetta-geth-sdk

go 1.16
go 1.19

require (
github.com/coinbase/rosetta-sdk-go v0.8.2
github.com/ethereum/go-ethereum v1.10.26
github.com/ethereum/go-ethereum v1.12.0
github.com/neilotoole/errgroup v0.1.6
github.com/stretchr/testify v1.8.1
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f
golang.org/x/crypto v0.1.0
golang.org/x/sync v0.1.0
)

require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/segmentio/fasthash v1.0.3 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/text v0.8.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading