diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index edf1324d..3813897b 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -127,10 +127,10 @@ jobs: matrix: test_type: [ "AaveV2Stablecoin", "CellarV1", "CellarV2", "CellarV2_2", "ScheduledCorkProposal", "ScheduledAxelarCorkProposal", "ScheduledCorkMulticallProposal"] steps: - - name: Set up Go 1.19 + - name: Set up Go 1.22 uses: actions/setup-go@v2 with: - go-version: 1.19 + go-version: 1.22 - name: checkout uses: actions/checkout@v2 - name: go-cache diff --git a/go.mod b/go.mod index 5532b50d..75c71d44 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/peggyjv/steward -go 1.19 +go 1.22 + +toolchain go1.22.1 require ( cosmossdk.io/math v1.0.0-rc.0 @@ -11,19 +13,19 @@ require ( github.com/ory/dockertest/v3 v3.10.0 github.com/peggyjv/gravity-bridge/module/v4 v4.0.0 github.com/peggyjv/sommelier/v7 v7.0.0-20240128035207-34bf4246db57 + github.com/peggyjv/steward/steward_proto_go/steward_proto v0.0.0-20230323171404-00b2e7c3ae9d github.com/spf13/viper v1.14.0 - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.4 github.com/tendermint/tendermint v0.34.29 - google.golang.org/grpc v1.54.0 - google.golang.org/protobuf v1.30.0 + google.golang.org/grpc v1.64.0 ) require ( - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.18.0 // indirect + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/compute v1.25.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.12.0 // indirect - cloud.google.com/go/storage v1.28.1 // indirect + cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/storage v1.38.0 // indirect cosmossdk.io/errors v1.0.0-beta.7 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -72,28 +74,30 @@ require ( github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect - github.com/felixge/httpsnoop v1.0.2 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-playground/validator/v10 v10.4.1 // indirect github.com/go-stack/stack v1.8.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect github.com/gogo/protobuf v1.3.3 // indirect - github.com/golang/glog v1.0.0 // indirect + github.com/golang/glog v1.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect + github.com/google/s2a-go v0.1.7 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.7.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect @@ -174,19 +178,28 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.7.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + golang.org/x/crypto v0.21.0 // indirect golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 // indirect golang.org/x/mod v0.9.0 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/oauth2 v0.5.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.7.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.7.0 // indirect - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.110.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect + google.golang.org/api v0.169.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 0c6a9493..140ef69c 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= +cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -28,15 +28,14 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/compute v1.18.0 h1:FEigFqoDbys2cvFkZ9Fjq4gnHBP55anJ0yQyau2f9oY= -cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= +cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= +cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v0.12.0 h1:DRtTY29b75ciH6Ov1PHb4/iat2CLCvrOm40Q0a6DFpE= -cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= +cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -47,8 +46,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.28.1 h1:F5QDG5ChchaAVQhINh24U99OWHURqrW8OmQcGKXcbgI= -cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= +cloud.google.com/go/storage v1.38.0 h1:Az68ZRGlnNTpIBbLjSMIV2BDcwwXYlRlQzis0llkpJg= +cloud.google.com/go/storage v1.38.0/go.mod h1:tlUADB0mAb9BgYls9lq+8MGkfzOXuLrnHXlpHmvFJoY= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= @@ -104,6 +103,7 @@ github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSa github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t5BnDuE2Ya2MMGhzP6A= github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= +github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -161,6 +161,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJ github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/btcutil v1.1.2/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= 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= @@ -178,6 +179,7 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bufbuild/protocompile v0.1.0 h1:HjgJBI85hY/qmW5tw/66sNDZ7z0UDdVSi/5r40WHw4s= +github.com/bufbuild/protocompile v0.1.0/go.mod h1:ix/MMMdsT3fzxfw91dvbfzKW3fRRnuPCP47kpAm5m/4= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -344,21 +346,26 @@ github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd github.com/ethereum/go-ethereum v1.10.22 h1:HbEgsDo1YTGIf4KB/NNpn+XH+PiNJXUZ9ksRxiqWyMc= github.com/ethereum/go-ethereum v1.10.22/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= +github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= -github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -373,6 +380,7 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= +github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= @@ -391,6 +399,11 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/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/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= @@ -410,6 +423,7 @@ github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5Nq github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= 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= @@ -432,8 +446,8 @@ github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= +github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -448,6 +462,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -465,8 +480,8 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -489,8 +504,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64= @@ -500,6 +515,7 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -514,6 +530,8 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -521,14 +539,14 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.5/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= -github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= +github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= +github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -612,6 +630,7 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo= github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ= +github.com/huin/goupnp v1.0.3/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -641,6 +660,7 @@ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1C github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= +github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -658,6 +678,7 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jsternberg/zap-logfmt v1.0.0/go.mod h1:uvPs/4X51zdkcm5jXl5SYoN+4RK21K8mysFmDaM/h+o= @@ -690,6 +711,7 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -782,6 +804,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= @@ -826,6 +849,7 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= @@ -845,6 +869,7 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= +github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/ory/dockertest/v3 v3.10.0 h1:4K3z2VMe8Woe++invjaTB7VRyQXQy5UY+loujO4aNE4= github.com/ory/dockertest/v3 v3.10.0/go.mod h1:nr57ZbRWMqfsdGdFNLHz5jjNdDb7VVFnzAeW1n5N1Lg= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= @@ -934,6 +959,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -1014,8 +1040,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= @@ -1062,6 +1088,7 @@ github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= +github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= @@ -1080,12 +1107,14 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= @@ -1104,6 +1133,18 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1134,9 +1175,10 @@ golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1178,6 +1220,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1236,8 +1279,9 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1247,8 +1291,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s= -golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1260,7 +1304,9 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1352,16 +1398,17 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1371,15 +1418,17 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1441,6 +1490,7 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1448,8 +1498,8 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -1476,8 +1526,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.110.0 h1:l+rh0KYUooe9JGbGVx71tbFo4SMbMTXK3I3ia2QSEeU= -google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= +google.golang.org/api v0.169.0 h1:QwWPy71FgMWqJN/l6jVlFHUa29a7dcUy02I8o799nPY= +google.golang.org/api v0.169.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1485,8 +1535,9 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1531,8 +1582,12 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= -google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= +google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1557,8 +1612,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= -google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1572,8 +1627,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1615,6 +1670,7 @@ gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.3.0 h1:MfDY1b1/0xN1CyMlQDac0ziEy9zJQd9CXBRRDHw2jJo= +gotest.tools/v3 v3.3.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1627,6 +1683,7 @@ honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= +pgregory.net/rapid v0.5.3/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/go_request_builder/adaptor_call.go b/go_request_builder/adaptor_call.go new file mode 100644 index 00000000..ed27e3d9 --- /dev/null +++ b/go_request_builder/adaptor_call.go @@ -0,0 +1,18 @@ +package builder + +import "github.com/peggyjv/steward/steward_proto_go/steward_proto" + +type AdaptorCallBuilder struct { + callData *steward_proto.AdaptorCall, +} + +func NewAdaptorCallBuilder(adaptor common.Address) *AdaptorCallBuilder { + return &AdaptorCallBuilder{ + callData: &steward_proto.AdaptorCall{ + Adaptor: adaptor.Hex(), + CallData: &steward_proto.AdaptorCall_CellarV2_5{}, + }, + } +} + + diff --git a/go_request_builder/adaptors/aave_v2_a_token.go b/go_request_builder/adaptors/aave_v2_a_token.go new file mode 100644 index 00000000..9c7b7060 --- /dev/null +++ b/go_request_builder/adaptors/aave_v2_a_token.go @@ -0,0 +1,70 @@ +package adaptors + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/steward/steward_proto_go/steward_proto" +) + +type AaveV2ATokenAdaptorV2CallBuilder struct { + adaptor common.Address + calls []*steward_proto.AaveATokenAdaptorV2 +} + +func NewAaveV2ATokenAdaptorV2CallBuilder(adaptor common.Address) *AaveV2ATokenAdaptorV2CallBuilder { + return &AaveV2ATokenAdaptorV2CallBuilder{ + adaptor: adaptor, + calls: make([]*steward_proto.AaveATokenAdaptorV2, 0), + } +} + +func (b *AaveV2ATokenAdaptorV2CallBuilder) Build() *steward_proto.AdaptorCall { + return &steward_proto.AdaptorCall{ + Adaptor: b.adaptor.Hex(), + CallData: &steward_proto.AdaptorCall_AaveATokenV2Calls{ + AaveATokenV2Calls: &steward_proto.AaveATokenAdaptorV2Calls{ + Calls: b.calls, + }, + }, + } +} + +func (b *AaveV2ATokenAdaptorV2CallBuilder) RevokeApproval(asset common.Address, spender common.Address) *AaveV2ATokenAdaptorV2CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveATokenAdaptorV2{ + Function: &steward_proto.AaveATokenAdaptorV2_RevokeApproval{ + RevokeApproval: &steward_proto.RevokeApproval{ + Asset: asset.Hex(), + Spender: spender.Hex(), + }, + }, + }) + + return b +} + +func (b *AaveV2ATokenAdaptorV2CallBuilder) DepositToAave(token common.Address, amount *big.Int) *AaveV2ATokenAdaptorV2CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveATokenAdaptorV2{ + Function: &steward_proto.AaveATokenAdaptorV2_DepositToAave_{ + DepositToAave: &steward_proto.AaveATokenAdaptorV2_DepositToAave{ + Token: token.Hex(), + Amount: amount.String(), + }, + }, + }) + + return b +} + +func (b *AaveV2ATokenAdaptorV2CallBuilder) WithdrawFromAave(token common.Address, amount *big.Int) *AaveV2ATokenAdaptorV2CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveATokenAdaptorV2{ + Function: &steward_proto.AaveATokenAdaptorV2_WithdrawFromAave_{ + WithdrawFromAave: &steward_proto.AaveATokenAdaptorV2_WithdrawFromAave{ + Token: token.Hex(), + Amount: amount.String(), + }, + }, + }) + + return b +} diff --git a/go_request_builder/adaptors/aave_v2_a_token_test.go b/go_request_builder/adaptors/aave_v2_a_token_test.go new file mode 100644 index 00000000..16731eda --- /dev/null +++ b/go_request_builder/adaptors/aave_v2_a_token_test.go @@ -0,0 +1,34 @@ +package adaptors + +import ( + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/steward/steward_proto_go/steward_proto" + "github.com/stretchr/testify/assert" +) + +// Test the AaveV2ATokenAdaptorCallBuilder constructor +func TestNewAaveATokenAdaptorCall(t *testing.T) { + // Create a new AaveV2ATokenAdaptorCallBuilder + adaptor := common.HexToAddress("0x1234567890123456789012345678901234567890") + builder := NewAaveV2ATokenAdaptorV2CallBuilder(adaptor) + + // Check the builder + assert.Equal(t, adaptor.Hex(), builder.adaptor.Hex()) + assert.Equal(t, 0, len(builder.calls)) + + asset := common.HexToAddress("0x00000000000000000000000000000000000000000") + spender := common.HexToAddress("0x11111111111111111111111111111111111111111") + builder.RevokeApproval(asset, spender) + builder.DepositToAave(asset, big.NewInt(100)) + builder.WithdrawFromAave(asset, big.NewInt(100)) + + // Check the builder + assert.Equal(t, adaptor.Hex(), builder.adaptor.Hex()) + assert.Equal(t, 3, len(builder.calls)) + assert.IsType(t, &steward_proto.AaveATokenAdaptorV2_RevokeApproval{}, builder.calls[0].Function) + assert.IsType(t, &steward_proto.AaveATokenAdaptorV2_DepositToAave_{}, builder.calls[1].Function) + assert.IsType(t, &steward_proto.AaveATokenAdaptorV2_WithdrawFromAave_{}, builder.calls[2].Function) +} diff --git a/go_request_builder/adaptors/aave_v2_enable_asset_as_collateral.go b/go_request_builder/adaptors/aave_v2_enable_asset_as_collateral.go new file mode 100644 index 00000000..6ab470d3 --- /dev/null +++ b/go_request_builder/adaptors/aave_v2_enable_asset_as_collateral.go @@ -0,0 +1,55 @@ +package adaptors + +import ( + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/steward/steward_proto_go/steward_proto" +) + +type AaveV2EnableAssetAsCollateralAdaptorV1CallBuilder struct { + adaptor common.Address + calls []*steward_proto.AaveV2EnableAssetAsCollateralAdaptorV1 +} + +func NewAaveV2EnableAssetAsCollateralAdaptorV1CallBuilder(adaptor common.Address) *AaveV2EnableAssetAsCollateralAdaptorV1CallBuilder { + return &AaveV2EnableAssetAsCollateralAdaptorV1CallBuilder{ + adaptor: adaptor, + calls: make([]*steward_proto.AaveV2EnableAssetAsCollateralAdaptorV1, 0), + } +} + +func (b *AaveV2EnableAssetAsCollateralAdaptorV1CallBuilder) Build() *steward_proto.AdaptorCall { + return &steward_proto.AdaptorCall{ + Adaptor: b.adaptor.Hex(), + CallData: &steward_proto.AdaptorCall_AaveV2EnableAssetAsCollateralV1Calls{ + AaveV2EnableAssetAsCollateralV1Calls: &steward_proto.AaveV2EnableAssetAsCollateralAdaptorV1Calls{ + Calls: b.calls, + }, + }, + } +} + +func (b *AaveV2EnableAssetAsCollateralAdaptorV1CallBuilder) RevokeApproval(asset common.Address, spender common.Address) *AaveV2EnableAssetAsCollateralAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV2EnableAssetAsCollateralAdaptorV1{ + Function: &steward_proto.AaveV2EnableAssetAsCollateralAdaptorV1_RevokeApproval{ + RevokeApproval: &steward_proto.RevokeApproval{ + Asset: asset.Hex(), + Spender: spender.Hex(), + }, + }, + }) + + return b +} + +func (b *AaveV2EnableAssetAsCollateralAdaptorV1CallBuilder) SetUserUseReserveAsCollateral(asset common.Address, useAsCollateral bool) *AaveV2EnableAssetAsCollateralAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV2EnableAssetAsCollateralAdaptorV1{ + Function: &steward_proto.AaveV2EnableAssetAsCollateralAdaptorV1_SetUserUseReserveAsCollateral_{ + SetUserUseReserveAsCollateral: &steward_proto.AaveV2EnableAssetAsCollateralAdaptorV1_SetUserUseReserveAsCollateral{ + Asset: asset.Hex(), + UseAsCollateral: useAsCollateral, + }, + }, + }) + + return b +} diff --git a/go_request_builder/adaptors/aave_v3_a_token.go b/go_request_builder/adaptors/aave_v3_a_token.go new file mode 100644 index 00000000..f7d50da2 --- /dev/null +++ b/go_request_builder/adaptors/aave_v3_a_token.go @@ -0,0 +1,95 @@ +package adaptors + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/steward/steward_proto_go/steward_proto" +) + +type AaveV3ATokenAdaptorV1CallBuilder struct { + adaptor common.Address + calls []*steward_proto.AaveV3ATokenAdaptorV1 +} + +func NewAaveV3ATokenAdaptorV1CallBuilder(adaptor common.Address) *AaveV3ATokenAdaptorV1CallBuilder { + return &AaveV3ATokenAdaptorV1CallBuilder{ + adaptor: adaptor, + calls: make([]*steward_proto.AaveV3ATokenAdaptorV1, 0), + } +} + +func (b *AaveV3ATokenAdaptorV1CallBuilder) Build() *steward_proto.AdaptorCall { + return &steward_proto.AdaptorCall{ + Adaptor: b.adaptor.Hex(), + CallData: &steward_proto.AdaptorCall_AaveV3ATokenV1Calls{ + AaveV3ATokenV1Calls: &steward_proto.AaveV3ATokenAdaptorV1Calls{ + Calls: b.calls, + }, + }, + } +} + +func (b *AaveV3ATokenAdaptorV1CallBuilder) RevokeApproval(asset common.Address, spender common.Address) *AaveV3ATokenAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV3ATokenAdaptorV1{ + Function: &steward_proto.AaveV3ATokenAdaptorV1_RevokeApproval{ + RevokeApproval: &steward_proto.RevokeApproval{ + Asset: asset.Hex(), + Spender: spender.Hex(), + }, + }, + }) + + return b +} + +func (b *AaveV3ATokenAdaptorV1CallBuilder) DepositToAave(token common.Address, amount *big.Int) *AaveV3ATokenAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV3ATokenAdaptorV1{ + Function: &steward_proto.AaveV3ATokenAdaptorV1_DepositToAave_{ + DepositToAave: &steward_proto.AaveV3ATokenAdaptorV1_DepositToAave{ + Token: token.Hex(), + Amount: amount.String(), + }, + }, + }) + + return b +} + +func (b *AaveV3ATokenAdaptorV1CallBuilder) WithdrawFromAave(token common.Address, amount *big.Int) *AaveV3ATokenAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV3ATokenAdaptorV1{ + Function: &steward_proto.AaveV3ATokenAdaptorV1_WithdrawFromAave_{ + WithdrawFromAave: &steward_proto.AaveV3ATokenAdaptorV1_WithdrawFromAave{ + Token: token.Hex(), + Amount: amount.String(), + }, + }, + }) + + return b +} + +func (b *AaveV3ATokenAdaptorV1CallBuilder) AdjustIsolationModeAssetAsCollateral(asset common.Address, useAsCollateral bool) *AaveV3ATokenAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV3ATokenAdaptorV1{ + Function: &steward_proto.AaveV3ATokenAdaptorV1_AdjustIsolationModeAssetAsCollateral_{ + AdjustIsolationModeAssetAsCollateral: &steward_proto.AaveV3ATokenAdaptorV1_AdjustIsolationModeAssetAsCollateral{ + Asset: asset.Hex(), + UseAsCollateral: useAsCollateral, + }, + }, + }) + + return b +} + +func (b *AaveV3ATokenAdaptorV1CallBuilder) ChangeEMode(categoryId uint32) *AaveV3ATokenAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV3ATokenAdaptorV1{ + Function: &steward_proto.AaveV3ATokenAdaptorV1_ChangeEmode{ + ChangeEmode: &steward_proto.AaveV3ATokenAdaptorV1_ChangeEMode{ + CategoryId: categoryId, + }, + }, + }) + + return b +} diff --git a/go_request_builder/adaptors/aave_v3_debt_token.go b/go_request_builder/adaptors/aave_v3_debt_token.go new file mode 100644 index 00000000..7b2d660e --- /dev/null +++ b/go_request_builder/adaptors/aave_v3_debt_token.go @@ -0,0 +1,83 @@ +package adaptors + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/steward/steward_proto_go/steward_proto" +) + +type AaveV3DebtTokenAdaptorV1CallBuilder struct { + adaptor common.Address + calls []*steward_proto.AaveV3DebtTokenAdaptorV1 +} + +func NewAaveV3DebtTokenAdaptorV1CallBuilder(adaptor common.Address) *AaveV3DebtTokenAdaptorV1CallBuilder { + return &AaveV3DebtTokenAdaptorV1CallBuilder{ + adaptor: adaptor, + calls: make([]*steward_proto.AaveV3DebtTokenAdaptorV1, 0), + } +} + +func (b *AaveV3DebtTokenAdaptorV1CallBuilder) Build() *steward_proto.AdaptorCall { + return &steward_proto.AdaptorCall{ + Adaptor: b.adaptor.Hex(), + CallData: &steward_proto.AdaptorCall_AaveV3DebtTokenV1Calls{ + AaveV3DebtTokenV1Calls: &steward_proto.AaveV3DebtTokenAdaptorV1Calls{ + Calls: b.calls, + }, + }, + } +} + +func (b *AaveV3DebtTokenAdaptorV1CallBuilder) RevokeApproval(asset common.Address, spender common.Address) *AaveV3DebtTokenAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV3DebtTokenAdaptorV1{ + Function: &steward_proto.AaveV3DebtTokenAdaptorV1_RevokeApproval{ + RevokeApproval: &steward_proto.RevokeApproval{ + Asset: asset.Hex(), + Spender: spender.Hex(), + }, + }, + }) + + return b +} + +func (b *AaveV3DebtTokenAdaptorV1CallBuilder) BorrowFromAave(token common.Address, amount *big.Int) *AaveV3DebtTokenAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV3DebtTokenAdaptorV1{ + Function: &steward_proto.AaveV3DebtTokenAdaptorV1_BorrowFromAave_{ + BorrowFromAave: &steward_proto.AaveV3DebtTokenAdaptorV1_BorrowFromAave{ + Token: token.Hex(), + Amount: amount.String(), + }, + }, + }) + + return b +} + +func (b *AaveV3DebtTokenAdaptorV1CallBuilder) RepayAaveDebt(token common.Address, amount *big.Int) *AaveV3DebtTokenAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV3DebtTokenAdaptorV1{ + Function: &steward_proto.AaveV3DebtTokenAdaptorV1_RepayAaveDebt_{ + RepayAaveDebt: &steward_proto.AaveV3DebtTokenAdaptorV1_RepayAaveDebt{ + Token: token.Hex(), + Amount: amount.String(), + }, + }, + }) + + return b +} + +func (b *AaveV3DebtTokenAdaptorV1CallBuilder) RepayWithATokens(underlyingToken common.Address, amount *big.Int) *AaveV3DebtTokenAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.AaveV3DebtTokenAdaptorV1{ + Function: &steward_proto.AaveV3DebtTokenAdaptorV1_RepayWithATokens_{ + RepayWithATokens: &steward_proto.AaveV3DebtTokenAdaptorV1_RepayWithATokens{ + UnderlyingToken: underlyingToken.Hex(), + Amount: amount.String(), + }, + }, + }) + + return b +} diff --git a/go_request_builder/adaptors/aave_v3_debt_token_flash_loan.go b/go_request_builder/adaptors/aave_v3_debt_token_flash_loan.go new file mode 100644 index 00000000..7fe58020 --- /dev/null +++ b/go_request_builder/adaptors/aave_v3_debt_token_flash_loan.go @@ -0,0 +1,276 @@ +package adaptors + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/steward/steward_proto_go/steward_proto" +) + +// Builder +type AaveV3DebtTokenFlashLoanAdaptorV1CallBuilder struct { + adaptor common.Address + calls []*steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan +} + +// Constructor +func NewAaveV3DebtTokenFlashLoanAdaptorV1Call(adaptor common.Address) *AaveV3DebtTokenFlashLoanAdaptorV1CallBuilder { + return &AaveV3DebtTokenFlashLoanAdaptorV1CallBuilder{ + adaptor: adaptor, + } +} + +// Build +func (b *AaveV3DebtTokenFlashLoanAdaptorV1CallBuilder) Build() *steward_proto.AdaptorCall { + return &steward_proto.AdaptorCall{ + Adaptor: b.adaptor.Hex(), + CallData: &steward_proto.AdaptorCall_AaveV3DebtTokenV1FlashLoanCalls{ + AaveV3DebtTokenV1FlashLoanCalls: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoanCalls{ + Calls: b.calls, + }, + }, + } +} + +// FlashLoan +func (b *AaveV3DebtTokenFlashLoanAdaptorV1CallBuilder) FlashLoan(loanTokens []common.Address, loanAmounts []*big.Int, userData []*steward_proto.AdaptorCall) *AaveV3DebtTokenFlashLoanAdaptorV1CallBuilder { + // convert loan tokens to strings + loanTokensStr := make([]string, len(loanTokens)) + for i, token := range loanTokens { + loanTokensStr[i] = token.Hex() + } + loanAmountsStr := make([]string, len(loanAmounts)) + for i, amount := range loanAmounts { + loanAmountsStr[i] = amount.String() + } + converted := make([]*steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan, len(userData)) + for i, call := range userData { + converted[i] = convertToAaveV3FlashLoanAdaptorCall(call) + } + b.calls = append(b.calls, &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan{ + FlashLoan: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_FlashLoan{ + LoanTokens: loanTokensStr, + LoanAmounts: loanAmountsStr, + Params: converted, + }, + }) + + return b +} + +func convertToAaveV3FlashLoanAdaptorCall(call *steward_proto.AdaptorCall) *steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan { + switch a := call.CallData.(type) { + case *steward_proto.AdaptorCall_AaveATokenV2Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_AaveATokenV2Calls{ + AaveATokenV2Calls: a.AaveATokenV2Calls, + }, + } + case *steward_proto.AdaptorCall_AaveDebtTokenV2Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_AaveDebtTokenV2Calls{ + AaveDebtTokenV2Calls: a.AaveDebtTokenV2Calls, + }, + } + case *steward_proto.AdaptorCall_AaveV3ATokenV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_AaveV3ATokenV1Calls{ + AaveV3ATokenV1Calls: a.AaveV3ATokenV1Calls, + }, + } + case *steward_proto.AdaptorCall_CompoundCTokenV2Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_CompoundCTokenV2Calls{ + CompoundCTokenV2Calls: a.CompoundCTokenV2Calls, + }, + } + case *steward_proto.AdaptorCall_OneInchV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_OneInchV1Calls{ + OneInchV1Calls: a.OneInchV1Calls, + }, + } + case *steward_proto.AdaptorCall_FeesAndReservesV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_FeesAndReservesV1Calls{ + FeesAndReservesV1Calls: a.FeesAndReservesV1Calls, + }, + } + case *steward_proto.AdaptorCall_ZeroXV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_ZeroXV1Calls{ + ZeroXV1Calls: a.ZeroXV1Calls, + }, + } + case *steward_proto.AdaptorCall_SwapWithUniswapV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_SwapWithUniswapV1Calls{ + SwapWithUniswapV1Calls: a.SwapWithUniswapV1Calls, + }, + } + case *steward_proto.AdaptorCall_VestingSimpleV2Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_VestingSimpleV2Calls{ + VestingSimpleV2Calls: a.VestingSimpleV2Calls, + }, + } + case *steward_proto.AdaptorCall_CellarV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_CellarV1Calls{ + CellarV1Calls: a.CellarV1Calls, + }, + } + case *steward_proto.AdaptorCall_UniswapV3V2Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_UniswapV3V2Calls{ + UniswapV3V2Calls: a.UniswapV3V2Calls, + }, + } + case *steward_proto.AdaptorCall_AaveV2EnableAssetAsCollateralV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_AaveV2EnableAssetAsCollateralV1Calls{ + AaveV2EnableAssetAsCollateralV1Calls: a.AaveV2EnableAssetAsCollateralV1Calls, + }, + } + case *steward_proto.AdaptorCall_FTokenV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_FTokenV1Calls{ + FTokenV1Calls: a.FTokenV1Calls, + }, + } + case *steward_proto.AdaptorCall_MorphoAaveV2ATokenV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_MorphoAaveV2ATokenV1Calls{ + MorphoAaveV2ATokenV1Calls: a.MorphoAaveV2ATokenV1Calls, + }, + } + case *steward_proto.AdaptorCall_MorphoAaveV2DebtTokenV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_MorphoAaveV2DebtTokenV1Calls{ + MorphoAaveV2DebtTokenV1Calls: a.MorphoAaveV2DebtTokenV1Calls, + }, + } + case *steward_proto.AdaptorCall_MorphoAaveV3ATokenCollateralV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_MorphoAaveV3ATokenCollateralV1Calls{ + MorphoAaveV3ATokenCollateralV1Calls: a.MorphoAaveV3ATokenCollateralV1Calls, + }, + } + case *steward_proto.AdaptorCall_MorphoAaveV3ATokenP2PV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_MorphoAaveV3ATokenP2PV1Calls{ + MorphoAaveV3ATokenP2PV1Calls: a.MorphoAaveV3ATokenP2PV1Calls, + }, + } + case *steward_proto.AdaptorCall_MorphoAaveV3DebtTokenV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_MorphoAaveV3DebtTokenV1Calls{ + MorphoAaveV3DebtTokenV1Calls: a.MorphoAaveV3DebtTokenV1Calls, + }, + } + case *steward_proto.AdaptorCall_BalancerPoolV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_BalancerPoolV1Calls{ + BalancerPoolV1Calls: a.BalancerPoolV1Calls, + }, + } + case *steward_proto.AdaptorCall_LegacyCellarV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_LegacyCellarV1Calls{ + LegacyCellarV1Calls: a.LegacyCellarV1Calls, + }, + } + case *steward_proto.AdaptorCall_DebtFTokenV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_DebtFTokenV1Calls{ + DebtFTokenV1Calls: a.DebtFTokenV1Calls, + }, + } + case *steward_proto.AdaptorCall_CollateralFTokenV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_CollateralFTokenV1Calls{ + CollateralFTokenV1Calls: a.CollateralFTokenV1Calls, + }, + } + case *steward_proto.AdaptorCall_ConvexCurveV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_ConvexCurveV1Calls{ + ConvexCurveV1Calls: a.ConvexCurveV1Calls, + }, + } + case *steward_proto.AdaptorCall_CurveV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_CurveV1Calls{ + CurveV1Calls: a.CurveV1Calls, + }, + } + case *steward_proto.AdaptorCall_AuraErc4626V1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_AuraErc4626V1Calls{ + AuraErc4626V1Calls: a.AuraErc4626V1Calls, + }, + } + case *steward_proto.AdaptorCall_MorphoBlueCollateralV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_MorphoBlueCollateralV1Calls{ + MorphoBlueCollateralV1Calls: a.MorphoBlueCollateralV1Calls, + }, + } + case *steward_proto.AdaptorCall_MorphoBlueDebtV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_MorphoBlueDebtV1Calls{ + MorphoBlueDebtV1Calls: a.MorphoBlueDebtV1Calls, + }, + } + case *steward_proto.AdaptorCall_MorphoBlueSupplyV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_MorphoBlueSupplyV1Calls{ + MorphoBlueSupplyV1Calls: a.MorphoBlueSupplyV1Calls, + }, + } + case *steward_proto.AdaptorCall_Erc4626V1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_Erc4626V1Calls{ + Erc4626V1Calls: a.Erc4626V1Calls, + }, + } + case *steward_proto.AdaptorCall_StakingV1Calls: + return &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan{ + Adaptor: call.Adaptor, + CallData: &steward_proto.AaveV3DebtTokenAdaptorV1FlashLoan_AdaptorCallForAaveV3FlashLoan_StakingV1Calls{ + StakingV1Calls: a.StakingV1Calls, + }, + } + default: + return nil + } +} diff --git a/go_request_builder/adaptors/balancer_pool.go b/go_request_builder/adaptors/balancer_pool.go new file mode 100644 index 00000000..0f20a99c --- /dev/null +++ b/go_request_builder/adaptors/balancer_pool.go @@ -0,0 +1,199 @@ +package adaptors + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/steward/steward_proto_go/steward_proto" +) + +const ( + _ = iota + BalancerSwapKindGivenIn + BalancerSwapKindGivenOut +) + +type BalancerPoolAdaptorV1CallBuilder struct { + adaptor common.Address + calls []*steward_proto.BalancerPoolAdaptorV1 +} + +func NewBalancerPoolAdaptorV1CallBuilder(adaptor common.Address) *BalancerPoolAdaptorV1CallBuilder { + return &BalancerPoolAdaptorV1CallBuilder{ + adaptor: adaptor, + calls: make([]*steward_proto.BalancerPoolAdaptorV1, 0), + } +} + +func (b *BalancerPoolAdaptorV1CallBuilder) Build() *steward_proto.AdaptorCall { + return &steward_proto.AdaptorCall{ + Adaptor: b.adaptor.Hex(), + CallData: &steward_proto.AdaptorCall_BalancerPoolV1Calls{ + BalancerPoolV1Calls: &steward_proto.BalancerPoolAdaptorV1Calls{ + Calls: b.calls, + }, + }, + } +} + +func (b *BalancerPoolAdaptorV1CallBuilder) RevokeApproval(asset common.Address, spender common.Address) *BalancerPoolAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.BalancerPoolAdaptorV1{ + Function: &steward_proto.BalancerPoolAdaptorV1_RevokeApproval{ + RevokeApproval: &steward_proto.RevokeApproval{ + Asset: asset.Hex(), + Spender: spender.Hex(), + }, + }, + }) + + return b +} + +type SingleSwap struct { + poolId string + kind int + assetIn common.Address + assetOut common.Address + amount *big.Int + userData []byte +} + +type SwapData struct { + minAmountsForSwaps []*big.Int + swapDeadlines []*big.Int +} + +func (b *BalancerPoolAdaptorV1CallBuilder) JoinPool(targetBpt common.Address, swapsBeforeJoin []*SingleSwap, swapData SwapData, minimumBPT *big.Int) *BalancerPoolAdaptorV1CallBuilder { + singleSwaps := make([]*steward_proto.BalancerPoolAdaptorV1_SingleSwap, len(swapsBeforeJoin)) + for i, swap := range swapsBeforeJoin { + singleSwaps[i] = &steward_proto.BalancerPoolAdaptorV1_SingleSwap{ + PoolId: swap.poolId[:], + Kind: steward_proto.BalancerPoolAdaptorV1_SwapKind(swap.kind), + AssetIn: swap.assetIn.Hex(), + AssetOut: swap.assetOut.Hex(), + Amount: swap.amount.String(), + UserData: swap.userData, + } + } + data := &steward_proto.BalancerPoolAdaptorV1_SwapData{ + MinAmountsForSwaps: make([]string, len(swapData.minAmountsForSwaps)), + SwapDeadlines: make([]string, len(swapData.swapDeadlines)), + } + for i, amount := range swapData.minAmountsForSwaps { + data.MinAmountsForSwaps[i] = amount.String() + } + for i, deadline := range swapData.swapDeadlines { + data.SwapDeadlines[i] = deadline.String() + } + + b.calls = append(b.calls, &steward_proto.BalancerPoolAdaptorV1{ + Function: &steward_proto.BalancerPoolAdaptorV1_JoinPool_{ + JoinPool: &steward_proto.BalancerPoolAdaptorV1_JoinPool{ + TargetBpt: targetBpt.Hex(), + SwapsBeforeJoin: singleSwaps, + SwapData: data, + MinimumBpt: minimumBPT.String(), + }, + }, + }) + + return b +} + +type ExitPoolRequest struct { + assets []common.Address + minAmountsOut []big.Int + userData []byte + toInternalBalance bool +} + +func (b *BalancerPoolAdaptorV1CallBuilder) ExitPool(targetBpt common.Address, swapsAfterExit []*SingleSwap, swapData SwapData, exitRequest *ExitPoolRequest) *BalancerPoolAdaptorV1CallBuilder { + singleSwaps := make([]*steward_proto.BalancerPoolAdaptorV1_SingleSwap, len(swapsAfterExit)) + for i, swap := range swapsAfterExit { + singleSwaps[i] = &steward_proto.BalancerPoolAdaptorV1_SingleSwap{ + PoolId: swap.poolId[:], + Kind: steward_proto.BalancerPoolAdaptorV1_SwapKind(swap.kind), + AssetIn: swap.assetIn.Hex(), + AssetOut: swap.assetOut.Hex(), + Amount: swap.amount.String(), + UserData: swap.userData, + } + } + data := &steward_proto.BalancerPoolAdaptorV1_SwapData{ + MinAmountsForSwaps: make([]string, len(swapData.minAmountsForSwaps)), + SwapDeadlines: make([]string, len(swapData.swapDeadlines)), + } + for i, amount := range swapData.minAmountsForSwaps { + data.MinAmountsForSwaps[i] = amount.String() + } + for i, deadline := range swapData.swapDeadlines { + data.SwapDeadlines[i] = deadline.String() + } + + assets := make([]string, len(exitRequest.assets)) + minAmountsOut := make([]string, len(exitRequest.minAmountsOut)) + for i, asset := range exitRequest.assets { + assets[i] = asset.Hex() + } + for i, amount := range exitRequest.minAmountsOut { + minAmountsOut[i] = amount.String() + } + + b.calls = append(b.calls, &steward_proto.BalancerPoolAdaptorV1{ + Function: &steward_proto.BalancerPoolAdaptorV1_ExitPool_{ + ExitPool: &steward_proto.BalancerPoolAdaptorV1_ExitPool{ + TargetBpt: targetBpt.Hex(), + SwapsAfterExit: singleSwaps, + SwapData: data, + Request: &steward_proto.BalancerPoolAdaptorV1_ExitPoolRequest{ + Assets: assets, + MinAmountsOut: minAmountsOut, + UserData: exitRequest.userData, + ToInternalBalance: exitRequest.toInternalBalance, + }, + }, + }, + }) + + return b +} + +func (b *BalancerPoolAdaptorV1CallBuilder) StakeBpt(bpt common.Address, liquidityGauge common.Address, amountIn *big.Int) *BalancerPoolAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.BalancerPoolAdaptorV1{ + Function: &steward_proto.BalancerPoolAdaptorV1_StakeBpt{ + StakeBpt: &steward_proto.BalancerPoolAdaptorV1_StakeBPT{ + Bpt: bpt.Hex(), + LiquidityGauge: liquidityGauge.Hex(), + AmountIn: amountIn.String(), + }, + }, + }) + + return b +} + +func (b *BalancerPoolAdaptorV1CallBuilder) UnstakeBpt(bpt common.Address, liquidityGauge common.Address, amountOut *big.Int) *BalancerPoolAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.BalancerPoolAdaptorV1{ + Function: &steward_proto.BalancerPoolAdaptorV1_UnstakeBpt{ + UnstakeBpt: &steward_proto.BalancerPoolAdaptorV1_UnstakeBPT{ + Bpt: bpt.Hex(), + LiquidityGauge: liquidityGauge.Hex(), + AmountOut: amountOut.String(), + }, + }, + }) + + return b +} + +func (b *BalancerPoolAdaptorV1CallBuilder) ClaimRewards(gauge common.Address) *BalancerPoolAdaptorV1CallBuilder { + b.calls = append(b.calls, &steward_proto.BalancerPoolAdaptorV1{ + Function: &steward_proto.BalancerPoolAdaptorV1_ClaimRewards_{ + ClaimRewards: &steward_proto.BalancerPoolAdaptorV1_ClaimRewards{ + Gauge: gauge.Hex(), + }, + }, + }) + + return b +} diff --git a/go_request_builder/adaptors/pendle.go b/go_request_builder/adaptors/pendle.go new file mode 100644 index 00000000..06584cda --- /dev/null +++ b/go_request_builder/adaptors/pendle.go @@ -0,0 +1,17 @@ +package adaptors + +import ( + "github.com/ethereum/go-ethereum/common" +) + +// Builder +type PendleAdaptorCallBuilder struct { + adaptor common.Address +} + +// Constructor +func NewPendleAdaptorCall(adaptor common.Address) *PendleAdaptorCallBuilder { + return &PendleAdaptorCallBuilder{ + adaptor: adaptor, + } +} diff --git a/go_request_builder/adaptors/swap_with_uniswap.go b/go_request_builder/adaptors/swap_with_uniswap.go new file mode 100644 index 00000000..cbac7d55 --- /dev/null +++ b/go_request_builder/adaptors/swap_with_uniswap.go @@ -0,0 +1,71 @@ +package adaptors + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/steward/steward_proto_go/steward_proto" +) + +// Builder for SwapWithUniswapAdaptorV1 +type SwapWithUniswapAdaptorV1CallBuilder struct { + adaptor common.Address + calls []*steward_proto.SwapWithUniswapAdaptorV1 +} + +// NewSwapWithUniswapAdaptorV1CallBuilder creates a new SwapWithUniswapAdaptorV1CallBuilder +func NewSwapWithUniswapAdaptorV1CallBuilder(adaptor common.Address) *SwapWithUniswapAdaptorV1CallBuilder { + return &SwapWithUniswapAdaptorV1CallBuilder{ + adaptor: adaptor, + calls: make([]*steward_proto.SwapWithUniswapAdaptorV1, 0), + } +} + +// Build builds the AdaptorCall +func (b *SwapWithUniswapAdaptorV1CallBuilder) Build() *steward_proto.AdaptorCall { + return &steward_proto.AdaptorCall{ + Adaptor: b.adaptor.Hex(), + CallData: &steward_proto.AdaptorCall_SwapWithUniswapV1Calls{ + SwapWithUniswapV1Calls: &steward_proto.SwapWithUniswapAdaptorV1Calls{ + Calls: b.calls, + }, + }, + } +} + +func (b *SwapWithUniswapAdaptorV1CallBuilder) SwapWithUniV2(path []common.Address, amount *big.Int, amountOutMin *big.Int) *SwapWithUniswapAdaptorV1CallBuilder { + pathStrs := make([]string, 0) + for _, addr := range path { + pathStrs = append(pathStrs, addr.Hex()) + } + b.calls = append(b.calls, &steward_proto.SwapWithUniswapAdaptorV1{ + Function: &steward_proto.SwapWithUniswapAdaptorV1_SwapWithUniV2_{ + SwapWithUniV2: &steward_proto.SwapWithUniswapAdaptorV1_SwapWithUniV2{ + Path: pathStrs, + Amount: amount.String(), + AmountOutMin: amountOutMin.String(), + }, + }, + }) + + return b +} + +func (b *SwapWithUniswapAdaptorV1CallBuilder) SwapWithUniV3(path []common.Address, poolFees []uint32, amount *big.Int, amountOutMin *big.Int) *SwapWithUniswapAdaptorV1CallBuilder { + pathStrs := make([]string, 0) + for _, addr := range path { + pathStrs = append(pathStrs, addr.Hex()) + } + b.calls = append(b.calls, &steward_proto.SwapWithUniswapAdaptorV1{ + Function: &steward_proto.SwapWithUniswapAdaptorV1_SwapWithUniV3_{ + SwapWithUniV3: &steward_proto.SwapWithUniswapAdaptorV1_SwapWithUniV3{ + Path: pathStrs, + PoolFees: poolFees, + Amount: amount.String(), + AmountOutMin: amountOutMin.String(), + }, + }, + }) + + return b +} diff --git a/go_request_builder/cellar_call.go b/go_request_builder/cellar_call.go new file mode 100644 index 00000000..4bfee847 --- /dev/null +++ b/go_request_builder/cellar_call.go @@ -0,0 +1,291 @@ +package builder + +import ( + "fmt" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/steward/steward_proto_go/steward_proto" +) + +type CellarCallBuilder struct { + functionCalls []*steward_proto.CellarV2_5_FunctionCall +} + +func NewCallDataBuilder() *CellarCallBuilder { + return &CellarCallBuilder{ + functionCalls: make([]*steward_proto.CellarV2_5_FunctionCall, 0), + } +} + +func (cdb *CellarCallBuilder) Build() (*steward_proto.CellarV2_5, error) { + if len(cdb.functionCalls) == 0 { + return nil, fmt.Errorf("no function calls added to CallDataBuilder") + } else if len(cdb.functionCalls) == 1 { + return &steward_proto.CellarV2_5 { + CallType: &steward_proto.CellarV2_5_FunctionCall_ { + FunctionCall: cdb.functionCalls[0], + }, + }, nil + } else { + return &steward_proto.CellarV2_5 { + CallType: &steward_proto.CellarV2_5_Multicall_ { + Multicall: &steward_proto.CellarV2_5_Multicall{ + FunctionCalls: cdb.functionCalls, + }, + }, + }, nil + } +} + +// CallOnAdaptor adds call data for the CallOnAdaptor function to the builder +func (cdb *CellarCallBuilder) CallOnAdaptor(adaptorCall *steward_proto.AdaptorCall) *CellarCallBuilder { + // search functionCalls for type steward_proto.CellarV2_5_FunctionCall_CallOnAdaptor and if + // it already exists, append to CallOnAdaptor.Data instead of creating a new CallOnAdaptor struct + found := false + for _, call := range cdb.functionCalls { + if call.GetCallOnAdaptor() != nil { + found = true + call.GetCallOnAdaptor().Data = append(call.GetCallOnAdaptor().Data, adaptorCall) + break + } + } + + if !found { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_CallOnAdaptor { + CallOnAdaptor: &steward_proto.CellarV2_5_CallOnAdaptor{ + Data: []*steward_proto.AdaptorCall{adaptorCall}, + }, + }, + }) + } + + return cdb +} + +// AddPosition adds call data for the AddPosition function to the builder +func (cdb *CellarCallBuilder) AddPosition(index uint32, positionId uint32, configurationData []byte, inDebtArray bool) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_AddPosition { + AddPosition: &steward_proto.CellarV2_5_AddPosition{ + Index: index, + PositionId: positionId, + ConfigurationData: configurationData, + InDebtArray: inDebtArray, + }, + }, + }) + + return cdb +} + +// RemovePosition adds call data for the RemovePosition function to the builder +func (cdb *CellarCallBuilder) RemovePosition(index uint32, inDebtArray bool) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_RemovePosition { + RemovePosition: &steward_proto.CellarV2_5_RemovePosition{ + Index: index, + InDebtArray: inDebtArray, + }, + }, + }) + + return cdb +} + +// SetHoldingPosition adds call data for the SetHoldingPosition function to the builder +func (cdb *CellarCallBuilder) SetHoldingPosition(positionId uint32) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_SetHoldingPosition { + SetHoldingPosition: &steward_proto.CellarV2_5_SetHoldingPosition{ + PositionId: positionId, + }, + }, + }) + + return cdb +} + +// SetStrategistPayoutAddress adds call data for the SetStrategistPayoutAddress function to the builder +func (cdb *CellarCallBuilder) SetStrategistPayoutAddress(payout common.Address) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_SetStrategistPayoutAddress { + SetStrategistPayoutAddress: &steward_proto.CellarV2_5_SetStrategistPayoutAddress{ + Payout: payout.Hex(), + }, + }, + }) + + return cdb +} + +// SwapPositions adds call data for the SwapPositions function to the builder +func (cdb *CellarCallBuilder) SwapPositions(index1, index2 uint32, inDebtArray bool) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_SwapPositions { + SwapPositions: &steward_proto.CellarV2_5_SwapPositions{ + Index_1: index1, + Index_2: index2, + InDebtArray: inDebtArray, + }, + }, + }) + + return cdb +} + +// SetShareLockPeriod adds call data for the SetShareLockPeriod function to the builder +func (cdb *CellarCallBuilder) SetShareLockPeriod(newLock big.Int) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_SetShareLockPeriod { + SetShareLockPeriod: &steward_proto.CellarV2_5_SetShareLockPeriod{ + NewLock: newLock.String(), + }, + }, + }) + + return cdb +} + +// InitiateShutdown adds call data for the InitiateShutdown function to the builder +func (cdb *CellarCallBuilder) InitiateShutdown() *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_InitiateShutdown { + InitiateShutdown: &steward_proto.CellarV2_5_InitiateShutdown{}, + }, + }) + + return cdb +} + +// LiftShutdown adds call data for the LiftShutdown function to the builder +func (cdb *CellarCallBuilder) LiftShutdown() *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_LiftShutdown { + LiftShutdown: &steward_proto.CellarV2_5_LiftShutdown{}, + }, + }) + + return cdb +} + +// RemoveAdaptorFromCatalogue adds call data for the RemoveAdaptorFromCatalogue function to the builder +func (cdb *CellarCallBuilder) RemoveAdaptorFromCatalogue(adaptor common.Address) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_RemoveAdaptorFromCatalogue { + RemoveAdaptorFromCatalogue: &steward_proto.CellarV2_5_RemoveAdaptorFromCatalogue{ + Adaptor: adaptor.Hex(), + }, + }, + }) + + return cdb +} + +// RemovePositionFromCatalogue adds call data for the RemovePositionFromCatalogue function to the builder +func (cdb *CellarCallBuilder) RemovePositionFromCatalogue(positionId uint32) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_RemovePositionFromCatalogue { + RemovePositionFromCatalogue: &steward_proto.CellarV2_5_RemovePositionFromCatalogue{ + PositionId: positionId, + }, + }, + }) + + return cdb +} + +// DecreaseShareSupplyCap adds call data for the DecreaseShareSupplyCap function to the builder +func (cdb *CellarCallBuilder) DecreaseShareSupplyCap(newCap big.Int) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_DecreaseShareSupplyCap { + DecreaseShareSupplyCap: &steward_proto.CellarV2_5_DecreaseShareSupplyCap{ + NewCap: newCap.String(), + }, + }, + }) + + return cdb +} + +// AddPositionToCatalogue adds call data for the AddPositionToCatalogue function to the builder +func (cdb *CellarCallBuilder) AddPositionToCatalogue(positionId uint32) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_AddPositionToCatalogue { + AddPositionToCatalogue: &steward_proto.CellarV2_5_AddPositionToCatalogue{ + PositionId: positionId, + }, + }, + }) + + return cdb +} + +// SetRebalanceDeviation adds call data for the SetRebalanceDeviation function to the builder +func (cdb *CellarCallBuilder) SetRebalanceDeviation(newDeviation big.Int) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_SetRebalanceDeviation { + SetRebalanceDeviation: &steward_proto.CellarV2_5_SetRebalanceDeviation{ + NewDeviation: newDeviation.String(), + }, + }, + }) + + return cdb +} + +// SetStrategistPlatformCut adds call data for the SetStrategistPlatformCut function to the builder +func (cdb *CellarCallBuilder) SetStrategistPlatformCut(newCut uint64) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_SetStrategistPlatformCut { + SetStrategistPlatformCut: &steward_proto.CellarV2_5_SetStrategistPlatformCut{ + NewCut: newCut, + }, + }, + }) + + return cdb +} + +// IncreaseShareSupplyCap adds call data for the IncreaseShareSupplyCap function to the builder +func (cdb *CellarCallBuilder) IncreaseShareSupplyCap(newCap big.Int) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_IncreaseShareSupplyCap { + IncreaseShareSupplyCap: &steward_proto.CellarV2_5_IncreaseShareSupplyCap{ + NewCap: newCap.String(), + }, + }, + }) + + return cdb +} + +// SetSharePriceOracle adds call data for the SetSharePriceOracle function to the builder +func (cdb *CellarCallBuilder) SetSharePriceOracle(registryId big.Int, sharePriceOracle common.Address) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_SetSharePriceOracle { + SetSharePriceOracle: &steward_proto.CellarV2_5_SetSharePriceOracle{ + RegistryId: registryId.String(), + SharePriceOracle: sharePriceOracle.Hex(), + }, + }, + }) + + return cdb +} + +// CachePriceRouter adds call data for the CachePriceRouter function to the builder +func (cdb *CellarCallBuilder) CachePriceRouter(checkTotalAssets bool, allowableRange uint32, expectedPriceRouter common.Address) *CellarCallBuilder { + cdb.functionCalls = append(cdb.functionCalls, &steward_proto.CellarV2_5_FunctionCall{ + Function: &steward_proto.CellarV2_5_FunctionCall_CachePriceRouter { + CachePriceRouter: &steward_proto.CellarV2_5_CachePriceRouter{ + CheckTotalAssets: checkTotalAssets, + AllowableRange: allowableRange, + ExpectedPriceRouter: expectedPriceRouter.Hex(), + }, + }, + }) + + return cdb +} diff --git a/go_request_builder/go.mod b/go_request_builder/go.mod new file mode 100644 index 00000000..c204f4ee --- /dev/null +++ b/go_request_builder/go.mod @@ -0,0 +1,25 @@ +module github.com/peggyjv/steward/go_request_builder + +go 1.22 + +require ( + github.com/ethereum/go-ethereum v1.14.5 + github.com/peggyjv/steward/steward_proto_go/steward_proto v0.1.0 + github.com/stretchr/testify v1.8.4 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/holiman/uint256 v1.2.4 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/grpc v1.64.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace github.com/peggyjv/steward/steward_proto_go/steward_proto => ../steward_proto_go/steward_proto diff --git a/go_request_builder/go.sum b/go_request_builder/go.sum new file mode 100644 index 00000000..f3ee4fb3 --- /dev/null +++ b/go_request_builder/go.sum @@ -0,0 +1,30 @@ +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/ethereum/go-ethereum v1.14.5 h1:szuFzO1MhJmweXjoM5nSAeDvjNUH3vIQoMzzQnfvjpw= +github.com/ethereum/go-ethereum v1.14.5/go.mod h1:VEDGGhSxY7IEjn98hJRFXl/uFvpRgbIIf2PpXiyGGgc= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/go_request_builder/request.go b/go_request_builder/request.go new file mode 100644 index 00000000..3f028a4b --- /dev/null +++ b/go_request_builder/request.go @@ -0,0 +1,77 @@ +package builder + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/common" + "github.com/peggyjv/steward/steward_proto_go/steward_proto" +) + +type ScheduleRequestBuilder struct { + cellarID string + chainID int + callData *steward_proto.CellarV2_5 + blockHeight int + deadline int +} + +func NewScheduleRequestBuilder() *ScheduleRequestBuilder { + return &ScheduleRequestBuilder{} +} + +func (b *ScheduleRequestBuilder) Build() (*steward_proto.ScheduleRequest, error) { + if err := b.Validate(); err != nil { + return nil, err + } + + return &steward_proto.ScheduleRequest { + CellarId: b.cellarID, + ChainId: uint64(b.chainID), + CallData: &steward_proto.ScheduleRequest_CellarV2_5 { + CellarV2_5: b.callData, + }, + BlockHeight: uint64(b.blockHeight), + Deadline: uint64(b.deadline), + }, nil +} + +func (b *ScheduleRequestBuilder) Validate() error { + if b.chainID == 0 { + return fmt.Errorf("chain ID cannot be zero") + } + if b.blockHeight == 0 || b.blockHeight < 0 { + return fmt.Errorf("block height must be greater than zero") + } + if b.deadline < 0 { + return fmt.Errorf("deadline must be zero or positive") + } + + return nil +} + +func (b *ScheduleRequestBuilder) WithCellarID(cellarID common.Address) *ScheduleRequestBuilder { + b.cellarID = cellarID.Hex() + return b +} + +func (b *ScheduleRequestBuilder) WithChainID(chainID int) *ScheduleRequestBuilder { + b.chainID = chainID + return b +} + +func (b *ScheduleRequestBuilder) WithBlockHeight(blockHeight int) *ScheduleRequestBuilder { + b.blockHeight = blockHeight + return b +} + +func (b *ScheduleRequestBuilder) WithCallData(callData *steward_proto.CellarV2_5) *ScheduleRequestBuilder { + b.callData = callData + return b +} + +func (b *ScheduleRequestBuilder) WithDeadline(deadline int) *ScheduleRequestBuilder { + b.deadline = deadline + return b +} + + diff --git a/steward_proto_go/steward_proto/go.mod b/steward_proto_go/steward_proto/go.mod new file mode 100644 index 00000000..40f37b4f --- /dev/null +++ b/steward_proto_go/steward_proto/go.mod @@ -0,0 +1,15 @@ +module github.com/peggyjv/steward/steward_proto_go/steward_proto + +go 1.22 + +require ( + google.golang.org/grpc v1.64.0 + google.golang.org/protobuf v1.34.2 +) + +require ( + golang.org/x/net v0.22.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect +) diff --git a/steward_proto_go/steward_proto/go.sum b/steward_proto_go/steward_proto/go.sum new file mode 100644 index 00000000..9240e224 --- /dev/null +++ b/steward_proto_go/steward_proto/go.sum @@ -0,0 +1,14 @@ +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=