Skip to content

Commit

Permalink
add parser for v1.4.0 cronos new evm tx format
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentysc committed Nov 22, 2024
1 parent 3abe05d commit 387277c
Show file tree
Hide file tree
Showing 20 changed files with 2,634 additions and 24 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,13 @@ config := bootstrap.Config{
Color: false,
},
CosmosVersionEnabledHeight: bootstrap.CosmosVersionEnabledHeightConfig{
// BLock height from cosmos sdk version v0.42.7
// Block height from cosmos sdk version v0.42.7
V0_42_7: 0,
},
CronosVersionEnabledHeight: bootstrap.CronosVersionEnabledHeightConfig{
// Block height from cronos version v1.4.0-rc3
V1_4_0: 0,
},
GithubAPI: bootstrap.GithubAPIConfig{
// Username of your git hub api account
Username: "username",
Expand Down
7 changes: 6 additions & 1 deletion bootstrap/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type IndexService struct {
Projection Projection `yaml:"projection" toml:"projection" xml:"projection" json:"projection"`
CronJob CronJob `yaml:"cron_job" toml:"cron_job" xml:"cron_job" json:"cron_job"`
CosmosVersionEnabledHeight CosmosVersionEnabledHeight `yaml:"cosmos_version_enabled_height" toml:"cosmos_version_enabled_height" xml:"cosmos_version_enabled_height" json:"cosmos_version_enabled_height"`
CronosVersionEnabledHeight CronosVersionEnabledHeight `yaml:"cronos_version_enabled_height" toml:"cronos_version_enabled_height" xml:"cronos_version_enabled_height" json:"cronos_version_enabled_height"`
GithubAPI GithubAPI `yaml:"github_api" toml:"github_api" xml:"github_api" json:"github_api"`
BlockResultEventAttributeDecodeMethod string `yaml:"block_result_event_attribute_decode_method" toml:"block_result_event_attribute_decode_method" xml:"block_result_event_attribute_decode_method" json:"block_result_event_attribute_decode_method"`
}
Expand Down Expand Up @@ -93,7 +94,11 @@ type CronJob struct {
}

type CosmosVersionEnabledHeight struct {
V0_42_7 uint64 `yaml:"v_0_42_7" toml:"v_0_42_7" xml:"v_0_42_7" json:"v_0_42_7,omitempty"`
V0_42_7 uint64 `yaml:"v0_42_7" toml:"v0_42_7" xml:"v0_42_7" json:"v0_42_7,omitempty"`
}

type CronosVersionEnabledHeight struct {
V1_4_0 uint64 `yaml:"v1_4_0" toml:"V1_4_0" xml:"V1_4_0" json:"V1_4_0,omitempty"`
}

type GithubAPI struct {
Expand Down
6 changes: 6 additions & 0 deletions bootstrap/indexservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type IndexService struct {
BlockResultEventAttributeDecodeMethod string

cosmosVersionBlockHeight utils.CosmosVersionBlockHeight
cronosVersionBlockHeight utils.CronosVersionBlockHeight

GithubAPIUser string
GithubAPIToken string
Expand Down Expand Up @@ -76,6 +77,9 @@ func NewIndexService(
cosmosVersionBlockHeight: utils.CosmosVersionBlockHeight{
V0_42_7: utils.ParserBlockHeight(config.IndexService.CosmosVersionEnabledHeight.V0_42_7),
},
cronosVersionBlockHeight: utils.CronosVersionBlockHeight{
V1_4_0: utils.ParserBlockHeight(config.IndexService.CronosVersionEnabledHeight.V1_4_0),
},
GithubAPIUser: config.IndexService.GithubAPI.Username,
GithubAPIToken: config.IndexService.GithubAPI.Token,

Expand Down Expand Up @@ -169,6 +173,7 @@ func (service *IndexService) RunEventStoreMode() error {
Logger: service.logger,
Config: utils.CosmosParserManagerConfig{
CosmosVersionBlockHeight: service.cosmosVersionBlockHeight,
CronosVersionBlockHeight: service.cronosVersionBlockHeight,
},
},
),
Expand Down Expand Up @@ -212,6 +217,7 @@ func (service *IndexService) RunTendermintDirectMode() error {
}),
Config: utils.CosmosParserManagerConfig{
CosmosVersionBlockHeight: service.cosmosVersionBlockHeight,
CronosVersionBlockHeight: service.cronosVersionBlockHeight,
},
},
),
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
github.com/cenkalti/backoff/v4 v4.1.2
github.com/cosmos/cosmos-sdk v0.46.2
github.com/ethereum/go-ethereum v1.10.19
github.com/ettle/strcase v0.1.1
github.com/fasthttp/router v1.3.3
github.com/golang-migrate/migrate/v4 v4.15.1
Expand All @@ -32,13 +33,6 @@ require (
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/google/gofuzz v1.2.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)

require (
cosmossdk.io/errors v1.0.0-beta.7 // indirect
cosmossdk.io/math v1.0.0-beta.3 // indirect
Expand All @@ -47,6 +41,7 @@ require (
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.22.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/confio/ics23/go v0.7.0 // indirect
Expand All @@ -55,6 +50,7 @@ require (
github.com/cosmos/go-bip39 v1.0.0 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.1.0 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
Expand All @@ -69,6 +65,7 @@ require (
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/go-github/v39 v39.2.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand All @@ -85,11 +82,13 @@ require (
github.com/jackc/puddle v1.3.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand Down Expand Up @@ -129,6 +128,7 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20240513163218-0867130af1f8 // indirect
google.golang.org/grpc v1.64.1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
27 changes: 27 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8=
github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o=
github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw=
github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
Expand Down Expand Up @@ -98,6 +102,8 @@ github.com/brianvoe/gofakeit/v5 v5.10.1/go.mod h1:/ZENnKqX+XrN8SORLe/fu5lZDIo1tu
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c=
github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y=
github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k=
github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
Expand Down Expand Up @@ -164,6 +170,10 @@ github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o=
github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk=
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
Expand Down Expand Up @@ -192,6 +202,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum/go-ethereum v1.10.19 h1:EOR5JbL4MD5yeOqv8W2iC1s4NximrTjqFccUz8lyBRA=
github.com/ethereum/go-ethereum v1.10.19/go.mod h1:IJBNMtzKcNHPtllYihy6BL2IgK1u+32JriaTbdt4v+w=
github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw=
github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY=
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0=
Expand Down Expand Up @@ -232,6 +244,9 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E=
github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0=
Expand Down Expand Up @@ -496,6 +511,8 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
Expand Down Expand Up @@ -528,6 +545,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
Expand Down Expand Up @@ -583,6 +602,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ=
github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
Expand All @@ -603,6 +624,8 @@ github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F7
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/savsgio/gotils v0.0.0-20200909101946-939aa3fc74fb h1:XPJCVf85HPE2jMVEQ7QWrazaZo1lc94GbUWaQ8Yv5sM=
github.com/savsgio/gotils v0.0.0-20200909101946-939aa3fc74fb/go.mod h1:TWNAOTaVzGOXq8RbEvHnhzA/A2sLZzgn0m6URjnukY8=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU=
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
Expand Down Expand Up @@ -659,6 +682,10 @@ github.com/tendermint/tendermint v0.34.21 h1:UiGGnBFHVrZhoQVQ7EfwSOLuCtarqCSsRf8
github.com/tendermint/tendermint v0.34.21/go.mod h1:XDvfg6U7grcFTDx7VkzxnhazQ/bspGJAn4DZ6DcLLjQ=
github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8=
github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I=
github.com/tklauser/go-sysconf v0.3.5 h1:uu3Xl4nkLzQfXNsWn15rPc/HQCJKObbt1dKJeWp3vU4=
github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI=
github.com/tklauser/numcpus v0.2.2 h1:oyhllyrScuYI6g+h/zUvNXNp1wy7x8qQy3t/piefldA=
github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ=
github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/tendermint/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ func parseBlockResultsEvents(rawEvents []RawBlockResultsEvent, eventAttributeDec
for _, rawAttribute := range rawEvent.Attributes {
key, err := eventAttributeDecoder.DecodeKey(rawAttribute.Key)
if err != nil {
panic(fmt.Sprintf("error blcok result event %s attribute key (%s): %v", rawEvent.Type, rawAttribute.Key, err))
panic(fmt.Sprintf("error block result event %s attribute key (%s): %v", rawEvent.Type, rawAttribute.Key, err))
}
value, err := eventAttributeDecoder.DecodeValue(rawAttribute.Value)
if err != nil {
panic(fmt.Sprintf("error blcok result event %s attribute key (%s): %v", rawEvent.Type, rawAttribute.Key, err))
panic(fmt.Sprintf("error block result event %s attribute key (%s): %v", rawEvent.Type, rawAttribute.Key, err))
}
attributes = append(attributes, model.BlockResultsEventAttribute{
Key: key,
Expand Down
8 changes: 4 additions & 4 deletions projection/ibc_channel/view/ibc_channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ func (ibcChannelsView *IBCChannelsView) Increment(channelID string, column strin

result, err := ibcChannelsView.rdb.Exec(sql, sqlArgs...)
if err != nil {
return fmt.Errorf("error incresing column: %v: %w", err, rdb.ErrWrite)
return fmt.Errorf("error increasing column: %v: %w", err, rdb.ErrWrite)
}
if result.RowsAffected() != 1 {
return fmt.Errorf("error incresing column: no row updated: %w", rdb.ErrWrite)
return fmt.Errorf("error increasing column: no row updated: %w", rdb.ErrWrite)
}

return nil
Expand All @@ -193,10 +193,10 @@ func (ibcChannelsView *IBCChannelsView) UpdateSequence(channelID string, column

result, err := ibcChannelsView.rdb.Exec(sql, sqlArgs...)
if err != nil {
return fmt.Errorf("error incresing column: %v: %w", err, rdb.ErrWrite)
return fmt.Errorf("error increasing column: %v: %w", err, rdb.ErrWrite)
}
if result.RowsAffected() != 1 {
return fmt.Errorf("error incresing column: no row updated: %w", rdb.ErrWrite)
return fmt.Errorf("error increasing column: no row updated: %w", rdb.ErrWrite)
}

return nil
Expand Down
28 changes: 24 additions & 4 deletions usecase/model/msg_ethereum_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ type RawMsgEthereumTx struct {
Type string `mapstructure:"@type" json:"@type"`
Size int `mapstructure:"size" json:"size"`
// FIXME: https://github.com/crypto-com/chain-indexing/issues/730
Data LegacyTx `mapstructure:"data" json:"data"`
From string `mapstructure:"from" json:"from"`
Hash string `mapstructure:"hash" json:"hash"`
Raw *string `mapstructure:"raw" json:"raw"`
Data LegacyTx `mapstructure:"data" json:"data"`
From string `mapstructure:"from" json:"from"`
Hash string `mapstructure:"hash" json:"hash"`
Raw string `mapstructure:"raw" json:"raw"`
DecodedRaw *DecodedRaw `mapstructure:"decodedRaw,omitempty" json:"decodedRaw,omitempty"`
}

type MsgEthereumTx struct {
Expand All @@ -32,3 +33,22 @@ type LegacyTx struct {
R string `mapstructure:"r" json:"r"`
S string `mapstructure:"s" json:"s"`
}

type DecodedRaw struct {
Type string `mapstructure:"type" json:"type"`
Hash string `mapstructure:"hash" json:"hash"`
Nonce string `mapstructure:"nonce" json:"nonce"`
GasLimit string `mapstructure:"gasLimit" json:"gasLimit"`
GasPrice string `mapstructure:"gasPrice" json:"gasPrice"`
MaxFeePerGas string `mapstructure:"maxFeePerGas" json:"maxFeePerGas"`
MaxPriorityFeePerGas string `mapstructure:"maxPriorityFeePerGas" json:"maxPriorityFeePerGas"`
From string `mapstructure:"from" json:"from"`
To string `mapstructure:"to" json:"to"`
PublicKey string `mapstructure:"publicKey" json:"publicKey"`
V string `mapstructure:"v" json:"v"`
R string `mapstructure:"r" json:"r"`
S string `mapstructure:"s" json:"s"`
Value string `mapstructure:"value" json:"value"`
Input string `mapstructure:"input" json:"input"`
FunctionHash string `mapstructure:"functionHash" json:"functionHash"`
}
Loading

0 comments on commit 387277c

Please sign in to comment.