diff --git a/go.md b/go.md index 35bbdd8d9d..ca91d5f600 100644 --- a/go.md +++ b/go.md @@ -16,6 +16,8 @@ flowchart LR chainlink-common --> libocr click chainlink-common href "https://github.com/smartcontractkit/chainlink-common" chainlink-common/keystore --> chainlink-common + chainlink-common/keystore --> smdkg + chainlink-common/keystore --> wsrpc click chainlink-common/keystore href "https://github.com/smartcontractkit/chainlink-common" chainlink-common/pkg/chipingress click chainlink-common/pkg/chipingress href "https://github.com/smartcontractkit/chainlink-common" @@ -61,10 +63,16 @@ flowchart LR click chainlink-tron/relayer href "https://github.com/smartcontractkit/chainlink-tron" freeport click freeport href "https://github.com/smartcontractkit/freeport" + go-sumtype2 + click go-sumtype2 href "https://github.com/smartcontractkit/go-sumtype2" grpc-proxy click grpc-proxy href "https://github.com/smartcontractkit/grpc-proxy" - libocr + libocr --> go-sumtype2 click libocr href "https://github.com/smartcontractkit/libocr" + smdkg + click smdkg href "https://github.com/smartcontractkit/smdkg" + wsrpc + click wsrpc href "https://github.com/smartcontractkit/wsrpc" subgraph chainlink-common-repo[chainlink-common] chainlink-common diff --git a/go.mod b/go.mod index 00040188b8..0013b1cc6e 100644 --- a/go.mod +++ b/go.mod @@ -21,23 +21,23 @@ require ( github.com/pelletier/go-toml v1.9.5 github.com/pelletier/go-toml/v2 v2.2.4 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.22.0 + github.com/prometheus/client_golang v1.23.0 github.com/prometheus/client_model v0.6.2 github.com/prometheus/common v0.65.0 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.89 - github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 - github.com/smartcontractkit/chainlink-common/keystore v0.1.1-0.20260115164422-897ee18790cd + github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 + github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251022073203-7d8ae8cf67c1 github.com/smartcontractkit/chainlink-framework/capabilities v0.0.0-20250818175541-3389ac08a563 github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20251210101658-1c5c8e4c4f15 github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251020150604-8ab84f7bad1a github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942 - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f github.com/smartcontractkit/chainlink-protos/svr v1.1.1-0.20260203131522-bb8bc5c423b3 github.com/smartcontractkit/chainlink-tron/relayer v0.0.11-0.20250815105909-75499abc4335 github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e - github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d + github.com/smartcontractkit/libocr v0.0.0-20251027221354-bdc84e1ed858 github.com/stretchr/testify v1.11.1 github.com/theodesp/go-heaps v0.0.0-20190520121037-88e35354fe0a github.com/tidwall/gjson v1.18.0 @@ -64,6 +64,7 @@ require ( github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.20.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/buger/jsonparser v1.1.1 // indirect github.com/cenkalti/backoff/v5 v5.0.2 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -105,9 +106,9 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v1.0.0 // indirect + github.com/google/btree v1.1.3 // indirect github.com/google/flatbuffers v25.2.10+incompatible // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/graph-gophers/graphql-go v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect @@ -178,6 +179,8 @@ require ( github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect + go.dedis.ch/fixbuf v1.0.3 // indirect + go.dedis.ch/kyber/v3 v3.1.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect diff --git a/go.sum b/go.sum index 816fd68947..6cae3f8d3d 100644 --- a/go.sum +++ b/go.sum @@ -74,6 +74,8 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU= github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/bufbuild/protocompile v0.14.1 h1:iA73zAf/fyljNjQKwYzUHD6AD4R8KMasmwa/FBatYVw= github.com/bufbuild/protocompile v0.14.1/go.mod h1:ppVdAIhbr2H8asPk6k4pY7t9zB1OU5DoEw9xY/FUi1c= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= @@ -188,7 +190,6 @@ github.com/go-json-experiment/json v0.0.0-20250223041408-d3c622f1b874/go.mod h1: github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -261,6 +262,8 @@ github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs= github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q= github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -275,7 +278,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -540,7 +542,6 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= @@ -575,8 +576,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= -github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= +github.com/prometheus/client_golang v1.23.0 h1:ust4zpdl9r4trLY/gSjlm07PuiBq2ynaXXlptpfy8Uc= +github.com/prometheus/client_golang v1.23.0/go.mod h1:i/o0R9ByOnHX0McrTMTyhYvKE4haaf2mW08I+jGAjEE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE= @@ -624,10 +625,10 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartcontractkit/chain-selectors v1.0.89 h1:L9oWZGqQXWyTPnC6ODXgu3b0DFyLmJ9eHv+uJrE9IZY= github.com/smartcontractkit/chain-selectors v1.0.89/go.mod h1:qy7whtgG5g+7z0jt0nRyii9bLND9m15NZTzuQPkMZ5w= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6 h1:bkKoQ7jW25iHtbbriRj5YPHokalaFH2ImBtiKm3QmKU= -github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217084735-307a5770c4f6/go.mod h1:13YN2kb3Vqpw2S7d4IwhX/578WPGC0JHN5JrOnAEsOc= -github.com/smartcontractkit/chainlink-common/keystore v0.1.1-0.20260115164422-897ee18790cd h1:q9wtu29jtE3UgZ/P6qzTD/hK6Zv6xA0EFKmZT9mCIl4= -github.com/smartcontractkit/chainlink-common/keystore v0.1.1-0.20260115164422-897ee18790cd/go.mod h1:30GutVApUFKO6DbtxfaIO1sEEQ5jMwkurGcfRkLn7bY= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7 h1:h5cmgzKpKn5N5ItpEDFhRcrtqs36nu9r/dciJub1hos= +github.com/smartcontractkit/chainlink-common v0.10.1-0.20260217160002-b56cb5356cc7/go.mod h1:HXgSKzmZ/bhSx8nHU7hHW6dR+BHSXkdcpFv2T8qJcS8= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7 h1:Pxnkt4XntTv945tw/kGMqOmyfn40YtJciKEcKqljvrA= +github.com/smartcontractkit/chainlink-common/keystore v1.0.2-0.20260217160002-b56cb5356cc7/go.mod h1:rSkIHdomyak3YnUtXLenl6poIq8q0V3UZPiiyYqPdGA= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10/go.mod h1:oiDa54M0FwxevWwyAX773lwdWvFYYlYHHQV1LQ5HpWY= github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251022073203-7d8ae8cf67c1 h1:NTODgwAil7BLoijS7y6KnEuNbQ9v60VUhIR9FcAzIhg= @@ -640,8 +641,8 @@ github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251020150604-8a github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251020150604-8ab84f7bad1a/go.mod h1:jo+cUqNcHwN8IF7SInQNXDZ8qzBsyMpnLdYbDswviFc= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942 h1:T/eCDsUI8EJT4n5zSP4w1mz4RHH+ap8qieA17QYfBhk= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942/go.mod h1:2JTBNp3FlRdO/nHc4dsc9bfxxMClMO1Qt8sLJgtreBY= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe h1:Vc4zoSc/j6/FdCQ7vcyHTTB7kzHI2f+lHCHqFuiCcJQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260210221717-2546aed27ebe/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f h1:MHlgzqiDPyDV397bZkzS9TtWXb3FR9Pb8FR9cP9h0As= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260217043601-5cc966896c4f/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= github.com/smartcontractkit/chainlink-protos/node-platform v0.0.0-20260205130626-db2a2aab956b h1:36knUpKHHAZ86K4FGWXtx8i/EQftGdk2bqCoEu/Cha8= @@ -656,8 +657,8 @@ github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e h1:Hv9 github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e/go.mod h1:T4zH9R8R8lVWKfU7tUvYz2o2jMv1OpGCdpY2j2QZXzU= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7/go.mod h1:FX7/bVdoep147QQhsOPkYsPEXhGZjeYx6lBSaSXtZOA= -github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d h1:LokA9PoCNb8mm8mDT52c3RECPMRsGz1eCQORq+J3n74= -github.com/smartcontractkit/libocr v0.0.0-20250912173940-f3ab0246e23d/go.mod h1:Acy3BTBxou83ooMESLO90s8PKSu7RvLCzwSTbxxfOK0= +github.com/smartcontractkit/libocr v0.0.0-20251027221354-bdc84e1ed858 h1:dz+lxAW+B+PUq32ODppSq5UKw06+EF6+EO6kk684bcQ= +github.com/smartcontractkit/libocr v0.0.0-20251027221354-bdc84e1ed858/go.mod h1:oJkBKVn8zoBQm7Feah9CiuEHyCqAhnp1LJBzrvloQtM= github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -733,6 +734,15 @@ github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.dedis.ch/fixbuf v1.0.3 h1:hGcV9Cd/znUxlusJ64eAlExS+5cJDIyTyEG+otu5wQs= +go.dedis.ch/fixbuf v1.0.3/go.mod h1:yzJMt34Wa5xD37V5RTdmp38cz3QhMagdGoem9anUalw= +go.dedis.ch/kyber/v3 v3.0.4/go.mod h1:OzvaEnPvKlyrWyp3kGXlFdp7ap1VC6RkZDTaPikqhsQ= +go.dedis.ch/kyber/v3 v3.0.9/go.mod h1:rhNjUUg6ahf8HEg5HUvVBYoWY4boAafX8tYxX+PS+qg= +go.dedis.ch/kyber/v3 v3.1.0 h1:ghu+kiRgM5JyD9TJ0hTIxTLQlJBR/ehjWvWwYW3XsC0= +go.dedis.ch/kyber/v3 v3.1.0/go.mod h1:kXy7p3STAurkADD+/aZcsznZGKVHEqbtmdIzvPfrs1U= +go.dedis.ch/protobuf v1.0.5/go.mod h1:eIV4wicvi6JK0q/QnfIEGeSFNG0ZeB24kzut5+HaRLo= +go.dedis.ch/protobuf v1.0.7/go.mod h1:pv5ysfkDX/EawiPqcW3ikOxsL5t+BqnV6xHSmE79KI4= +go.dedis.ch/protobuf v1.0.11/go.mod h1:97QR256dnkimeNdfmURz0wAMNVbd1VmLXhG1CrTYrJ4= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= @@ -747,7 +757,6 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0 h1:YH4g8lQroajqUwWbq/tr2QX1JFmEXaDLgG+ew9bLMWo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.63.0/go.mod h1:fvPi2qXDqFs8M4B4fmJhE92TyQs9Ydjlg3RvfUp+NbQ= -go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI= go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 h1:06ZeJRe5BnYXceSM9Vya83XXVaNGe3H1QqsvqRANQq8= @@ -782,7 +791,6 @@ go.opentelemetry.io/otel/sdk/log/logtest v0.13.0 h1:9yio6AFZ3QD9j9oqshV1Ibm9gPLl go.opentelemetry.io/otel/sdk/log/logtest v0.13.0/go.mod h1:QOGiAJHl+fob8Nu85ifXfuQYmJTFAvcrxL6w5/tu168= go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= -go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= go.opentelemetry.io/proto/otlp v1.6.0 h1:jQjP+AQyTf+Fe7OKj/MfkDrmK4MNVtw2NpXsf9fefDI= @@ -808,6 +816,7 @@ go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc= go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -953,6 +962,7 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/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= diff --git a/pkg/config/mocks/gas_estimator.go b/pkg/config/mocks/gas_estimator.go index 401dddfb1d..1301e75cd6 100644 --- a/pkg/config/mocks/gas_estimator.go +++ b/pkg/config/mocks/gas_estimator.go @@ -8,9 +8,9 @@ import ( config "github.com/smartcontractkit/chainlink-evm/pkg/config" - mock "github.com/stretchr/testify/mock" + ethkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" - types "github.com/smartcontractkit/chainlink-evm/pkg/types" + mock "github.com/stretchr/testify/mock" ) // GasEstimator is an autogenerated mock type for the GasEstimator type @@ -948,19 +948,19 @@ func (_c *GasEstimator_PriceMin_Call) RunAndReturn(run func() *assets.Wei) *GasE } // SenderAddress provides a mock function with no fields -func (_m *GasEstimator) SenderAddress() *types.EIP55Address { +func (_m *GasEstimator) SenderAddress() *ethkey.EIP55Address { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for SenderAddress") } - var r0 *types.EIP55Address - if rf, ok := ret.Get(0).(func() *types.EIP55Address); ok { + var r0 *ethkey.EIP55Address + if rf, ok := ret.Get(0).(func() *ethkey.EIP55Address); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.EIP55Address) + r0 = ret.Get(0).(*ethkey.EIP55Address) } } @@ -984,12 +984,12 @@ func (_c *GasEstimator_SenderAddress_Call) Run(run func()) *GasEstimator_SenderA return _c } -func (_c *GasEstimator_SenderAddress_Call) Return(_a0 *types.EIP55Address) *GasEstimator_SenderAddress_Call { +func (_c *GasEstimator_SenderAddress_Call) Return(_a0 *ethkey.EIP55Address) *GasEstimator_SenderAddress_Call { _c.Call.Return(_a0) return _c } -func (_c *GasEstimator_SenderAddress_Call) RunAndReturn(run func() *types.EIP55Address) *GasEstimator_SenderAddress_Call { +func (_c *GasEstimator_SenderAddress_Call) RunAndReturn(run func() *ethkey.EIP55Address) *GasEstimator_SenderAddress_Call { _c.Call.Return(run) return _c } diff --git a/pkg/config/mocks/workflow.go b/pkg/config/mocks/workflow.go index 2f61c8b394..8be0e9a823 100644 --- a/pkg/config/mocks/workflow.go +++ b/pkg/config/mocks/workflow.go @@ -3,12 +3,12 @@ package mocks import ( - time "time" - - pkgtypes "github.com/smartcontractkit/chainlink-common/pkg/types" + ethkey "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" mock "github.com/stretchr/testify/mock" - types "github.com/smartcontractkit/chainlink-evm/pkg/types" + time "time" + + types "github.com/smartcontractkit/chainlink-common/pkg/types" ) // Workflow is an autogenerated mock type for the Workflow type @@ -70,19 +70,19 @@ func (_c *Workflow_AcceptanceTimeout_Call) RunAndReturn(run func() time.Duration } // ForwarderAddress provides a mock function with no fields -func (_m *Workflow) ForwarderAddress() *types.EIP55Address { +func (_m *Workflow) ForwarderAddress() *ethkey.EIP55Address { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for ForwarderAddress") } - var r0 *types.EIP55Address - if rf, ok := ret.Get(0).(func() *types.EIP55Address); ok { + var r0 *ethkey.EIP55Address + if rf, ok := ret.Get(0).(func() *ethkey.EIP55Address); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.EIP55Address) + r0 = ret.Get(0).(*ethkey.EIP55Address) } } @@ -106,30 +106,30 @@ func (_c *Workflow_ForwarderAddress_Call) Run(run func()) *Workflow_ForwarderAdd return _c } -func (_c *Workflow_ForwarderAddress_Call) Return(_a0 *types.EIP55Address) *Workflow_ForwarderAddress_Call { +func (_c *Workflow_ForwarderAddress_Call) Return(_a0 *ethkey.EIP55Address) *Workflow_ForwarderAddress_Call { _c.Call.Return(_a0) return _c } -func (_c *Workflow_ForwarderAddress_Call) RunAndReturn(run func() *types.EIP55Address) *Workflow_ForwarderAddress_Call { +func (_c *Workflow_ForwarderAddress_Call) RunAndReturn(run func() *ethkey.EIP55Address) *Workflow_ForwarderAddress_Call { _c.Call.Return(run) return _c } // FromAddress provides a mock function with no fields -func (_m *Workflow) FromAddress() *types.EIP55Address { +func (_m *Workflow) FromAddress() *ethkey.EIP55Address { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for FromAddress") } - var r0 *types.EIP55Address - if rf, ok := ret.Get(0).(func() *types.EIP55Address); ok { + var r0 *ethkey.EIP55Address + if rf, ok := ret.Get(0).(func() *ethkey.EIP55Address); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.EIP55Address) + r0 = ret.Get(0).(*ethkey.EIP55Address) } } @@ -153,12 +153,12 @@ func (_c *Workflow_FromAddress_Call) Run(run func()) *Workflow_FromAddress_Call return _c } -func (_c *Workflow_FromAddress_Call) Return(_a0 *types.EIP55Address) *Workflow_FromAddress_Call { +func (_c *Workflow_FromAddress_Call) Return(_a0 *ethkey.EIP55Address) *Workflow_FromAddress_Call { _c.Call.Return(_a0) return _c } -func (_c *Workflow_FromAddress_Call) RunAndReturn(run func() *types.EIP55Address) *Workflow_FromAddress_Call { +func (_c *Workflow_FromAddress_Call) RunAndReturn(run func() *ethkey.EIP55Address) *Workflow_FromAddress_Call { _c.Call.Return(run) return _c } @@ -256,19 +256,19 @@ func (_c *Workflow_PollPeriod_Call) RunAndReturn(run func() time.Duration) *Work } // TxAcceptanceState provides a mock function with no fields -func (_m *Workflow) TxAcceptanceState() *pkgtypes.TransactionStatus { +func (_m *Workflow) TxAcceptanceState() *types.TransactionStatus { ret := _m.Called() if len(ret) == 0 { panic("no return value specified for TxAcceptanceState") } - var r0 *pkgtypes.TransactionStatus - if rf, ok := ret.Get(0).(func() *pkgtypes.TransactionStatus); ok { + var r0 *types.TransactionStatus + if rf, ok := ret.Get(0).(func() *types.TransactionStatus); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*pkgtypes.TransactionStatus) + r0 = ret.Get(0).(*types.TransactionStatus) } } @@ -292,12 +292,12 @@ func (_c *Workflow_TxAcceptanceState_Call) Run(run func()) *Workflow_TxAcceptanc return _c } -func (_c *Workflow_TxAcceptanceState_Call) Return(_a0 *pkgtypes.TransactionStatus) *Workflow_TxAcceptanceState_Call { +func (_c *Workflow_TxAcceptanceState_Call) Return(_a0 *types.TransactionStatus) *Workflow_TxAcceptanceState_Call { _c.Call.Return(_a0) return _c } -func (_c *Workflow_TxAcceptanceState_Call) RunAndReturn(run func() *pkgtypes.TransactionStatus) *Workflow_TxAcceptanceState_Call { +func (_c *Workflow_TxAcceptanceState_Call) RunAndReturn(run func() *types.TransactionStatus) *Workflow_TxAcceptanceState_Call { _c.Call.Return(run) return _c } diff --git a/pkg/types/address.go b/pkg/types/address.go index 3c8b0621a9..943233263a 100644 --- a/pkg/types/address.go +++ b/pkg/types/address.go @@ -1,144 +1,23 @@ package types import ( - "database/sql/driver" - "encoding/hex" - "fmt" - "math/big" - "strings" - "github.com/ethereum/go-ethereum/common" - "github.com/smartcontractkit/chainlink-common/pkg/utils/bytes" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/ethkey" ) -// EIP55Address is a new type for string which persists an ethereum address in -// its original string representation which includes a leading 0x, and EIP55 -// checksum which is represented by the case of digits A-F. -type EIP55Address string +type EIP55Address = ethkey.EIP55Address + +type EIP55AddressCollection = ethkey.EIP55AddressCollection -// NewEIP55Address creates an EIP55Address from a string, an error is returned if: -// -// 1) There is no leading 0x -// 2) The length is wrong -// 3) There are any non hexadecimal characters -// 4) The checksum fails func NewEIP55Address(s string) (EIP55Address, error) { - address := common.HexToAddress(s) - if s != address.Hex() { - return EIP55Address(""), fmt.Errorf(`"%s" is not a valid EIP55 formatted address`, s) - } - return EIP55Address(s), nil + return ethkey.NewEIP55Address(s) } func MustEIP55Address(s string) EIP55Address { - addr, err := NewEIP55Address(s) - if err != nil { - panic(err) - } - return addr + return ethkey.MustEIP55Address(s) } -// EIP55AddressFromAddress forces an address into EIP55Address format -// It is safe to panic on error since address.Hex() should ALWAYS generate EIP55Address-compatible hex strings func EIP55AddressFromAddress(a common.Address) EIP55Address { - addr, err := NewEIP55Address(a.Hex()) - if err != nil { - panic(err) - } - return addr -} - -// Bytes returns the raw bytes -func (a EIP55Address) Bytes() []byte { return a.Address().Bytes() } - -// Big returns a big.Int representation -func (a EIP55Address) Big() *big.Int { return a.Address().Big() } - -// Hash returns the Hash -func (a EIP55Address) Hash() common.Hash { return common.BytesToHash(a.Bytes()) } - -// Address returns EIP55Address as a go-ethereum Address type -func (a EIP55Address) Address() common.Address { return common.HexToAddress(a.String()) } - -// String implements the stringer interface and is used also by the logger. -func (a EIP55Address) String() string { - return string(a) -} - -// Hex is identical to String but makes the API similar to common.Address -func (a EIP55Address) Hex() string { - return a.String() -} - -// Format implements fmt.Formatter -func (a EIP55Address) Format(s fmt.State, c rune) { - _, _ = fmt.Fprint(s, a.String()) -} - -// UnmarshalText parses a hash from plain text -func (a *EIP55Address) UnmarshalText(input []byte) error { - var err error - *a, err = NewEIP55Address(string(input)) - return err -} - -// UnmarshalJSON parses a hash from a JSON string -func (a *EIP55Address) UnmarshalJSON(input []byte) error { - input = bytes.TrimQuotes(input) - return a.UnmarshalText(input) -} - -// Value returns this instance serialized for database storage. -func (a EIP55Address) Value() (driver.Value, error) { - return a.Bytes(), nil -} - -// Scan reads the database value and returns an instance. -func (a *EIP55Address) Scan(value interface{}) error { - switch v := value.(type) { - case string: - *a = EIP55Address(v) - case []byte: - address := common.HexToAddress("0x" + hex.EncodeToString(v)) - *a = EIP55Address(address.Hex()) - default: - return fmt.Errorf("unable to convert %v of %T to EIP55Address", value, value) - } - return nil -} - -// IsZeroAddress determines whether the address is 0x0000... or not -func (a EIP55Address) IsZero() bool { - return a.Address() == common.Address{} -} - -// EIP55AddressCollection is an array of EIP55Addresses. -type EIP55AddressCollection []EIP55Address - -// Value returns this instance serialized for database storage. -func (c EIP55AddressCollection) Value() (driver.Value, error) { - // Unable to convert copy-free without unsafe: - // https://stackoverflow.com/a/48554123/639773 - converted := make([]string, len(c)) - for i, e := range c { - converted[i] = string(e) - } - return strings.Join(converted, ","), nil -} - -// Scan reads the database value and returns an instance. -func (c *EIP55AddressCollection) Scan(value interface{}) error { - temp, ok := value.(string) - if !ok { - return fmt.Errorf("unable to convert %v of %T to EIP55AddressCollection", value, value) - } - - arr := strings.Split(temp, ",") - collection := make(EIP55AddressCollection, len(arr)) - for i, r := range arr { - collection[i] = EIP55Address(r) - } - *c = collection - return nil + return ethkey.EIP55AddressFromAddress(a) } diff --git a/pkg/types/address_test.go b/pkg/types/address_test.go deleted file mode 100644 index 3763831d3b..0000000000 --- a/pkg/types/address_test.go +++ /dev/null @@ -1,124 +0,0 @@ -package types_test - -import ( - "encoding/json" - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/common" - "github.com/stretchr/testify/assert" - - "github.com/smartcontractkit/chainlink-evm/pkg/types" -) - -func TestEIP55Address(t *testing.T) { - t.Parallel() - - address := types.EIP55Address("0xa0788FC17B1dEe36f057c42B6F373A34B014687e") - - assert.Equal(t, []byte{ - 0xa0, 0x78, 0x8f, 0xc1, 0x7b, 0x1d, 0xee, 0x36, - 0xf0, 0x57, 0xc4, 0x2b, 0x6f, 0x37, 0x3a, 0x34, - 0xb0, 0x14, 0x68, 0x7e, - }, address.Bytes()) - - bi, _ := (new(big.Int)).SetString("a0788FC17B1dEe36f057c42B6F373A34B014687e", 16) - assert.Equal(t, bi, address.Big()) - - assert.Equal(t, "0xa0788FC17B1dEe36f057c42B6F373A34B014687e", address.String()) - - assert.Equal(t, common.BytesToHash([]byte{ - 0xa0, 0x78, 0x8f, 0xc1, 0x7b, 0x1d, 0xee, 0x36, - 0xf0, 0x57, 0xc4, 0x2b, 0x6f, 0x37, 0x3a, 0x34, - 0xb0, 0x14, 0x68, 0x7e, - }), address.Hash()) - - assert.Equal(t, "0xa0788FC17B1dEe36f057c42B6F373A34B014687e", address.String()) - - zeroAddress := types.EIP55Address("") - err := json.Unmarshal([]byte(`"0xa0788FC17B1dEe36f057c42B6F373A34B014687e"`), &zeroAddress) - assert.NoError(t, err) - assert.Equal(t, "0xa0788FC17B1dEe36f057c42B6F373A34B014687e", zeroAddress.String()) - - zeroAddress = types.EIP55Address("") - err = zeroAddress.UnmarshalText([]byte("0xa0788FC17B1dEe36f057c42B6F373A34B014687e")) - assert.NoError(t, err) - assert.Equal(t, "0xa0788FC17B1dEe36f057c42B6F373A34B014687e", zeroAddress.String()) -} - -func TestValidateEIP55Address(t *testing.T) { - t.Parallel() - - tests := []struct { - name string - input string - valid bool - }{ - {"valid address", "0xa0788FC17B1dEe36f057c42B6F373A34B014687e", true}, - {"lowercase address", "0xa0788fc17b1dee36f057c42b6f373a34b014687e", false}, - {"invalid checksum", "0xA0788FC17B1dEe36f057c42B6F373A34B014687e", false}, - {"no leading 0x", "A0788FC17B1dEe36f057c42B6F373A34B014687e", false}, - {"non hex character", "0xz0788FC17B1dEe36f057c42B6F373A34B014687e", false}, - {"wrong length", "0xa0788FC17B1dEe36f057c42B6F373A34B014687", false}, - } - - for _, test := range tests { - t.Run(test.name, func(t *testing.T) { - _, err := types.NewEIP55Address(test.input) - valid := err == nil - assert.Equal(t, test.valid, valid) - }) - } -} - -func TestEIP55AddressFromAddress(t *testing.T) { - t.Parallel() - - addr := common.HexToAddress("0xa0788FC17B1dEe36f057c42B6F373A34B014687e") - eip55 := types.EIP55AddressFromAddress(addr) - assert.Equal(t, addr, eip55.Address()) -} - -func TestEIP55Address_Scan_Value(t *testing.T) { - t.Parallel() - - eip55, err := types.NewEIP55Address("0xa0788FC17B1dEe36f057c42B6F373A34B014687e") - assert.NoError(t, err) - - val, err := eip55.Value() - assert.NoError(t, err) - - var eip55New types.EIP55Address - err = eip55New.Scan(val) - assert.NoError(t, err) - - assert.Equal(t, eip55, eip55New) -} - -func TestEIP55AddressCollection_Scan_Value(t *testing.T) { - t.Parallel() - - collection := types.EIP55AddressCollection{ - types.EIP55Address("0xa0788FC17B1dEe36f057c42B6F373A34B0146111"), - types.EIP55Address("0xa0788FC17B1dEe36f057c42B6F373A34B0146222"), - } - - val, err := collection.Value() - assert.NoError(t, err) - - var collectionNew types.EIP55AddressCollection - err = collectionNew.Scan(val) - assert.NoError(t, err) - - assert.Equal(t, collection, collectionNew) -} - -func TestEIP55Address_IsZero(t *testing.T) { - t.Parallel() - - eip55 := types.EIP55AddressFromAddress(common.HexToAddress("0x0")) - assert.True(t, eip55.IsZero()) - - eip55 = types.EIP55AddressFromAddress(common.HexToAddress("0x1")) - assert.False(t, eip55.IsZero()) -} diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 032ef4a63b..44b33ed073 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -14,6 +14,7 @@ import ( "github.com/jpillora/backoff" "golang.org/x/crypto/sha3" + "github.com/smartcontractkit/chainlink-common/keystore/corekeys/vrfkey/secp256k1" "github.com/smartcontractkit/chainlink-common/pkg/utils/hex" ) @@ -114,11 +115,7 @@ func Uint256ToBytes32(n *big.Int) []byte { // MustHash returns the keccak256 hash, or panics on failure. func MustHash(in string) common.Hash { - out, err := Keccak256([]byte(in)) - if err != nil { - panic(err) - } - return common.BytesToHash(out) + return secp256k1.MustKeccakHash(in) } // HexToUint256 returns the uint256 represented by s, or an error if it doesn't