From 1820139a0946853c205ac370267ae5d41414b127 Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Mon, 26 Dec 2022 17:04:12 +0700 Subject: [PATCH 01/12] Add badge status --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 99fd4a9c..33995a0d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Aura +[![go-test](https://github.com/aura-nw/aura/actions/workflows/test.yml/badge.svg)](https://github.com/aura-nw/aura/actions/workflows/test.yml) +[![golangci-lint](https://github.com/aura-nw/aura/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/aura-nw/aura/actions/workflows/golangci-lint.yml) This repository contains source code for Aurad (Aura Daemon). Aurad binary is the official client for Aura Network. Aurad is built using Cosmos SDK From 69bc2f7fca8248cf18658f706a4d92456f57d9f1 Mon Sep 17 00:00:00 2001 From: Hai Tien Date: Wed, 28 Dec 2022 10:58:28 +0700 Subject: [PATCH 02/12] Add distribution doc --- x/distribution/README.md | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 x/distribution/README.md diff --git a/x/distribution/README.md b/x/distribution/README.md new file mode 100644 index 00000000..3cb3ec1d --- /dev/null +++ b/x/distribution/README.md @@ -0,0 +1,71 @@ +# Module `x/distribution` + +## **Overview** + +The purpose of `distribution` module is responsible for distributing rewards between validators and delegators per `epoch` (`epoch` define on-chain timers, that execute fixed time interval). Additionally, the distribution module defines the community pool, which is a pool of funds under the control of on-chain governance. + +The module in `aura` has 4 parameters that may be modified by governance proposal. + +``` + 1. communitytax: 0.02 + 2. baseproposerreward: 0.04 + 3. bonusproposerreward: 0.01 + 4. withdrawaddrenabled: true +``` + +## **Content** + +1. Concepts +2. State +3. Parameters +4. Query +5. Keeper +6. Hooks + + + + +### **1. Concepts** + +Each validator has the opportunity to charge delegators commission on the rewards collected on behalf of the delegators. Fees are collected directly into a global reward pool and a validator proposer reward pool. Due to the nature of passive accounting, whenever changes to parameters which affect the rate of reward distribution occur, withdrawal of rewards must also occur. + +**Formula**: + +At epoch `e`, suppose there are `n` blocks with `v` validators (it means have `n` validator is proposer, `n < v`) and collects a total `T` in fees. + +First a `communitytax` is applied. The fee go to the community pool (aka reserve pool). Reserve pool's funds can be allocated through governance to fund bouties and upgrades. + +Let `R` is reward for each validator received in the epoch `e`. + +We have: +``` +v*R + (baseproposerreward + bonusproposerreward)*R = T +``` + +$$=>R = {T \over (v + baseproposerreward + bonusproposerreward)}$$ + +So + +* For the proposer validator: + + The pool obtains `VR = R + R * (baseproposerreward + bonusproposerreward)` + + `commision = VR * (1-self_bonded) * commission_rate` + + Validator's reward: `VR * self_bonded + commission` + + Delegator's reward: `VR * (1-self_bonded) - commission` + +* For the non-proposer validator: + + The pool obtains `NVR = R` + + `commision = NVR * (1-self_bonded) * commission_rate` + + Validator's reward: `NVR * self_bonded + commission` + + Delegator's reward: `NVR * (1-self_bonded) - commission` + + + + From 5f1ab5dfa77f8567fbb2bdcb6e1d6e6801ca872c Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Wed, 28 Dec 2022 17:50:19 +0700 Subject: [PATCH 03/12] Fix distribute rewards for non-proposer occur in many block --- x/distribution/README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/x/distribution/README.md b/x/distribution/README.md index 3cb3ec1d..069cb49c 100644 --- a/x/distribution/README.md +++ b/x/distribution/README.md @@ -33,16 +33,29 @@ Each validator has the opportunity to charge delegators commission on the reward At epoch `e`, suppose there are `n` blocks with `v` validators (it means have `n` validator is proposer, `n < v`) and collects a total `T` in fees. +A validator participate in epoch has define by struct + +``` +ValidatorInfo { + proposer_blocks: int + active_blocks: int + power: int +} + +``` + +So validator `Vi` is participate `Mi = active_blocks - proposer_blocks` times on epoch as non-proposer + First a `communitytax` is applied. The fee go to the community pool (aka reserve pool). Reserve pool's funds can be allocated through governance to fund bouties and upgrades. Let `R` is reward for each validator received in the epoch `e`. We have: ``` -v*R + (baseproposerreward + bonusproposerreward)*R = T +n * [R + (baseproposerreward + bonusproposerreward) * R] + Sum(Mi) * R = T ``` -$$=>R = {T \over (v + baseproposerreward + bonusproposerreward)}$$ +$$=>R = {T \over [n + n*(baseproposerreward + bonusproposerreward) + Sum(Mi)]}$$ So @@ -67,5 +80,9 @@ So Delegator's reward: `NVR * (1-self_bonded) - commission` +Notes: + +* All fees are distributed among all the bonded validators, in proportion to their consensus power. + From 9c3007f4a69c078af03d3bfd938911d0359d2a29 Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Fri, 30 Dec 2022 17:58:16 +0700 Subject: [PATCH 04/12] wip: add distribution by epoch --- .gitignore | 1 + go.mod | 14 +- go.sum | 20 +- proto/distribution/epoch_vote_info.proto | 20 + x/distribution/abci.go | 17 + x/distribution/keeper/allocation.go | 114 ++++ x/distribution/keeper/allocation_test.go | 1 + x/distribution/keeper/keeper.go | 38 ++ x/distribution/keeper/keeper_test.go | 1 + x/distribution/keeper/store.go | 25 + x/distribution/module.go | 78 +++ x/distribution/types/codec.go | 6 + x/distribution/types/epoch_vote_info.pb.go | 617 +++++++++++++++++++++ x/distribution/types/expected_keepers.go | 41 ++ x/distribution/types/keys.go | 5 + 15 files changed, 981 insertions(+), 17 deletions(-) create mode 100644 proto/distribution/epoch_vote_info.proto create mode 100644 x/distribution/abci.go create mode 100644 x/distribution/keeper/allocation.go create mode 100644 x/distribution/keeper/allocation_test.go create mode 100644 x/distribution/keeper/keeper.go create mode 100644 x/distribution/keeper/keeper_test.go create mode 100644 x/distribution/keeper/store.go create mode 100644 x/distribution/module.go create mode 100644 x/distribution/types/codec.go create mode 100644 x/distribution/types/epoch_vote_info.pb.go create mode 100644 x/distribution/types/expected_keepers.go create mode 100644 x/distribution/types/keys.go diff --git a/.gitignore b/.gitignore index 5b2d3923..dcf8e8b1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ vue/dist release/ .idea config.yml +build \ No newline at end of file diff --git a/go.mod b/go.mod index 5fa12189..1fdceba0 100644 --- a/go.mod +++ b/go.mod @@ -16,8 +16,8 @@ require ( github.com/tendermint/starport v0.19.2 github.com/tendermint/tendermint v0.34.21 github.com/tendermint/tm-db v0.6.7 - google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 - google.golang.org/grpc v1.50.1 + google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 + google.golang.org/grpc v1.51.0 google.golang.org/protobuf v1.28.1 ) @@ -113,11 +113,10 @@ require ( github.com/zondax/hid v0.9.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect - golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.2.0 // indirect - golang.org/x/sys v0.2.0 // indirect - golang.org/x/term v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/net v0.3.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/term v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect @@ -129,6 +128,7 @@ require ( github.com/golang/protobuf v1.5.2 github.com/pkg/errors v0.9.1 github.com/regen-network/cosmos-proto v0.3.1 + golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index d41f08f9..f2897745 100644 --- a/go.sum +++ b/go.sum @@ -1722,8 +1722,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= 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= @@ -1867,14 +1867,14 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= 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= @@ -1884,8 +1884,8 @@ 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.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 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= @@ -2094,8 +2094,8 @@ google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaE google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 h1:jCw9YRd2s40X9Vxi4zKsPRvSPlHWNqadVkpbMsCPzPQ= -google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 h1:jmIfw8+gSvXcZSgaFAGyInDXeWzUhvYH57G/5GKMn70= +google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/proto/distribution/epoch_vote_info.proto b/proto/distribution/epoch_vote_info.proto new file mode 100644 index 00000000..1c85778a --- /dev/null +++ b/proto/distribution/epoch_vote_info.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package auranw.aura.distribution; + +import "tendermint/abci/types.proto"; +import "gogoproto/gogo.proto"; + + +option go_package = "github.com/aura-nw/aura/x/distribution/types"; + +message EpochVoteInfo { + tendermint.abci.Validator validator = 1 [(gogoproto.nullable) = false]; + int64 proposer_blocks = 2; + int64 active_blocks = 3; + int64 total_power = 4; +} + +message ListEpochVoteInfo { + repeated EpochVoteInfo list_epoch_vote_info = 1; +} diff --git a/x/distribution/abci.go b/x/distribution/abci.go new file mode 100644 index 00000000..0e5332a2 --- /dev/null +++ b/x/distribution/abci.go @@ -0,0 +1,17 @@ +package distribution + +import ( + customdistkeeper "github.com/aura-nw/aura/x/distribution/keeper" + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/distribution/types" + abci "github.com/tendermint/tendermint/abci/types" + "time" +) + +// BeginBlocker sets the proposer for determining distribution during endblock +// and distribute rewards for the previous block +func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k customdistkeeper.Keeper) { + defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + +} diff --git a/x/distribution/keeper/allocation.go b/x/distribution/keeper/allocation.go new file mode 100644 index 00000000..a86e5087 --- /dev/null +++ b/x/distribution/keeper/allocation.go @@ -0,0 +1,114 @@ +package keeper + +import ( + "github.com/aura-nw/aura/x/distribution/types" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// AllocateTokens handles distribution of the collected fees on one epoch +func (k Keeper) AllocateTokens( + ctx sdk.Context, + numberBlocks int64, + totalPreviousPower int64, + bondedEpochVotes []types.EpochVoteInfo, +) { + logger := k.Logger(ctx) + + // get total fees in epoch + feeCollector := k.authKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName) + feesCollectedInt := k.bankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()) + feesCollected := sdk.NewDecCoinsFromCoins(feesCollectedInt...) + + logger.Info("feesCollected = ", feesCollected) + + // transfer collected fees to the distribution module account + err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, authtypes.FeeCollectorName, disttypes.ModuleName, feesCollectedInt) + if err != nil { + panic(err) + } + + feePool := k.GetFeePool(ctx) + if totalPreviousPower == 0 { + logger.Info("No previous power") + feePool.CommunityPool = feePool.CommunityPool.Add(feesCollected...) + k.SetFeePool(ctx, feePool) + return + } + + // get reward config + baseProposerReward := k.GetBaseProposerReward(ctx) + bonusProposerReward := k.GetBonusProposerReward(ctx) + proposerMultiplier := baseProposerReward.Add(bonusProposerReward) + + communityTax := k.GetCommunityTax(ctx) + feeCommunityTax := feesCollected.MulDecTruncate(communityTax) + feePool.CommunityPool = feePool.CommunityPool.Add(feeCommunityTax...) + feesCollectedAfterTax := feesCollected.Sub(feeCommunityTax) + + var parts int64 + for _, voteInfo := range bondedEpochVotes { + parts += voteInfo.ActiveBlocks - voteInfo.ProposerBlocks + } + + dec := sdk.NewDec(parts).Add(sdk.NewDec(numberBlocks).Mul(proposerMultiplier.Add(sdk.OneDec()))) + rewardUnit := feesCollectedAfterTax.MulDecTruncate(dec) + + remaining := feesCollectedAfterTax + + for _, voteInfo := range bondedEpochVotes { + validator := k.stakingKeeper.ValidatorByConsAddr(ctx, voteInfo.Validator.Address) + + // Rewards for proposer + proposerReward := rewardUnit.MulDecTruncate(proposerMultiplier.Add(sdk.OneDec())).MulDecTruncate(sdk.NewDec(voteInfo.ProposerBlocks)) + + // Rewards for non-proposer + nonProposerReward := rewardUnit.MulDec(sdk.NewDec(voteInfo.ActiveBlocks - voteInfo.ProposerBlocks)) + + reward := proposerReward.Add(nonProposerReward...) + + k.AllocateTokensToValidator(ctx, validator, reward) + remaining = remaining.Sub(reward) + } + + feePool.CommunityPool = feePool.CommunityPool.Add(remaining...) + k.SetFeePool(ctx, feePool) +} + +func (k Keeper) AllocateTokensToValidatorAndDelegator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins) { + // split tokens between validator and delegators according to commission + commission := tokens.MulDec(val.GetCommission()) + shared := tokens.Sub(commission) + + // update current commission + ctx.EventManager().EmitEvent( + sdk.NewEvent( + disttypes.EventTypeCommission, + sdk.NewAttribute(sdk.AttributeKeyAmount, commission.String()), + sdk.NewAttribute(disttypes.AttributeKeyValidator, val.GetOperator().String()), + ), + ) + currentCommission := k.GetValidatorAccumulatedCommission(ctx, val.GetOperator()) + currentCommission.Commission = currentCommission.Commission.Add(commission...) + k.SetValidatorAccumulatedCommission(ctx, val.GetOperator(), currentCommission) + + // update current rewards + currentRewards := k.GetValidatorCurrentRewards(ctx, val.GetOperator()) + currentRewards.Rewards = currentRewards.Rewards.Add(shared...) + k.SetValidatorCurrentRewards(ctx, val.GetOperator(), currentRewards) + + // update outstanding rewards + ctx.EventManager().EmitEvent( + sdk.NewEvent( + disttypes.EventTypeRewards, + sdk.NewAttribute(sdk.AttributeKeyAmount, tokens.String()), + sdk.NewAttribute(disttypes.AttributeKeyValidator, val.GetOperator().String()), + ), + ) + + outstanding := k.GetValidatorOutstandingRewards(ctx, val.GetOperator()) + outstanding.Rewards = outstanding.Rewards.Add(tokens...) + k.SetValidatorOutstandingRewards(ctx, val.GetOperator(), outstanding) +} diff --git a/x/distribution/keeper/allocation_test.go b/x/distribution/keeper/allocation_test.go new file mode 100644 index 00000000..94292649 --- /dev/null +++ b/x/distribution/keeper/allocation_test.go @@ -0,0 +1 @@ +package keeper_test diff --git a/x/distribution/keeper/keeper.go b/x/distribution/keeper/keeper.go new file mode 100644 index 00000000..7e0d1b33 --- /dev/null +++ b/x/distribution/keeper/keeper.go @@ -0,0 +1,38 @@ +package keeper + +import ( + "github.com/aura-nw/aura/x/distribution/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + distkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/tendermint/tendermint/libs/log" +) + +type Keeper struct { + storeKey sdk.StoreKey + cdc codec.BinaryCodec + distkeeper.Keeper + authKeeper types.AccountKeeper + bankKeeper types.BankKeeper + stakingKeeper types.StakingKeeper +} + +func NewKeeper(cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Subspace, + ak types.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, + feeCollectorName string, blockedAddrs map[string]bool) Keeper { + baseKeeper := distkeeper.NewKeeper(cdc, key, paramSpace, ak, bk, sk, feeCollectorName, blockedAddrs) + return Keeper{ + Keeper: baseKeeper, + authKeeper: ak, + bankKeeper: bk, + stakingKeeper: sk, + storeKey: key, + cdc: cdc, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", "x/"+disttypes.ModuleName) +} diff --git a/x/distribution/keeper/keeper_test.go b/x/distribution/keeper/keeper_test.go new file mode 100644 index 00000000..94292649 --- /dev/null +++ b/x/distribution/keeper/keeper_test.go @@ -0,0 +1 @@ +package keeper_test diff --git a/x/distribution/keeper/store.go b/x/distribution/keeper/store.go new file mode 100644 index 00000000..aec343f7 --- /dev/null +++ b/x/distribution/keeper/store.go @@ -0,0 +1,25 @@ +package keeper + +import ( + "github.com/aura-nw/aura/x/distribution/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) GetListPreviousEpochVoteInfo(ctx sdk.Context) types.ListEpochVoteInfo { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.EpochVoteInfoKey) + + if bz == nil { + panic("list previous epoch info not set") + } + + var votes types.ListEpochVoteInfo + k.cdc.MustUnmarshal(bz, &votes) + return votes +} + +func (k Keeper) UpdateListPreviousEpochVoteInfo(ctx sdk.Context, listVotes types.ListEpochVoteInfo) { + store := ctx.KVStore(k.storeKey) + bz := k.cdc.MustMarshal(&listVotes) + store.Set(types.EpochVoteInfoKey, bz) +} diff --git a/x/distribution/module.go b/x/distribution/module.go new file mode 100644 index 00000000..3ee331ba --- /dev/null +++ b/x/distribution/module.go @@ -0,0 +1,78 @@ +package distribution + +import ( + "encoding/json" + customkeeper "github.com/aura-nw/aura/x/distribution/keeper" + "github.com/aura-nw/aura/x/distribution/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/x/distribution" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func (a AppModuleBasic) Name() string { + return disttypes.ModuleName +} + +func (a AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (a AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { +} + +func (a AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + +} + +func (a AppModuleBasic) DefaultGenesis(jsonCodec codec.JSONCodec) json.RawMessage { + return jsonCodec.MustMarshalJSON(disttypes.DefaultGenesisState()) +} + +func (a AppModuleBasic) ValidateGenesis(jsonCodec codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error { + //TODO implement me + panic("implement me") +} + +func (a AppModuleBasic) RegisterRESTRoutes(context client.Context, router *mux.Router) { +} + +func (a AppModuleBasic) RegisterGRPCGatewayRoutes(context client.Context, serveMux *runtime.ServeMux) { +} + +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + //TODO implement me + panic("implement me") +} + +func (a AppModuleBasic) GetQueryCmd() *cobra.Command { + //TODO implement me + panic("implement me") +} + +type AppModule struct { + distribution.AppModule + + keeper customkeeper.Keeper +} + +func NewAppModule(cdc codec.Codec, customKeeper customkeeper.Keeper, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, stackingKeeper types.StakingKeeper) AppModule { + return AppModule{ + AppModule: distribution.NewAppModule(cdc, customKeeper.Keeper, accountKeeper, bankKeeper, stackingKeeper), + keeper: customKeeper, + } +} diff --git a/x/distribution/types/codec.go b/x/distribution/types/codec.go new file mode 100644 index 00000000..eafbeec6 --- /dev/null +++ b/x/distribution/types/codec.go @@ -0,0 +1,6 @@ +package types + +import "github.com/cosmos/cosmos-sdk/codec" + +func RegisterCodec(cdc *codec.LegacyAmino) { +} diff --git a/x/distribution/types/epoch_vote_info.pb.go b/x/distribution/types/epoch_vote_info.pb.go new file mode 100644 index 00000000..f6990161 --- /dev/null +++ b/x/distribution/types/epoch_vote_info.pb.go @@ -0,0 +1,617 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: distribution/epoch_vote_info.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types "github.com/tendermint/tendermint/abci/types" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type EpochVoteInfo struct { + Validator types.Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"` + ProposerBlocks int64 `protobuf:"varint,2,opt,name=proposer_blocks,json=proposerBlocks,proto3" json:"proposer_blocks,omitempty"` + ActiveBlocks int64 `protobuf:"varint,3,opt,name=active_blocks,json=activeBlocks,proto3" json:"active_blocks,omitempty"` + TotalPower int64 `protobuf:"varint,4,opt,name=total_power,json=totalPower,proto3" json:"total_power,omitempty"` +} + +func (m *EpochVoteInfo) Reset() { *m = EpochVoteInfo{} } +func (m *EpochVoteInfo) String() string { return proto.CompactTextString(m) } +func (*EpochVoteInfo) ProtoMessage() {} +func (*EpochVoteInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_d863eda70fc0a961, []int{0} +} +func (m *EpochVoteInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EpochVoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EpochVoteInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EpochVoteInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_EpochVoteInfo.Merge(m, src) +} +func (m *EpochVoteInfo) XXX_Size() int { + return m.Size() +} +func (m *EpochVoteInfo) XXX_DiscardUnknown() { + xxx_messageInfo_EpochVoteInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_EpochVoteInfo proto.InternalMessageInfo + +func (m *EpochVoteInfo) GetValidator() types.Validator { + if m != nil { + return m.Validator + } + return types.Validator{} +} + +func (m *EpochVoteInfo) GetProposerBlocks() int64 { + if m != nil { + return m.ProposerBlocks + } + return 0 +} + +func (m *EpochVoteInfo) GetActiveBlocks() int64 { + if m != nil { + return m.ActiveBlocks + } + return 0 +} + +func (m *EpochVoteInfo) GetTotalPower() int64 { + if m != nil { + return m.TotalPower + } + return 0 +} + +type ListEpochVoteInfo struct { + ListEpochVoteInfo []*EpochVoteInfo `protobuf:"bytes,1,rep,name=list_epoch_vote_info,json=listEpochVoteInfo,proto3" json:"list_epoch_vote_info,omitempty"` +} + +func (m *ListEpochVoteInfo) Reset() { *m = ListEpochVoteInfo{} } +func (m *ListEpochVoteInfo) String() string { return proto.CompactTextString(m) } +func (*ListEpochVoteInfo) ProtoMessage() {} +func (*ListEpochVoteInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_d863eda70fc0a961, []int{1} +} +func (m *ListEpochVoteInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ListEpochVoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ListEpochVoteInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ListEpochVoteInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListEpochVoteInfo.Merge(m, src) +} +func (m *ListEpochVoteInfo) XXX_Size() int { + return m.Size() +} +func (m *ListEpochVoteInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ListEpochVoteInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_ListEpochVoteInfo proto.InternalMessageInfo + +func (m *ListEpochVoteInfo) GetListEpochVoteInfo() []*EpochVoteInfo { + if m != nil { + return m.ListEpochVoteInfo + } + return nil +} + +func init() { + proto.RegisterType((*EpochVoteInfo)(nil), "auranw.aura.distribution.EpochVoteInfo") + proto.RegisterType((*ListEpochVoteInfo)(nil), "auranw.aura.distribution.ListEpochVoteInfo") +} + +func init() { + proto.RegisterFile("distribution/epoch_vote_info.proto", fileDescriptor_d863eda70fc0a961) +} + +var fileDescriptor_d863eda70fc0a961 = []byte{ + // 335 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x4b, 0x3a, 0x41, + 0x14, 0xc7, 0x77, 0x7e, 0xca, 0x0f, 0x1a, 0xb3, 0x70, 0xf1, 0xb0, 0x18, 0xac, 0x62, 0x07, 0x3d, + 0xd4, 0x0c, 0xd8, 0xbd, 0x83, 0x50, 0x10, 0x74, 0x08, 0x0f, 0x12, 0x5d, 0x96, 0xd9, 0x75, 0xd4, + 0xa1, 0x75, 0xde, 0x32, 0xfb, 0xd4, 0xfa, 0x2f, 0xfa, 0x8b, 0x3a, 0x7b, 0xf4, 0xd8, 0x29, 0x42, + 0xff, 0x91, 0x98, 0x31, 0x31, 0x85, 0x4e, 0xef, 0xf1, 0xe1, 0xf3, 0xbe, 0xc3, 0xbc, 0x47, 0x9b, + 0x03, 0x95, 0xa3, 0x51, 0xf1, 0x14, 0x15, 0x68, 0x2e, 0x33, 0x48, 0xc6, 0xd1, 0x0c, 0x50, 0x46, + 0x4a, 0x0f, 0x81, 0x65, 0x06, 0x10, 0xfc, 0x40, 0x4c, 0x8d, 0xd0, 0x73, 0x66, 0x0b, 0xfb, 0xed, + 0xd7, 0xce, 0x50, 0xea, 0x81, 0x34, 0x13, 0xa5, 0x91, 0x8b, 0x38, 0x51, 0x1c, 0x5f, 0x33, 0x99, + 0x6f, 0xc6, 0x6a, 0xd5, 0x11, 0x8c, 0xc0, 0xb5, 0xdc, 0x76, 0x1b, 0xda, 0x7c, 0x27, 0xb4, 0x7c, + 0x63, 0x9f, 0xe9, 0x03, 0xca, 0x3b, 0x3d, 0x04, 0xff, 0x9a, 0x1e, 0xcd, 0x44, 0xaa, 0x06, 0x02, + 0xc1, 0x04, 0xa4, 0x41, 0xda, 0xa5, 0x4e, 0x8d, 0xed, 0x82, 0x99, 0x0d, 0x66, 0xfd, 0xad, 0xd1, + 0x2d, 0x2e, 0x3e, 0xeb, 0x5e, 0x6f, 0x37, 0xe2, 0xb7, 0xe8, 0x69, 0x66, 0x20, 0x83, 0x5c, 0x9a, + 0x28, 0x4e, 0x21, 0x79, 0xce, 0x83, 0x7f, 0x0d, 0xd2, 0x2e, 0xf4, 0x4e, 0xb6, 0xb8, 0xeb, 0xa8, + 0x7f, 0x4e, 0xcb, 0x22, 0x41, 0x35, 0x93, 0x5b, 0xad, 0xe0, 0xb4, 0xe3, 0x0d, 0xfc, 0x91, 0xea, + 0xb4, 0x84, 0x80, 0x22, 0x8d, 0x32, 0x98, 0x4b, 0x13, 0x14, 0x9d, 0x42, 0x1d, 0x7a, 0xb0, 0xa4, + 0x39, 0xa1, 0x95, 0x7b, 0x95, 0xe3, 0xfe, 0x1f, 0x1e, 0x69, 0x35, 0x55, 0x39, 0x46, 0x07, 0x0b, + 0x0c, 0x48, 0xa3, 0xd0, 0x2e, 0x75, 0x5a, 0xec, 0xaf, 0x0d, 0xb2, 0xbd, 0x98, 0x5e, 0x25, 0x3d, + 0x4c, 0xee, 0xde, 0x2e, 0x56, 0x21, 0x59, 0xae, 0x42, 0xf2, 0xb5, 0x0a, 0xc9, 0xdb, 0x3a, 0xf4, + 0x96, 0xeb, 0xd0, 0xfb, 0x58, 0x87, 0xde, 0xd3, 0xc5, 0x48, 0xe1, 0x78, 0x1a, 0xb3, 0x04, 0x26, + 0xdc, 0x06, 0x5f, 0xea, 0xb9, 0xab, 0xfc, 0x85, 0xef, 0x1d, 0xd5, 0xdd, 0x24, 0xfe, 0xef, 0xd6, + 0x7f, 0xf5, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x50, 0x55, 0x95, 0x2b, 0xf1, 0x01, 0x00, 0x00, +} + +func (m *EpochVoteInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EpochVoteInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EpochVoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TotalPower != 0 { + i = encodeVarintEpochVoteInfo(dAtA, i, uint64(m.TotalPower)) + i-- + dAtA[i] = 0x20 + } + if m.ActiveBlocks != 0 { + i = encodeVarintEpochVoteInfo(dAtA, i, uint64(m.ActiveBlocks)) + i-- + dAtA[i] = 0x18 + } + if m.ProposerBlocks != 0 { + i = encodeVarintEpochVoteInfo(dAtA, i, uint64(m.ProposerBlocks)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEpochVoteInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *ListEpochVoteInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ListEpochVoteInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ListEpochVoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ListEpochVoteInfo) > 0 { + for iNdEx := len(m.ListEpochVoteInfo) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ListEpochVoteInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEpochVoteInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintEpochVoteInfo(dAtA []byte, offset int, v uint64) int { + offset -= sovEpochVoteInfo(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EpochVoteInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Validator.Size() + n += 1 + l + sovEpochVoteInfo(uint64(l)) + if m.ProposerBlocks != 0 { + n += 1 + sovEpochVoteInfo(uint64(m.ProposerBlocks)) + } + if m.ActiveBlocks != 0 { + n += 1 + sovEpochVoteInfo(uint64(m.ActiveBlocks)) + } + if m.TotalPower != 0 { + n += 1 + sovEpochVoteInfo(uint64(m.TotalPower)) + } + return n +} + +func (m *ListEpochVoteInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ListEpochVoteInfo) > 0 { + for _, e := range m.ListEpochVoteInfo { + l = e.Size() + n += 1 + l + sovEpochVoteInfo(uint64(l)) + } + } + return n +} + +func sovEpochVoteInfo(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEpochVoteInfo(x uint64) (n int) { + return sovEpochVoteInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EpochVoteInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochVoteInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EpochVoteInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EpochVoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochVoteInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEpochVoteInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEpochVoteInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerBlocks", wireType) + } + m.ProposerBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochVoteInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposerBlocks |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ActiveBlocks", wireType) + } + m.ActiveBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochVoteInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ActiveBlocks |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalPower", wireType) + } + m.TotalPower = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochVoteInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TotalPower |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEpochVoteInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEpochVoteInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ListEpochVoteInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochVoteInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListEpochVoteInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListEpochVoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ListEpochVoteInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEpochVoteInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEpochVoteInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEpochVoteInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ListEpochVoteInfo = append(m.ListEpochVoteInfo, &EpochVoteInfo{}) + if err := m.ListEpochVoteInfo[len(m.ListEpochVoteInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEpochVoteInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEpochVoteInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEpochVoteInfo(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEpochVoteInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEpochVoteInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEpochVoteInfo + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEpochVoteInfo + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEpochVoteInfo + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEpochVoteInfo + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEpochVoteInfo = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEpochVoteInfo = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEpochVoteInfo = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/distribution/types/expected_keepers.go b/x/distribution/types/expected_keepers.go new file mode 100644 index 00000000..d5ceb469 --- /dev/null +++ b/x/distribution/types/expected_keepers.go @@ -0,0 +1,41 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + GetModuleAddress(moduleName string) sdk.AccAddress + GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI + SetModuleAccount(ctx sdk.Context, macc authtypes.ModuleAccountI) +} + +type BankKeeper interface { + GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + LockedCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) error + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins +} + +type StakingKeeper interface { + Delegation(sdk.Context, sdk.AccAddress, sdk.ValAddress) stakingtypes.DelegationI + GetAllSDKDelegations(ctx sdk.Context) []stakingtypes.Delegation + IterateValidators(ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + IterateBondedValidatorsByPower(ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + IterateLastValidators(ctx sdk.Context, f func(index int64, validator stakingtypes.ValidatorI) (stop bool)) + Validator(ctx sdk.Context, address sdk.ValAddress) stakingtypes.ValidatorI + ValidatorByConsAddr(ctx sdk.Context, address sdk.ConsAddress) stakingtypes.ValidatorI + Slash(ctx sdk.Context, address sdk.ConsAddress, i int64, i2 int64, dec sdk.Dec) + Jail(ctx sdk.Context, address sdk.ConsAddress) + Unjail(ctx sdk.Context, address sdk.ConsAddress) + MaxValidators(ctx sdk.Context) uint32 + IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress, fn func(index int64, delegation stakingtypes.DelegationI) (stop bool)) + GetLastTotalPower(ctx sdk.Context) sdk.Int + GetLastValidatorPower(ctx sdk.Context, valAddr sdk.ValAddress) int64 +} diff --git a/x/distribution/types/keys.go b/x/distribution/types/keys.go new file mode 100644 index 00000000..80e02d93 --- /dev/null +++ b/x/distribution/types/keys.go @@ -0,0 +1,5 @@ +package types + +var ( + EpochVoteInfoKey = []byte{0x11} +) From e023ff29d0fdd2a6abcca0c90cc7245a18586e97 Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Sun, 1 Jan 2023 16:59:30 +0700 Subject: [PATCH 05/12] Remove my test --- mytest/main.go | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 mytest/main.go diff --git a/mytest/main.go b/mytest/main.go deleted file mode 100644 index 8c140a7f..00000000 --- a/mytest/main.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func main() { - amount := sdk.NewIntFromUint64(1_000_000) - fmt.Println(amount.ToDec()) - - fmt.Println(amount.ToDec().QuoInt(sdk.NewIntFromUint64(50_000))) -} From 5d46f38372635c32663e00be15543065ec3c6069 Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Wed, 4 Jan 2023 17:43:42 +0700 Subject: [PATCH 06/12] wip: add distribution by epoch --- Makefile | 5 +- app/app.go | 12 +- docs/static/openapi.yml | 326 ++++++++++++++++++++- mytest/main.go | 14 - proto/distribution/epoch_vote_info.proto | 14 +- x/auth/vesting/types/tx.pb.go | 2 - x/distribution/abci.go | 40 ++- x/distribution/keeper/allocation.go | 28 +- x/distribution/keeper/hooks.go | 33 +++ x/distribution/keeper/keeper.go | 6 - x/distribution/keeper/store.go | 24 +- x/distribution/module.go | 71 +---- x/distribution/types/codec.go | 6 - x/distribution/types/epoch_vote_info.pb.go | 226 +++++++------- x/distribution/types/keys.go | 2 +- 15 files changed, 563 insertions(+), 246 deletions(-) delete mode 100644 mytest/main.go create mode 100644 x/distribution/keeper/hooks.go delete mode 100644 x/distribution/types/codec.go diff --git a/Makefile b/Makefile index 53230440..40c8128a 100644 --- a/Makefile +++ b/Makefile @@ -43,4 +43,7 @@ test: @go test -mod=readonly $(PACKAGES) test-x: - @go test -mod=readonly $(PACKAGES)/x/... \ No newline at end of file + @go test -mod=readonly $(PACKAGES)/x/... + +lint: + @golangci-lint run -v \ No newline at end of file diff --git a/app/app.go b/app/app.go index 0f2272d3..c5becb62 100644 --- a/app/app.go +++ b/app/app.go @@ -18,6 +18,7 @@ import ( "github.com/aura-nw/aura/x/mint" mintkeeper "github.com/aura-nw/aura/x/mint/keeper" + customdistr "github.com/aura-nw/aura/x/distribution" minttypes "github.com/aura-nw/aura/x/mint/types" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" @@ -47,8 +48,9 @@ import ( crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" distr "github.com/cosmos/cosmos-sdk/x/distribution" + + customdistrkeeper "github.com/aura-nw/aura/x/distribution/keeper" distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client" - distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" "github.com/cosmos/cosmos-sdk/x/evidence" evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" @@ -280,7 +282,7 @@ type App struct { StakingKeeper stakingkeeper.Keeper SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper + DistrKeeper customdistrkeeper.Keeper GovKeeper govkeeper.Keeper CrisisKeeper crisiskeeper.Keeper UpgradeKeeper upgradekeeper.Keeper @@ -395,7 +397,7 @@ func New( appCodec, keys[minttypes.StoreKey], app.GetSubspace(minttypes.ModuleName), &stakingKeeper, app.AccountKeeper, app.BankKeeper, app.AuraKeeper, authtypes.FeeCollectorName, ) - app.DistrKeeper = distrkeeper.NewKeeper( + app.DistrKeeper = customdistrkeeper.NewKeeper( appCodec, keys[distrtypes.StoreKey], app.GetSubspace(distrtypes.ModuleName), app.AccountKeeper, app.BankKeeper, &stakingKeeper, authtypes.FeeCollectorName, app.ModuleAccountAddrs(), ) @@ -439,7 +441,7 @@ func New( govRouter := govtypes.NewRouter() govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). + AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper.Keeper)). AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) @@ -542,7 +544,7 @@ func New( gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), - distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), + customdistr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), upgrade.NewAppModule(app.UpgradeKeeper), evidence.NewAppModule(app.EvidenceKeeper), diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 961e4590..b9509abd 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -157,6 +157,10 @@ paths: started. (The block height at which the timer last ticked) + num_blocks: + type: string + format: int64 + title: Number blocks counted on a epoch description: |- EpochInfo is a struct that describes the data going into a timer defined by the x/epochs module. @@ -3780,33 +3784,44 @@ paths: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs from the + previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. data: type: object @@ -3878,6 +3893,7 @@ paths: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -3935,6 +3951,7 @@ paths: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -4023,35 +4040,48 @@ paths: last_commit_hash: type: string format: byte + description: >- + commit from validators from the last + block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: >- hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs + from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: >- Header defines the structure of a Tendermint block header. @@ -4534,33 +4564,44 @@ paths: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs from the + previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. data: type: object @@ -4632,6 +4673,7 @@ paths: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -4689,6 +4731,7 @@ paths: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -4777,35 +4820,48 @@ paths: last_commit_hash: type: string format: byte + description: >- + commit from validators from the last + block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: >- hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs + from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: >- Header defines the structure of a Tendermint block header. @@ -11675,7 +11731,10 @@ paths: description: >- RedelegationEntry defines a redelegation object with relevant metadata. - description: entries are the redelegation entries. + description: |- + entries are the redelegation entries. + + redelegation entries description: >- Redelegation contains the list of a particular delegator's redelegating bonds @@ -12075,7 +12134,10 @@ paths: description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. - description: entries are the unbonding delegation entries. + description: |- + entries are the unbonding delegation entries. + + unbonding delegation entries description: >- UnbondingDelegation stores all of a single delegator's unbonding bonds @@ -13527,33 +13589,44 @@ paths: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs from the + previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. valset: type: array @@ -16242,7 +16315,10 @@ paths: description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. - description: entries are the unbonding delegation entries. + description: |- + entries are the unbonding delegation entries. + + unbonding delegation entries description: >- UnbondingDelegation stores all of a single delegator's unbonding bonds @@ -16508,7 +16584,10 @@ paths: description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. - description: entries are the unbonding delegation entries. + description: |- + entries are the unbonding delegation entries. + + unbonding delegation entries description: >- UnbondingDelegation stores all of a single delegator's unbonding bonds @@ -16848,6 +16927,7 @@ paths: format: byte index: type: boolean + title: nondeterministic description: >- EventAttribute is a single key-value pair, associated with an event. @@ -17635,6 +17715,7 @@ paths: format: byte index: type: boolean + title: nondeterministic description: >- EventAttribute is a single key-value pair, associated with an event. @@ -19473,6 +19554,7 @@ paths: code_id: type: string format: uint64 + title: id for legacy support creator: type: string data_hash: @@ -19791,6 +19873,7 @@ paths: code_id: type: string format: uint64 + title: id for legacy support creator: type: string data_hash: @@ -20021,6 +20104,7 @@ paths: } parameters: - name: code_id + description: grpc-gateway_out does not support Go style CodID in: path required: true type: string @@ -20250,6 +20334,7 @@ paths: } parameters: - name: code_id + description: grpc-gateway_out does not support Go style CodID in: path required: true type: string @@ -32973,6 +33058,10 @@ definitions: epoch started. (The block height at which the timer last ticked) + num_blocks: + type: string + format: int64 + title: Number blocks counted on a epoch description: |- EpochInfo is a struct that describes the data going into a timer defined by the x/epochs module. @@ -33079,6 +33168,10 @@ definitions: current epoch started. (The block height at which the timer last ticked) + num_blocks: + type: string + format: int64 + title: Number blocks counted on a epoch description: |- EpochInfo is a struct that describes the data going into a timer defined by the x/epochs module. @@ -35566,33 +35659,42 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: root hash of all results from the txs from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. data: type: object @@ -35661,6 +35763,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -35718,6 +35821,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -35806,35 +35910,48 @@ definitions: last_commit_hash: type: string format: byte + description: >- + commit from validators from the last + block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: >- hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs + from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: >- Header defines the structure of a Tendermint block header. @@ -36117,33 +36234,42 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: root hash of all results from the txs from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. data: type: object @@ -36212,6 +36338,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -36269,6 +36396,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -36357,35 +36485,48 @@ definitions: last_commit_hash: type: string format: byte + description: >- + commit from validators from the last + block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: >- hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs + from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: >- Header defines the structure of a Tendermint block header. @@ -37427,33 +37568,42 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: root hash of all results from the txs from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. data: type: object @@ -37522,6 +37672,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -37579,6 +37730,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -37666,35 +37818,46 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: >- hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs from + the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: >- Header defines the structure of a Tendermint block header. @@ -38061,6 +38224,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -38117,6 +38281,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -38191,6 +38356,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -38247,6 +38413,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -38334,33 +38501,44 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs from the + previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. commit: type: object @@ -38564,6 +38742,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -38621,6 +38800,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -38708,33 +38888,44 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs from the + previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: >- Header defines the structure of a Tendermint block header. @@ -38938,33 +39129,42 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: root hash of all results from the txs from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. tendermint.types.LightBlock: type: object @@ -39021,33 +39221,42 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: root hash of all results from the txs from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. commit: type: object @@ -39216,33 +39425,44 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs from the previous + block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. commit: type: object @@ -39455,33 +39675,42 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: root hash of all results from the txs from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. commit: type: object @@ -39668,6 +39897,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -42208,33 +42438,42 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: root hash of all results from the txs from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. valset: type: array @@ -42767,7 +43006,10 @@ definitions: description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. - description: entries are the unbonding delegation entries. + description: |- + entries are the unbonding delegation entries. + + unbonding delegation entries description: >- UnbondingDelegation stores all of a single delegator's unbonding bonds @@ -43455,33 +43697,42 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: root hash of all results from the txs from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. valset: type: array @@ -43883,7 +44134,10 @@ definitions: description: >- RedelegationEntry defines a redelegation object with relevant metadata. - description: entries are the redelegation entries. + description: |- + entries are the redelegation entries. + + redelegation entries description: >- Redelegation contains the list of a particular delegator's redelegating bonds @@ -44002,7 +44256,10 @@ definitions: description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. - description: entries are the unbonding delegation entries. + description: |- + entries are the unbonding delegation entries. + + unbonding delegation entries description: |- UnbondingDelegation stores all of a single delegator's unbonding bonds for a single validator in an time-ordered list. @@ -44414,7 +44671,10 @@ definitions: description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. - description: entries are the unbonding delegation entries. + description: |- + entries are the unbonding delegation entries. + + unbonding delegation entries description: >- UnbondingDelegation stores all of a single delegator's unbonding bonds @@ -44803,7 +45063,10 @@ definitions: description: >- RedelegationEntry defines a redelegation object with relevant metadata. - description: entries are the redelegation entries. + description: |- + entries are the redelegation entries. + + redelegation entries description: >- Redelegation contains the list of a particular delegator's redelegating bonds @@ -44916,7 +45179,10 @@ definitions: description: >- RedelegationEntry defines a redelegation object with relevant metadata. - description: entries are the redelegation entries. + description: |- + entries are the redelegation entries. + + redelegation entries description: >- Redelegation contains the list of a particular delegator's redelegating bonds @@ -45006,7 +45272,10 @@ definitions: description: >- UnbondingDelegationEntry defines an unbonding object with relevant metadata. - description: entries are the unbonding delegation entries. + description: |- + entries are the unbonding delegation entries. + + unbonding delegation entries description: |- UnbondingDelegation stores all of a single delegator's unbonding bonds for a single validator in an time-ordered list. @@ -45401,6 +45670,7 @@ definitions: format: byte index: type: boolean + title: nondeterministic description: >- EventAttribute is a single key-value pair, associated with an event. @@ -45708,6 +45978,7 @@ definitions: format: byte index: type: boolean + title: nondeterministic description: >- EventAttribute is a single key-value pair, associated with an event. @@ -46191,6 +46462,7 @@ definitions: format: byte index: type: boolean + title: nondeterministic description: >- EventAttribute is a single key-value pair, associated with an event. @@ -46355,33 +46627,42 @@ definitions: last_commit_hash: type: string format: byte + description: commit from validators from the last block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: root hash of all results from the txs from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: Header defines the structure of a Tendermint block header. data: type: object @@ -46450,6 +46731,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -46507,6 +46789,7 @@ definitions: format: byte title: PartsetHeader title: BlockID + description: zero if vote is nil. timestamp: type: string format: date-time @@ -46595,35 +46878,48 @@ definitions: last_commit_hash: type: string format: byte + description: >- + commit from validators from the last + block title: hashes of block data data_hash: type: string format: byte + title: transactions validators_hash: type: string format: byte + description: validators for the current block title: >- hashes from the app output from the prev block next_validators_hash: type: string format: byte + title: validators for the next block consensus_hash: type: string format: byte + title: consensus params for current block app_hash: type: string format: byte + title: state after txs from the previous block last_results_hash: type: string format: byte + title: >- + root hash of all results from the txs + from the previous block evidence_hash: type: string format: byte + description: evidence included in the block title: consensus info proposer_address: type: string format: byte + title: original proposer of the block description: >- Header defines the structure of a Tendermint block header. @@ -47138,6 +47434,7 @@ definitions: format: byte index: type: boolean + title: nondeterministic description: >- EventAttribute is a single key-value pair, associated with an event. @@ -47460,6 +47757,7 @@ definitions: format: byte index: type: boolean + title: nondeterministic description: >- EventAttribute is a single key-value pair, associated with an event. @@ -47908,6 +48206,7 @@ definitions: format: byte index: type: boolean + title: nondeterministic description: >- EventAttribute is a single key-value pair, associated with an event. @@ -49066,6 +49365,7 @@ definitions: format: byte index: type: boolean + title: nondeterministic description: 'EventAttribute is a single key-value pair, associated with an event.' description: >- Event allows application developers to attach additional information to @@ -49085,6 +49385,7 @@ definitions: format: byte index: type: boolean + title: nondeterministic description: 'EventAttribute is a single key-value pair, associated with an event.' cosmos.upgrade.v1beta1.ModuleVersion: type: object @@ -49684,6 +49985,7 @@ definitions: code_id: type: string format: uint64 + title: id for legacy support creator: type: string data_hash: @@ -50152,6 +50454,7 @@ definitions: code_id: type: string format: uint64 + title: id for legacy support creator: type: string data_hash: @@ -50204,6 +50507,7 @@ definitions: code_id: type: string format: uint64 + title: id for legacy support creator: type: string data_hash: diff --git a/mytest/main.go b/mytest/main.go deleted file mode 100644 index 8c140a7f..00000000 --- a/mytest/main.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func main() { - amount := sdk.NewIntFromUint64(1_000_000) - fmt.Println(amount.ToDec()) - - fmt.Println(amount.ToDec().QuoInt(sdk.NewIntFromUint64(50_000))) -} diff --git a/proto/distribution/epoch_vote_info.proto b/proto/distribution/epoch_vote_info.proto index 1c85778a..cb5f691c 100644 --- a/proto/distribution/epoch_vote_info.proto +++ b/proto/distribution/epoch_vote_info.proto @@ -2,19 +2,17 @@ syntax = "proto3"; package auranw.aura.distribution; -import "tendermint/abci/types.proto"; import "gogoproto/gogo.proto"; - option go_package = "github.com/aura-nw/aura/x/distribution/types"; -message EpochVoteInfo { - tendermint.abci.Validator validator = 1 [(gogoproto.nullable) = false]; +message ValidatorEpochVoteInfo { + string validator_address = 1; int64 proposer_blocks = 2; int64 active_blocks = 3; - int64 total_power = 4; + int64 acc_power = 4; } -message ListEpochVoteInfo { - repeated EpochVoteInfo list_epoch_vote_info = 1; -} +message EpochVotesInfo { + repeated ValidatorEpochVoteInfo validators = 1 [(gogoproto.nullable) = false]; +} \ No newline at end of file diff --git a/x/auth/vesting/types/tx.pb.go b/x/auth/vesting/types/tx.pb.go index f37f6c97..b3208990 100644 --- a/x/auth/vesting/types/tx.pb.go +++ b/x/auth/vesting/types/tx.pb.go @@ -33,7 +33,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // MsgCreatePeriodicVestingAccount defines a message that enables creating a periodic vesting // account. -// type MsgCreatePeriodicVestingAccount struct { FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` @@ -104,7 +103,6 @@ func (m *MsgCreatePeriodicVestingAccount) GetVestingPeriods() []types.Period { // MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount // response type. -// type MsgCreatePeriodicVestingAccountResponse struct { } diff --git a/x/distribution/abci.go b/x/distribution/abci.go index 0e5332a2..b8f97212 100644 --- a/x/distribution/abci.go +++ b/x/distribution/abci.go @@ -1,10 +1,12 @@ package distribution import ( + "bytes" customdistkeeper "github.com/aura-nw/aura/x/distribution/keeper" + "github.com/aura-nw/aura/x/distribution/types" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/distribution/types" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" abci "github.com/tendermint/tendermint/abci/types" "time" ) @@ -12,6 +14,40 @@ import ( // BeginBlocker sets the proposer for determining distribution during endblock // and distribute rewards for the previous block func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k customdistkeeper.Keeper) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(disttypes.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + k.Logger(ctx).Error("customdistr/beginblocker=======================") + lastEpochVotesInfo := k.GetLastEpochVotesInfo(ctx) + previousProposer := k.GetPreviousProposerConsAddr(ctx) + updatedVotes := []types.ValidatorEpochVoteInfo{} + + previousVotes := req.LastCommitInfo.GetVotes() + + for _, previousVote := range previousVotes { + for _, lastVote := range lastEpochVotesInfo.Validators { + valAddr, err := sdk.ValAddressFromBech32(lastVote.ValidatorAddress) + if err != nil { + panic(err) + } + if bytes.Equal(previousVote.Validator.Address, valAddr.Bytes()) { + proposerBlocks := lastVote.ProposerBlocks + if bytes.Compare(previousVote.Validator.Address, previousProposer.Bytes()) == 0 { + proposerBlocks += 1 + } + updateVote := types.ValidatorEpochVoteInfo{ + ValidatorAddress: lastVote.ValidatorAddress, + ActiveBlocks: lastVote.ActiveBlocks + 1, + AccPower: lastVote.AccPower + previousVote.Validator.Power, + ProposerBlocks: proposerBlocks, + } + updatedVotes = append(updatedVotes, updateVote) + } + } + } + + k.UpdateLastEpochVoteInfo(ctx, updatedVotes) + + // record the proposer for when we payout on the next block + consAddr := sdk.ConsAddress(req.Header.ProposerAddress) + k.SetPreviousProposerConsAddr(ctx, consAddr) } diff --git a/x/distribution/keeper/allocation.go b/x/distribution/keeper/allocation.go index a86e5087..e7638043 100644 --- a/x/distribution/keeper/allocation.go +++ b/x/distribution/keeper/allocation.go @@ -11,12 +11,14 @@ import ( // AllocateTokens handles distribution of the collected fees on one epoch func (k Keeper) AllocateTokens( ctx sdk.Context, - numberBlocks int64, - totalPreviousPower int64, - bondedEpochVotes []types.EpochVoteInfo, + epochVotesInfo types.EpochVotesInfo, ) { logger := k.Logger(ctx) + var totalPreviousPower int64 + var parts int64 + var numberBlocks int64 + // get total fees in epoch feeCollector := k.authKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName) feesCollectedInt := k.bankKeeper.GetAllBalances(ctx, feeCollector.GetAddress()) @@ -31,6 +33,12 @@ func (k Keeper) AllocateTokens( } feePool := k.GetFeePool(ctx) + + for _, voteInfo := range epochVotesInfo.Validators { + totalPreviousPower += voteInfo.AccPower + parts += voteInfo.ActiveBlocks - voteInfo.ProposerBlocks + numberBlocks += voteInfo.ProposerBlocks + } if totalPreviousPower == 0 { logger.Info("No previous power") feePool.CommunityPool = feePool.CommunityPool.Add(feesCollected...) @@ -48,18 +56,18 @@ func (k Keeper) AllocateTokens( feePool.CommunityPool = feePool.CommunityPool.Add(feeCommunityTax...) feesCollectedAfterTax := feesCollected.Sub(feeCommunityTax) - var parts int64 - for _, voteInfo := range bondedEpochVotes { - parts += voteInfo.ActiveBlocks - voteInfo.ProposerBlocks - } - dec := sdk.NewDec(parts).Add(sdk.NewDec(numberBlocks).Mul(proposerMultiplier.Add(sdk.OneDec()))) rewardUnit := feesCollectedAfterTax.MulDecTruncate(dec) remaining := feesCollectedAfterTax - for _, voteInfo := range bondedEpochVotes { - validator := k.stakingKeeper.ValidatorByConsAddr(ctx, voteInfo.Validator.Address) + for _, voteInfo := range epochVotesInfo.Validators { + addr, err := sdk.ConsAddressFromBech32(voteInfo.ValidatorAddress) + if err != nil { + logger.Error("invalid address") + panic(err) + } + validator := k.stakingKeeper.ValidatorByConsAddr(ctx, addr) // Rewards for proposer proposerReward := rewardUnit.MulDecTruncate(proposerMultiplier.Add(sdk.OneDec())).MulDecTruncate(sdk.NewDec(voteInfo.ProposerBlocks)) diff --git a/x/distribution/keeper/hooks.go b/x/distribution/keeper/hooks.go new file mode 100644 index 00000000..6a91f461 --- /dev/null +++ b/x/distribution/keeper/hooks.go @@ -0,0 +1,33 @@ +package keeper + +import sdk "github.com/cosmos/cosmos-sdk/types" + +func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) error { + // At end of epoch, allocate token rewards to all validators contributed + + if epochIdentifier == "day" { + epochVotesInfo := k.GetLastEpochVotesInfo(ctx) + k.AllocateTokens(ctx, epochVotesInfo) + } + + return nil +} + +func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) error { + // Reset Epoch vote info when starting new epoch + k.ResetEpochVotesInfo(ctx) + return nil +} + +// Hooks wrapper struct for incentives keeper. +type Hooks struct { + k Keeper +} + +func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) error { + return h.k.AfterEpochEnd(ctx, epochIdentifier, epochNumber) +} + +func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) error { + return h.k.BeforeEpochStart(ctx, epochIdentifier, epochNumber) +} diff --git a/x/distribution/keeper/keeper.go b/x/distribution/keeper/keeper.go index 7e0d1b33..eda636cc 100644 --- a/x/distribution/keeper/keeper.go +++ b/x/distribution/keeper/keeper.go @@ -5,9 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" distkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/tendermint/tendermint/libs/log" ) type Keeper struct { @@ -32,7 +30,3 @@ func NewKeeper(cdc codec.BinaryCodec, key sdk.StoreKey, paramSpace paramtypes.Su cdc: cdc, } } - -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", "x/"+disttypes.ModuleName) -} diff --git a/x/distribution/keeper/store.go b/x/distribution/keeper/store.go index aec343f7..10c3348b 100644 --- a/x/distribution/keeper/store.go +++ b/x/distribution/keeper/store.go @@ -5,21 +5,25 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) -func (k Keeper) GetListPreviousEpochVoteInfo(ctx sdk.Context) types.ListEpochVoteInfo { +func (k Keeper) GetLastEpochVotesInfo(ctx sdk.Context) types.EpochVotesInfo { store := ctx.KVStore(k.storeKey) - bz := store.Get(types.EpochVoteInfoKey) + + bz := store.Get(types.EpochVotesInfoKey) if bz == nil { - panic("list previous epoch info not set") + return types.EpochVotesInfo{} } - - var votes types.ListEpochVoteInfo - k.cdc.MustUnmarshal(bz, &votes) - return votes + var epochVotesInfo types.EpochVotesInfo + k.cdc.MustUnmarshal(bz, &epochVotesInfo) + return epochVotesInfo } -func (k Keeper) UpdateListPreviousEpochVoteInfo(ctx sdk.Context, listVotes types.ListEpochVoteInfo) { +func (k Keeper) UpdateLastEpochVoteInfo(ctx sdk.Context, listVotes []types.ValidatorEpochVoteInfo) { store := ctx.KVStore(k.storeKey) - bz := k.cdc.MustMarshal(&listVotes) - store.Set(types.EpochVoteInfoKey, bz) + bz := k.cdc.MustMarshal(&types.EpochVotesInfo{Validators: listVotes}) + store.Set(types.EpochVotesInfoKey, bz) +} + +func (k Keeper) ResetEpochVotesInfo(ctx sdk.Context) { + k.UpdateLastEpochVoteInfo(ctx, []types.ValidatorEpochVoteInfo{}) } diff --git a/x/distribution/module.go b/x/distribution/module.go index 3ee331ba..c3af3393 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -1,69 +1,17 @@ package distribution import ( - "encoding/json" customkeeper "github.com/aura-nw/aura/x/distribution/keeper" "github.com/aura-nw/aura/x/distribution/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/distribution" + "github.com/cosmos/cosmos-sdk/x/distribution/keeper" disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" ) -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} -) - -type AppModuleBasic struct { - cdc codec.BinaryCodec -} - -func (a AppModuleBasic) Name() string { - return disttypes.ModuleName -} - -func (a AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -func (a AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { -} - -func (a AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - -} - -func (a AppModuleBasic) DefaultGenesis(jsonCodec codec.JSONCodec) json.RawMessage { - return jsonCodec.MustMarshalJSON(disttypes.DefaultGenesisState()) -} - -func (a AppModuleBasic) ValidateGenesis(jsonCodec codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error { - //TODO implement me - panic("implement me") -} - -func (a AppModuleBasic) RegisterRESTRoutes(context client.Context, router *mux.Router) { -} - -func (a AppModuleBasic) RegisterGRPCGatewayRoutes(context client.Context, serveMux *runtime.ServeMux) { -} - -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - //TODO implement me - panic("implement me") -} - -func (a AppModuleBasic) GetQueryCmd() *cobra.Command { - //TODO implement me - panic("implement me") -} - type AppModule struct { distribution.AppModule @@ -76,3 +24,16 @@ func NewAppModule(cdc codec.Codec, customKeeper customkeeper.Keeper, accountKeep keeper: customKeeper, } } + +func (am AppModule) RegisterServices(cfg module.Configurator) { + disttypes.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper.Keeper)) + disttypes.RegisterQueryServer(cfg.QueryServer(), am.keeper.Keeper) + + m := keeper.NewMigrator(am.keeper.Keeper) + + _ = cfg.RegisterMigration(disttypes.ModuleName, 1, m.Migrate1to2) +} + +func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { + BeginBlocker(ctx, req, am.keeper) +} diff --git a/x/distribution/types/codec.go b/x/distribution/types/codec.go deleted file mode 100644 index eafbeec6..00000000 --- a/x/distribution/types/codec.go +++ /dev/null @@ -1,6 +0,0 @@ -package types - -import "github.com/cosmos/cosmos-sdk/codec" - -func RegisterCodec(cdc *codec.LegacyAmino) { -} diff --git a/x/distribution/types/epoch_vote_info.pb.go b/x/distribution/types/epoch_vote_info.pb.go index f6990161..3c1de23c 100644 --- a/x/distribution/types/epoch_vote_info.pb.go +++ b/x/distribution/types/epoch_vote_info.pb.go @@ -7,7 +7,6 @@ import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - types "github.com/tendermint/tendermint/abci/types" io "io" math "math" math_bits "math/bits" @@ -24,25 +23,25 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type EpochVoteInfo struct { - Validator types.Validator `protobuf:"bytes,1,opt,name=validator,proto3" json:"validator"` - ProposerBlocks int64 `protobuf:"varint,2,opt,name=proposer_blocks,json=proposerBlocks,proto3" json:"proposer_blocks,omitempty"` - ActiveBlocks int64 `protobuf:"varint,3,opt,name=active_blocks,json=activeBlocks,proto3" json:"active_blocks,omitempty"` - TotalPower int64 `protobuf:"varint,4,opt,name=total_power,json=totalPower,proto3" json:"total_power,omitempty"` +type ValidatorEpochVoteInfo struct { + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + ProposerBlocks int64 `protobuf:"varint,2,opt,name=proposer_blocks,json=proposerBlocks,proto3" json:"proposer_blocks,omitempty"` + ActiveBlocks int64 `protobuf:"varint,3,opt,name=active_blocks,json=activeBlocks,proto3" json:"active_blocks,omitempty"` + AccPower int64 `protobuf:"varint,4,opt,name=acc_power,json=accPower,proto3" json:"acc_power,omitempty"` } -func (m *EpochVoteInfo) Reset() { *m = EpochVoteInfo{} } -func (m *EpochVoteInfo) String() string { return proto.CompactTextString(m) } -func (*EpochVoteInfo) ProtoMessage() {} -func (*EpochVoteInfo) Descriptor() ([]byte, []int) { +func (m *ValidatorEpochVoteInfo) Reset() { *m = ValidatorEpochVoteInfo{} } +func (m *ValidatorEpochVoteInfo) String() string { return proto.CompactTextString(m) } +func (*ValidatorEpochVoteInfo) ProtoMessage() {} +func (*ValidatorEpochVoteInfo) Descriptor() ([]byte, []int) { return fileDescriptor_d863eda70fc0a961, []int{0} } -func (m *EpochVoteInfo) XXX_Unmarshal(b []byte) error { +func (m *ValidatorEpochVoteInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *EpochVoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ValidatorEpochVoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_EpochVoteInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_ValidatorEpochVoteInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -52,62 +51,62 @@ func (m *EpochVoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return b[:n], nil } } -func (m *EpochVoteInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_EpochVoteInfo.Merge(m, src) +func (m *ValidatorEpochVoteInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorEpochVoteInfo.Merge(m, src) } -func (m *EpochVoteInfo) XXX_Size() int { +func (m *ValidatorEpochVoteInfo) XXX_Size() int { return m.Size() } -func (m *EpochVoteInfo) XXX_DiscardUnknown() { - xxx_messageInfo_EpochVoteInfo.DiscardUnknown(m) +func (m *ValidatorEpochVoteInfo) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorEpochVoteInfo.DiscardUnknown(m) } -var xxx_messageInfo_EpochVoteInfo proto.InternalMessageInfo +var xxx_messageInfo_ValidatorEpochVoteInfo proto.InternalMessageInfo -func (m *EpochVoteInfo) GetValidator() types.Validator { +func (m *ValidatorEpochVoteInfo) GetValidatorAddress() string { if m != nil { - return m.Validator + return m.ValidatorAddress } - return types.Validator{} + return "" } -func (m *EpochVoteInfo) GetProposerBlocks() int64 { +func (m *ValidatorEpochVoteInfo) GetProposerBlocks() int64 { if m != nil { return m.ProposerBlocks } return 0 } -func (m *EpochVoteInfo) GetActiveBlocks() int64 { +func (m *ValidatorEpochVoteInfo) GetActiveBlocks() int64 { if m != nil { return m.ActiveBlocks } return 0 } -func (m *EpochVoteInfo) GetTotalPower() int64 { +func (m *ValidatorEpochVoteInfo) GetAccPower() int64 { if m != nil { - return m.TotalPower + return m.AccPower } return 0 } -type ListEpochVoteInfo struct { - ListEpochVoteInfo []*EpochVoteInfo `protobuf:"bytes,1,rep,name=list_epoch_vote_info,json=listEpochVoteInfo,proto3" json:"list_epoch_vote_info,omitempty"` +type EpochVotesInfo struct { + Validators []ValidatorEpochVoteInfo `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators"` } -func (m *ListEpochVoteInfo) Reset() { *m = ListEpochVoteInfo{} } -func (m *ListEpochVoteInfo) String() string { return proto.CompactTextString(m) } -func (*ListEpochVoteInfo) ProtoMessage() {} -func (*ListEpochVoteInfo) Descriptor() ([]byte, []int) { +func (m *EpochVotesInfo) Reset() { *m = EpochVotesInfo{} } +func (m *EpochVotesInfo) String() string { return proto.CompactTextString(m) } +func (*EpochVotesInfo) ProtoMessage() {} +func (*EpochVotesInfo) Descriptor() ([]byte, []int) { return fileDescriptor_d863eda70fc0a961, []int{1} } -func (m *ListEpochVoteInfo) XXX_Unmarshal(b []byte) error { +func (m *EpochVotesInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ListEpochVoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *EpochVotesInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ListEpochVoteInfo.Marshal(b, m, deterministic) + return xxx_messageInfo_EpochVotesInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -117,28 +116,28 @@ func (m *ListEpochVoteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *ListEpochVoteInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListEpochVoteInfo.Merge(m, src) +func (m *EpochVotesInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_EpochVotesInfo.Merge(m, src) } -func (m *ListEpochVoteInfo) XXX_Size() int { +func (m *EpochVotesInfo) XXX_Size() int { return m.Size() } -func (m *ListEpochVoteInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ListEpochVoteInfo.DiscardUnknown(m) +func (m *EpochVotesInfo) XXX_DiscardUnknown() { + xxx_messageInfo_EpochVotesInfo.DiscardUnknown(m) } -var xxx_messageInfo_ListEpochVoteInfo proto.InternalMessageInfo +var xxx_messageInfo_EpochVotesInfo proto.InternalMessageInfo -func (m *ListEpochVoteInfo) GetListEpochVoteInfo() []*EpochVoteInfo { +func (m *EpochVotesInfo) GetValidators() []ValidatorEpochVoteInfo { if m != nil { - return m.ListEpochVoteInfo + return m.Validators } return nil } func init() { - proto.RegisterType((*EpochVoteInfo)(nil), "auranw.aura.distribution.EpochVoteInfo") - proto.RegisterType((*ListEpochVoteInfo)(nil), "auranw.aura.distribution.ListEpochVoteInfo") + proto.RegisterType((*ValidatorEpochVoteInfo)(nil), "auranw.aura.distribution.ValidatorEpochVoteInfo") + proto.RegisterType((*EpochVotesInfo)(nil), "auranw.aura.distribution.EpochVotesInfo") } func init() { @@ -146,31 +145,30 @@ func init() { } var fileDescriptor_d863eda70fc0a961 = []byte{ - // 335 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0xc1, 0x4b, 0x3a, 0x41, - 0x14, 0xc7, 0x77, 0x7e, 0xca, 0x0f, 0x1a, 0xb3, 0x70, 0xf1, 0xb0, 0x18, 0xac, 0x62, 0x07, 0x3d, - 0xd4, 0x0c, 0xd8, 0xbd, 0x83, 0x50, 0x10, 0x74, 0x08, 0x0f, 0x12, 0x5d, 0x96, 0xd9, 0x75, 0xd4, - 0xa1, 0x75, 0xde, 0x32, 0xfb, 0xd4, 0xfa, 0x2f, 0xfa, 0x8b, 0x3a, 0x7b, 0xf4, 0xd8, 0x29, 0x42, - 0xff, 0x91, 0x98, 0x31, 0x31, 0x85, 0x4e, 0xef, 0xf1, 0xe1, 0xf3, 0xbe, 0xc3, 0xbc, 0x47, 0x9b, - 0x03, 0x95, 0xa3, 0x51, 0xf1, 0x14, 0x15, 0x68, 0x2e, 0x33, 0x48, 0xc6, 0xd1, 0x0c, 0x50, 0x46, - 0x4a, 0x0f, 0x81, 0x65, 0x06, 0x10, 0xfc, 0x40, 0x4c, 0x8d, 0xd0, 0x73, 0x66, 0x0b, 0xfb, 0xed, - 0xd7, 0xce, 0x50, 0xea, 0x81, 0x34, 0x13, 0xa5, 0x91, 0x8b, 0x38, 0x51, 0x1c, 0x5f, 0x33, 0x99, - 0x6f, 0xc6, 0x6a, 0xd5, 0x11, 0x8c, 0xc0, 0xb5, 0xdc, 0x76, 0x1b, 0xda, 0x7c, 0x27, 0xb4, 0x7c, - 0x63, 0x9f, 0xe9, 0x03, 0xca, 0x3b, 0x3d, 0x04, 0xff, 0x9a, 0x1e, 0xcd, 0x44, 0xaa, 0x06, 0x02, - 0xc1, 0x04, 0xa4, 0x41, 0xda, 0xa5, 0x4e, 0x8d, 0xed, 0x82, 0x99, 0x0d, 0x66, 0xfd, 0xad, 0xd1, - 0x2d, 0x2e, 0x3e, 0xeb, 0x5e, 0x6f, 0x37, 0xe2, 0xb7, 0xe8, 0x69, 0x66, 0x20, 0x83, 0x5c, 0x9a, - 0x28, 0x4e, 0x21, 0x79, 0xce, 0x83, 0x7f, 0x0d, 0xd2, 0x2e, 0xf4, 0x4e, 0xb6, 0xb8, 0xeb, 0xa8, - 0x7f, 0x4e, 0xcb, 0x22, 0x41, 0x35, 0x93, 0x5b, 0xad, 0xe0, 0xb4, 0xe3, 0x0d, 0xfc, 0x91, 0xea, - 0xb4, 0x84, 0x80, 0x22, 0x8d, 0x32, 0x98, 0x4b, 0x13, 0x14, 0x9d, 0x42, 0x1d, 0x7a, 0xb0, 0xa4, - 0x39, 0xa1, 0x95, 0x7b, 0x95, 0xe3, 0xfe, 0x1f, 0x1e, 0x69, 0x35, 0x55, 0x39, 0x46, 0x07, 0x0b, - 0x0c, 0x48, 0xa3, 0xd0, 0x2e, 0x75, 0x5a, 0xec, 0xaf, 0x0d, 0xb2, 0xbd, 0x98, 0x5e, 0x25, 0x3d, - 0x4c, 0xee, 0xde, 0x2e, 0x56, 0x21, 0x59, 0xae, 0x42, 0xf2, 0xb5, 0x0a, 0xc9, 0xdb, 0x3a, 0xf4, - 0x96, 0xeb, 0xd0, 0xfb, 0x58, 0x87, 0xde, 0xd3, 0xc5, 0x48, 0xe1, 0x78, 0x1a, 0xb3, 0x04, 0x26, - 0xdc, 0x06, 0x5f, 0xea, 0xb9, 0xab, 0xfc, 0x85, 0xef, 0x1d, 0xd5, 0xdd, 0x24, 0xfe, 0xef, 0xd6, - 0x7f, 0xf5, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x50, 0x55, 0x95, 0x2b, 0xf1, 0x01, 0x00, 0x00, + // 314 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x41, 0x4a, 0x03, 0x31, + 0x14, 0x86, 0x27, 0xb6, 0x88, 0x8d, 0x5a, 0x75, 0x10, 0x19, 0x14, 0x62, 0xa9, 0x0b, 0x0b, 0x6a, + 0x46, 0xf4, 0x04, 0x16, 0x14, 0xdc, 0x49, 0x17, 0x5d, 0xb8, 0x19, 0x32, 0x99, 0xb4, 0x0d, 0xd6, + 0x79, 0x21, 0x49, 0x5b, 0xbd, 0x85, 0x47, 0xf1, 0x18, 0x5d, 0x76, 0xe9, 0x4a, 0xa4, 0xbd, 0x88, + 0x24, 0x75, 0x86, 0x0a, 0xba, 0x7a, 0xc9, 0xff, 0x3e, 0x5e, 0xfe, 0xfc, 0x0f, 0x37, 0x33, 0x69, + 0xac, 0x96, 0xe9, 0xc8, 0x4a, 0xc8, 0x63, 0xa1, 0x80, 0x0f, 0x92, 0x31, 0x58, 0x91, 0xc8, 0xbc, + 0x07, 0x54, 0x69, 0xb0, 0x10, 0x46, 0x6c, 0xa4, 0x59, 0x3e, 0xa1, 0xae, 0xd0, 0x55, 0xfe, 0x70, + 0xbf, 0x0f, 0x7d, 0xf0, 0x50, 0xec, 0x4e, 0x4b, 0xbe, 0xf9, 0x8e, 0xf0, 0x41, 0x97, 0x0d, 0x65, + 0xc6, 0x2c, 0xe8, 0x5b, 0x37, 0xb2, 0x0b, 0x56, 0xdc, 0xe7, 0x3d, 0x08, 0xcf, 0xf0, 0xde, 0xb8, + 0xe8, 0x24, 0x2c, 0xcb, 0xb4, 0x30, 0x26, 0x42, 0x0d, 0xd4, 0xaa, 0x75, 0x76, 0xcb, 0xc6, 0xcd, + 0x52, 0x0f, 0x4f, 0xf1, 0x8e, 0xd2, 0xa0, 0xc0, 0x08, 0x9d, 0xa4, 0x43, 0xe0, 0x4f, 0x26, 0x5a, + 0x6b, 0xa0, 0x56, 0xa5, 0x53, 0x2f, 0xe4, 0xb6, 0x57, 0xc3, 0x13, 0xbc, 0xcd, 0xb8, 0x95, 0x63, + 0x51, 0x60, 0x15, 0x8f, 0x6d, 0x2d, 0xc5, 0x1f, 0xe8, 0x08, 0xd7, 0x18, 0xe7, 0x89, 0x82, 0x89, + 0xd0, 0x51, 0xd5, 0x03, 0x1b, 0x8c, 0xf3, 0x07, 0x77, 0x6f, 0x0e, 0x70, 0xbd, 0x34, 0x6a, 0xbc, + 0xd3, 0x2e, 0xc6, 0xa5, 0x21, 0x67, 0xb1, 0xd2, 0xda, 0xbc, 0xba, 0xa4, 0xff, 0x25, 0x41, 0xff, + 0xfe, 0x6f, 0xbb, 0x3a, 0xfd, 0x3c, 0x0e, 0x3a, 0x2b, 0x93, 0xda, 0x77, 0xd3, 0x39, 0x41, 0xb3, + 0x39, 0x41, 0x5f, 0x73, 0x82, 0xde, 0x16, 0x24, 0x98, 0x2d, 0x48, 0xf0, 0xb1, 0x20, 0xc1, 0xe3, + 0x79, 0x5f, 0xda, 0xc1, 0x28, 0xa5, 0x1c, 0x9e, 0x63, 0xf7, 0xc0, 0x45, 0x3e, 0xf1, 0x35, 0x7e, + 0x89, 0x7f, 0x2d, 0xc9, 0xbe, 0x2a, 0x61, 0xd2, 0x75, 0x9f, 0xf5, 0xf5, 0x77, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x45, 0xb9, 0x8d, 0x26, 0xc1, 0x01, 0x00, 0x00, } -func (m *EpochVoteInfo) Marshal() (dAtA []byte, err error) { +func (m *ValidatorEpochVoteInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -180,18 +178,18 @@ func (m *EpochVoteInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *EpochVoteInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *ValidatorEpochVoteInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *EpochVoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ValidatorEpochVoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.TotalPower != 0 { - i = encodeVarintEpochVoteInfo(dAtA, i, uint64(m.TotalPower)) + if m.AccPower != 0 { + i = encodeVarintEpochVoteInfo(dAtA, i, uint64(m.AccPower)) i-- dAtA[i] = 0x20 } @@ -205,20 +203,17 @@ func (m *EpochVoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEpochVoteInfo(dAtA, i, uint64(size)) + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintEpochVoteInfo(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *ListEpochVoteInfo) Marshal() (dAtA []byte, err error) { +func (m *EpochVotesInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -228,20 +223,20 @@ func (m *ListEpochVoteInfo) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ListEpochVoteInfo) MarshalTo(dAtA []byte) (int, error) { +func (m *EpochVotesInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ListEpochVoteInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EpochVotesInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ListEpochVoteInfo) > 0 { - for iNdEx := len(m.ListEpochVoteInfo) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Validators) > 0 { + for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.ListEpochVoteInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -266,34 +261,36 @@ func encodeVarintEpochVoteInfo(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *EpochVoteInfo) Size() (n int) { +func (m *ValidatorEpochVoteInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Validator.Size() - n += 1 + l + sovEpochVoteInfo(uint64(l)) + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovEpochVoteInfo(uint64(l)) + } if m.ProposerBlocks != 0 { n += 1 + sovEpochVoteInfo(uint64(m.ProposerBlocks)) } if m.ActiveBlocks != 0 { n += 1 + sovEpochVoteInfo(uint64(m.ActiveBlocks)) } - if m.TotalPower != 0 { - n += 1 + sovEpochVoteInfo(uint64(m.TotalPower)) + if m.AccPower != 0 { + n += 1 + sovEpochVoteInfo(uint64(m.AccPower)) } return n } -func (m *ListEpochVoteInfo) Size() (n int) { +func (m *EpochVotesInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.ListEpochVoteInfo) > 0 { - for _, e := range m.ListEpochVoteInfo { + if len(m.Validators) > 0 { + for _, e := range m.Validators { l = e.Size() n += 1 + l + sovEpochVoteInfo(uint64(l)) } @@ -307,7 +304,7 @@ func sovEpochVoteInfo(x uint64) (n int) { func sozEpochVoteInfo(x uint64) (n int) { return sovEpochVoteInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *EpochVoteInfo) Unmarshal(dAtA []byte) error { +func (m *ValidatorEpochVoteInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -330,17 +327,17 @@ func (m *EpochVoteInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EpochVoteInfo: wiretype end group for non-group") + return fmt.Errorf("proto: ValidatorEpochVoteInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EpochVoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ValidatorEpochVoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEpochVoteInfo @@ -350,24 +347,23 @@ func (m *EpochVoteInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEpochVoteInfo } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEpochVoteInfo } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { @@ -409,9 +405,9 @@ func (m *EpochVoteInfo) Unmarshal(dAtA []byte) error { } case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalPower", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AccPower", wireType) } - m.TotalPower = 0 + m.AccPower = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEpochVoteInfo @@ -421,7 +417,7 @@ func (m *EpochVoteInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TotalPower |= int64(b&0x7F) << shift + m.AccPower |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -447,7 +443,7 @@ func (m *EpochVoteInfo) Unmarshal(dAtA []byte) error { } return nil } -func (m *ListEpochVoteInfo) Unmarshal(dAtA []byte) error { +func (m *EpochVotesInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -470,15 +466,15 @@ func (m *ListEpochVoteInfo) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ListEpochVoteInfo: wiretype end group for non-group") + return fmt.Errorf("proto: EpochVotesInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ListEpochVoteInfo: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EpochVotesInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListEpochVoteInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -505,8 +501,8 @@ func (m *ListEpochVoteInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ListEpochVoteInfo = append(m.ListEpochVoteInfo, &EpochVoteInfo{}) - if err := m.ListEpochVoteInfo[len(m.ListEpochVoteInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Validators = append(m.Validators, ValidatorEpochVoteInfo{}) + if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/distribution/types/keys.go b/x/distribution/types/keys.go index 80e02d93..379bc91f 100644 --- a/x/distribution/types/keys.go +++ b/x/distribution/types/keys.go @@ -1,5 +1,5 @@ package types var ( - EpochVoteInfoKey = []byte{0x11} + EpochVotesInfoKey = []byte{0x11} ) From 16033cd3855d1be8649ef2f3b597089e79c4c710 Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Wed, 4 Jan 2023 17:51:35 +0700 Subject: [PATCH 07/12] fix lint --- x/distribution/abci.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/distribution/abci.go b/x/distribution/abci.go index b8f97212..53818414 100644 --- a/x/distribution/abci.go +++ b/x/distribution/abci.go @@ -31,7 +31,7 @@ func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k customdistkeepe } if bytes.Equal(previousVote.Validator.Address, valAddr.Bytes()) { proposerBlocks := lastVote.ProposerBlocks - if bytes.Compare(previousVote.Validator.Address, previousProposer.Bytes()) == 0 { + if bytes.Equal(previousVote.Validator.Address, previousProposer.Bytes()) { proposerBlocks += 1 } updateVote := types.ValidatorEpochVoteInfo{ From aa77804806ae977b844867505fccd3ff026563c8 Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Fri, 13 Jan 2023 15:03:54 +0700 Subject: [PATCH 08/12] Add e2e docker --- Makefile | 22 +++++++++++++++++++--- e2e.Dockerfile | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 e2e.Dockerfile diff --git a/Makefile b/Makefile index 8ac751d8..bd5c89c9 100644 --- a/Makefile +++ b/Makefile @@ -17,13 +17,26 @@ endif SDK_PACK := $(shell go list -m github.com/cosmos/cosmos-sdk | sed 's/ /\@/g') TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::') +build_tags = netgo +build_tags += $(BUILD_TAGS) +build_tags := $(strip $(build_tags)) + +whitespace := +empty = $(whitespace) $(whitespace) +comma := , +build_tags_comma_sep := $(subst $(empty),$(comma),$(build_tags)) + ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=aura \ -X github.com/cosmos/cosmos-sdk/version.AppName=aurad \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ - -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION) + -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION) \ + -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" -BUILD_FLAGS := -ldflags '$(ldflags)' +ldflags += -w -s +ldflags += -linkmode "external" -extldflags "-Wl,-z,muldefs -L/lib -lwasmvm_muslc -static" + +BUILD_FLAGS := -tags "$(build_tags_comma_sep)" -ldflags '$(ldflags)' all: build install @@ -33,7 +46,7 @@ install: go.sum build: go.sum @echo "--> Build aurad" - @go build -mod=readonly $(BUILD_FLAGS) -o ./build/aurad ./cmd/aurad + go build -mod=readonly $(BUILD_FLAGS) -o ./build/aurad ./cmd/aurad go.sum: go.mod @echo "--> Ensure dependencies have not been modified" @@ -41,3 +54,6 @@ go.sum: go.mod test: @go test -mod=readonly $(PACKAGES) + +clean: + @rm -rf build \ No newline at end of file diff --git a/e2e.Dockerfile b/e2e.Dockerfile new file mode 100644 index 00000000..bcf3aa33 --- /dev/null +++ b/e2e.Dockerfile @@ -0,0 +1,43 @@ +FROM golang:1.18.4-alpine3.15 as builder + +RUN set -eux; apk add --no-cache ca-certificates build-base; + +RUN apk add git + +COPY . /aura +WORKDIR /aura + +# See https://github.com/CosmWasm/wasmvm/releases +ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a +ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a +RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 9ecb037336bd56076573dc18c26631a9d2099a7f2b40dc04b6cae31ffb4c8f9a +RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 6e4de7ba9bad4ae9679c7f9ecf7e283dd0160e71567c6a7be6ae47c81ebe7f32 + +# Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc` +RUN cp "/lib/libwasmvm_muslc.$(uname -m).a" /lib/libwasmvm_muslc.a + +RUN make clean && make build VERBOSE=1 BUILD_TAGS=muslc + +RUN echo "Ensuring binary is statically linked ..." \ + && (file /aura/build/aurad | grep "statically linked") + +FROM golang:1.18.4-bullseye as ignite +ARG BUILD_ENV=dev + +RUN curl https://get.ignite.com/cli@v0.24.0! | bash + +COPY . /aura +WORKDIR /aura + +COPY config.yml config.yml +RUN ignite chain init + +FROM alpine:3.15 + +COPY --from=ignite /root/.aura /root/.aura +COPY --from=builder /aura/build/aurad /usr/bin/aurad + +# rest grpc p2p rpc +EXPOSE 1317 9090 26656 26657 + +CMD ["/usr/bin/aurad", "start"] \ No newline at end of file From db6c06bb0ae7ca7ff71fd5e36d1b70f46556482d Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Fri, 13 Jan 2023 17:11:40 +0700 Subject: [PATCH 09/12] Add test e2e module --- go.mod | 80 ++-- go.sum | 329 ++++++++++++-- tests/e2e/address.go | 33 ++ tests/e2e/chain.go | 124 ++++++ tests/e2e/e2e_distribution_test.go | 88 ++++ tests/e2e/e2e_encode_test.go | 50 +++ tests/e2e/e2e_exec_test.go | 662 +++++++++++++++++++++++++++++ tests/e2e/e2e_setup_test.go | 395 +++++++++++++++++ tests/e2e/e2e_staking_test.go | 59 +++ tests/e2e/e2e_test.go | 23 + tests/e2e/genesis.go | 32 ++ tests/e2e/http_util.go | 22 + tests/e2e/io.go | 44 ++ tests/e2e/keys.go | 20 + tests/e2e/query.go | 256 +++++++++++ tests/e2e/util.go | 52 +++ tests/e2e/validator.go | 318 ++++++++++++++ 17 files changed, 2514 insertions(+), 73 deletions(-) create mode 100644 tests/e2e/address.go create mode 100644 tests/e2e/chain.go create mode 100644 tests/e2e/e2e_distribution_test.go create mode 100644 tests/e2e/e2e_encode_test.go create mode 100644 tests/e2e/e2e_exec_test.go create mode 100644 tests/e2e/e2e_setup_test.go create mode 100644 tests/e2e/e2e_staking_test.go create mode 100644 tests/e2e/e2e_test.go create mode 100644 tests/e2e/genesis.go create mode 100644 tests/e2e/http_util.go create mode 100644 tests/e2e/io.go create mode 100644 tests/e2e/keys.go create mode 100644 tests/e2e/query.go create mode 100644 tests/e2e/util.go create mode 100644 tests/e2e/validator.go diff --git a/go.mod b/go.mod index 1fdceba0..207870d1 100644 --- a/go.mod +++ b/go.mod @@ -4,42 +4,46 @@ go 1.18 require ( github.com/CosmWasm/wasmd v0.29.1 - github.com/cosmos/cosmos-sdk v0.45.9 - github.com/cosmos/ibc-go/v3 v3.3.0 + github.com/cosmos/cosmos-sdk v0.45.11 + github.com/cosmos/ibc-go/v3 v3.4.0 github.com/gogo/protobuf v1.3.3 github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/prometheus/client_golang v1.13.0 github.com/spf13/cast v1.5.0 - github.com/spf13/cobra v1.5.0 - github.com/stretchr/testify v1.8.0 + github.com/spf13/cobra v1.6.1 + github.com/stretchr/testify v1.8.1 github.com/tendermint/starport v0.19.2 - github.com/tendermint/tendermint v0.34.21 + github.com/tendermint/tendermint v0.34.24 github.com/tendermint/tm-db v0.6.7 google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 google.golang.org/grpc v1.51.0 - google.golang.org/protobuf v1.28.1 + google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 ) require ( - filippo.io/edwards25519 v1.0.0-beta.2 // indirect + filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/keyring v1.2.1 // indirect + github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/CosmWasm/wasmvm v1.1.1 // indirect + github.com/Microsoft/go-winio v0.6.0 // indirect + github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect github.com/btcsuite/btcd v0.22.1 // indirect + github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect - github.com/coinbase/rosetta-sdk-go v0.7.0 // indirect + github.com/coinbase/rosetta-sdk-go v0.7.9 // indirect github.com/confio/ics23/go v0.7.0 // indirect + github.com/containerd/continuity v0.3.0 // indirect github.com/cosmos/btcutil v1.0.4 // indirect github.com/cosmos/cosmos-proto v1.0.0-alpha7 // indirect - github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogoproto v1.4.2 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect - github.com/cosmos/iavl v0.19.3 // indirect + github.com/cosmos/iavl v0.19.4 // indirect github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect github.com/cosmos/ledger-go v0.9.2 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect @@ -49,10 +53,14 @@ require ( github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect + github.com/docker/cli v20.10.14+incompatible // indirect + github.com/docker/docker v20.10.19+incompatible // indirect + github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect - github.com/fsnotify/fsnotify v1.5.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 @@ -61,34 +69,41 @@ require ( github.com/golang/glog v1.0.0 // 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/gofuzz v1.2.0 // indirect github.com/google/orderedcode v0.0.1 // indirect + github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect + github.com/gravity-devs/liquidity v1.5.3 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.1 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect - github.com/improbable-eng/grpc-web v0.14.1 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect + github.com/imdario/mergo v0.3.12 // indirect + github.com/improbable-eng/grpc-web v0.15.0 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect - github.com/klauspost/compress v1.15.9 // indirect + github.com/klauspost/compress v1.15.11 // indirect github.com/lib/pq v1.10.6 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.6 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect + github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.0-rc2 // indirect + github.com/opencontainers/runc v1.1.3 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect @@ -97,37 +112,48 @@ require ( github.com/prometheus/common v0.37.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/rakyll/statik v0.1.7 // indirect - github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rs/cors v1.8.2 // indirect github.com/rs/zerolog v1.27.0 // indirect - github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect - github.com/spf13/afero v1.8.2 // indirect + github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sirupsen/logrus v1.9.0 // indirect + github.com/spf13/afero v1.9.2 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/spf13/viper v1.13.0 // indirect + github.com/strangelove-ventures/packet-forward-middleware/v3 v3.0.0 // indirect github.com/subosito/gotenv v1.4.1 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tendermint/btcd v0.1.1 // indirect github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/zondax/hid v0.9.0 // indirect + github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect + github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect + github.com/xeipuuv/gojsonschema v1.2.0 // indirect + github.com/zondax/hid v0.9.1 // indirect go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect + golang.org/x/crypto v0.1.0 // indirect + golang.org/x/mod v0.6.0 // indirect golang.org/x/net v0.3.0 // indirect golang.org/x/sys v0.3.0 // indirect golang.org/x/term v0.3.0 // indirect golang.org/x/text v0.5.0 // indirect + golang.org/x/tools v0.2.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect ) require ( + cosmossdk.io/math v1.0.0-beta.4 github.com/armon/go-metrics v0.4.0 + github.com/cosmos/gaia/v8 v8.0.0-rc1 + github.com/cosmos/go-bip39 v1.0.0 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 + github.com/ory/dockertest/v3 v3.9.1 github.com/pkg/errors v0.9.1 github.com/regen-network/cosmos-proto v0.3.1 + github.com/spf13/viper v1.14.0 golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index f2897745..38a3ec4d 100644 --- a/go.sum +++ b/go.sum @@ -3,12 +3,14 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxo bitbucket.org/creachadair/shell v0.0.6/go.mod h1:8Qqi/cYk7vPnsOePHroKXDJYmb5x7ENhtiFtfZq8K+M= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.43.0/go.mod h1:BOSR3VbTLkk6FDC/TcffxP4NF/FFBGA5ku+jvKOP7pg= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -29,6 +31,7 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= 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/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/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= @@ -44,15 +47,24 @@ 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= +collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= +cosmossdk.io/math v1.0.0-beta.4 h1:JtKedVLGzA0vv84xjYmZ75RKG35Kf2WwcFu8IjRkIIw= +cosmossdk.io/math v1.0.0-beta.4/go.mod h1:An0MllWJY6PxibUpnwGk8jOm+a/qIxlKmL5Zyp9NnaM= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-beta.2 h1:/BZRNzm8N4K4eWfK28dL4yescorxtO7YG1yun8fy+pI= filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= +filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= +filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= +git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/AlecAivazis/survey/v2 v2.1.1/go.mod h1:9FJRdMdDm8rnT+zHVbvQT2RTSTLq0Ttd6q3Vl2fahjk= github.com/Antonboom/errname v0.1.4/go.mod h1:jRXo3m0E0EuCnK3wbsSVH3X55Z4iTDLl6ZfCxwFj4TM= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= @@ -86,9 +98,11 @@ github.com/CosmWasm/wasmd v0.29.1 h1:uagvdFfNYzkxUurKmVooHqkPqWo0dF+KvAzgUt4aOn0 github.com/CosmWasm/wasmd v0.29.1/go.mod h1:agYHzj3R0O+UExLHlXLuEfLqhIrCC+pF5ouAmbe9/68= github.com/CosmWasm/wasmvm v1.1.1 h1:0xtdrmmsP9fibe+x42WcMkp5aQ738BICgcH3FNVLzm4= github.com/CosmWasm/wasmvm v1.1.1/go.mod h1:ei0xpvomwSdONsxDuONzV7bL1jSET1M8brEx0FCXc+A= +github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= @@ -105,7 +119,8 @@ github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JP github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= +github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= +github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7-0.20190325164909-8abdbb8205e4/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= @@ -131,6 +146,7 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMx github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= +github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= @@ -141,6 +157,7 @@ github.com/adlio/schema v1.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQH github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= 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= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= github.com/alecthomas/chroma v0.8.2/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM= @@ -156,11 +173,13 @@ github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:C github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2/go.mod h1:jnzFpU88PccN/tPPhCpnNU8mZphvKxYM9lLNkd8e+os= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= +github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= @@ -185,6 +204,15 @@ github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= +github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= +github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= +github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= +github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= +github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= +github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -201,6 +229,8 @@ github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbz github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= github.com/briandowns/spinner v1.11.1/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= @@ -209,10 +239,14 @@ github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BR github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta/go.mod h1:ZSWyehm27aAuS9bvkATT+Xte3hjHZ+MRgMY/8NJ7K94= +github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= +github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= +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= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= @@ -231,11 +265,15 @@ github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7 github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= +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/calmh/randomart v1.1.0/go.mod h1:DQUbPVyP+7PAs21w/AnfMKG5NioxS3TbZ2F9MSK/jFM= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= +github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= @@ -254,6 +292,7 @@ github.com/charmbracelet/glow v1.4.0/go.mod h1:PmzpVs6fvXd60PmqRkbKtSz412SfDFPD3 github.com/chavacava/garif v0.0.0-20210405164556-e8a0a408d6af/go.mod h1:Qjyv4H3//PWVzTeCezG2b9IRn6myJxJSr4TD/xo6ojU= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= +github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chris-ramon/douceur v0.2.0/go.mod h1:wDW5xjJdeoMm1mRt4sD4c/LbF/mWdEpRXQKjTR8nIBE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -263,16 +302,23 @@ github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLI github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= +github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.6.10/go.mod h1:J/JFMsfcePrjJZkwQFLh+hJErkAmdm9Iyy3D5Y0LfXo= -github.com/coinbase/rosetta-sdk-go v0.7.0 h1:lmTO/JEpCvZgpbkOITL95rA80CPKb5CtMzLaqF2mCNg= -github.com/coinbase/rosetta-sdk-go v0.7.0/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE= +github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= +github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= +github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= +github.com/consensys/bavard v0.1.8-0.20210915155054-088da2f7f54a/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= +github.com/consensys/gnark-crypto v0.5.3/go.mod h1:hOdPlWQV1gDLp7faZVeg8Y0iEPFaOUnCc4XeCCk96p0= github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= @@ -292,6 +338,7 @@ github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= +github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= @@ -315,6 +362,7 @@ github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= +github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b/go.mod h1:jPQ2IAeZRCYxpS/Cm1495vGFww6ecHmMk1YJH2Q5ln0= @@ -385,10 +433,12 @@ github.com/cosmos/cosmos-sdk v0.44.2/go.mod h1:fwQJdw+aECatpTvQTo1tSfHEsxACdZYU8 github.com/cosmos/cosmos-sdk v0.44.3/go.mod h1:bA3+VenaR/l/vDiYzaiwbWvRPWHMBX2jG0ygiFtiBp0= github.com/cosmos/cosmos-sdk v0.44.4/go.mod h1:0QTCOkE8IWu5LZyfnbbjFjxYRIcV4pBOr7+zPpJwl58= github.com/cosmos/cosmos-sdk v0.44.5/go.mod h1:maUA6m2TBxOJZkbwl0eRtEBgTX37kcaiOWU5t1HEGaY= -github.com/cosmos/cosmos-sdk v0.45.9 h1:Z4s1EZL/mfM8uSSZr8WmyEbWp4hqbWVI5sAIFR432KY= -github.com/cosmos/cosmos-sdk v0.45.9/go.mod h1:Z5M4TX7PsHNHlF/1XanI2DIpORQ+Q/st7oaeufEjnvU= +github.com/cosmos/cosmos-sdk v0.45.11 h1:Pc44fFEkai0KXFND5Ys/2ZJkfVdstMIBzKBN8MY7Ll0= +github.com/cosmos/cosmos-sdk v0.45.11/go.mod h1:45z8Q1Ah4iypFycu2Kl4kBPIsQKUiND8G2CUX+HTtPM= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= +github.com/cosmos/gaia/v8 v8.0.0-rc1 h1:sBx/PtdGxbTLd59ttnj+LeK3gH4Rsumw02GMKNDmA0w= +github.com/cosmos/gaia/v8 v8.0.0-rc1/go.mod h1:PdpbqwHvREopJ3hAJL8+MFjOdJg2P1MA4K8nq9i3xlQ= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -402,12 +452,12 @@ github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mV github.com/cosmos/iavl v0.17.1/go.mod h1:7aisPZK8yCpQdy3PMvKeO+bhq1NwDjUwjzxwwROUxFk= github.com/cosmos/iavl v0.17.2/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= -github.com/cosmos/iavl v0.19.3 h1:cESO0OwTTxQm5rmyESKW+zESheDUYI7CcZDWWDwnuxg= -github.com/cosmos/iavl v0.19.3/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= +github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/ibc-go v1.2.2/go.mod h1:XmYjsRFOs6Q9Cz+CSsX21icNoH27vQKb3squgnCOCbs= github.com/cosmos/ibc-go/v2 v2.0.2/go.mod h1:XUmW7wmubCRhIEAGtMGS+5IjiSSmcAwihoN/yPGd6Kk= -github.com/cosmos/ibc-go/v3 v3.3.0 h1:r8gYUvQreMQrf4R5RgedK9gcbjLk4uE2q6fuZGjf4n0= -github.com/cosmos/ibc-go/v3 v3.3.0/go.mod h1:VUWLHw0C3USmTQZnTdkuXXdUdLbW8zsK3lV1Ieposog= +github.com/cosmos/ibc-go/v3 v3.4.0 h1:ha3cqEG36pqMWqA1D+kxDWBTZXpeFMd/aZIQF7I0xro= +github.com/cosmos/ibc-go/v3 v3.4.0/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= github.com/cosmos/interchain-accounts v0.1.0 h1:QmuwNsf1Hxl3P5GSGt7Z+JeuHPiZw4Z34R/038P5T6s= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= @@ -423,7 +473,11 @@ github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6V github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= @@ -433,13 +487,19 @@ github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3E github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= +github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= +github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= github.com/denis-tingajkin/go-header v0.4.2/go.mod h1:eLRHAVXzE5atsKAnNRDB90WHCFFnBUn4RN0nRcs1LJA= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= @@ -454,29 +514,40 @@ github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/Lu github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgrijalva/jwt-go v0.0.0-20170104182250-a601269ab70c/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/docker/cli v20.10.14+incompatible h1:dSBKJOVesDgHo7rbxlYjYsXe7gPzrTT+/cKQgpDAazg= +github.com/docker/cli v20.10.14+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v0.0.0-20190905152932-14b96e55d84c/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.19+incompatible h1:lzEmjivyNHFHMNAFLXORMBXyGIhw/UP4DvJwvyKYq64= +github.com/docker/docker v20.10.19+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= +github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac h1:opbrjaN/L8gg6Xh5D04Tem+8xVcz6ajZlGCs49mQgyg= @@ -488,6 +559,7 @@ github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= @@ -501,6 +573,7 @@ github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/esimonov/ifshort v1.0.2/go.mod h1:yZqNJUrNn20K8Q9n2CrjTKYyVEmX209Hgu+M1LBpeZE= github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= +github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= @@ -514,12 +587,15 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= @@ -530,13 +606,15 @@ github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3 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.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= github.com/fzipp/gocyclo v0.3.1/go.mod h1:DJHO6AUmbdqj2ET4Z9iArSuwWgYDRryYt2wASxc7x3E= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= +github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= @@ -544,6 +622,9 @@ github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +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= github.com/go-critic/go-critic v0.5.6/go.mod h1:cVjj0DfqewQVIlIAGexPCaGaZDAqGE29PYDDADIVNEo= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= @@ -573,6 +654,7 @@ github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dT github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= @@ -588,8 +670,11 @@ github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7a github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= 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.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= @@ -636,12 +721,17 @@ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+ github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= github.com/gogo/googleapis v1.4.0/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= +github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +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= @@ -690,6 +780,7 @@ github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9 github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= github.com/golangci/golangci-lint v1.42.1/go.mod h1:MuInrVlgg2jq4do6XI1jbkErbVHVbwdrLLtGv6p2wPI= +github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= @@ -701,6 +792,7 @@ github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs= +github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -714,7 +806,6 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v37 v37.0.0/go.mod h1:LM7in3NmXDrX58GbEHy7FtNLbI2JijX93RnMKvWG3m4= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -743,6 +834,8 @@ github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +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/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -787,6 +880,9 @@ github.com/gostaticanalysis/forcetypeassert v0.0.0-20200621232751-01d4955beaa5/g github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/gravity-devs/liquidity v1.5.3 h1:QbMHk1q+dzlM76Zv3vxaHhq4lBdhaelB0g7NmLbsv2Q= +github.com/gravity-devs/liquidity v1.5.3/go.mod h1:ULtNk738lNb1Kh31larCNxZ7IK21TeKZmNzS/OkE0hw= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -803,6 +899,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/grpc-ecosystem/grpc-gateway v1.14.7/go.mod h1:oYZKL012gGh6LMyg/xA7Q2yq6j8bu0wa+9w14EEthWU= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.1 h1:X2vfSnm1WC8HEo0MBHZg2TcuDUHJj6kd1TmEAQncnSA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.0.1/go.mod h1:oVMjMN64nzEcepv1kdZKgx1qNYt4Ro0Gqefiq2JWdis= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= @@ -816,6 +914,7 @@ github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -836,23 +935,28 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 h1:uUjLpLt6bVvZ72SQc/B4dXcPBw4Vgd7soowdRl52qEM= github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg= +github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= +github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A= +github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= +github.com/huin/goupnp v1.0.3-0.20220313090229-ca81a64b4204/go.mod h1:ZxNlw5WqJj6wSsRK5+YfflQGXYfccj5VgQsMNixHM7Y= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -863,15 +967,30 @@ github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/improbable-eng/grpc-web v0.14.1 h1:NrN4PY71A6tAz2sKDvC5JCauENWp0ykG8Oq1H3cpFvw= github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= +github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY= github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= +github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI= +github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/influxdata/influxql v1.1.1-0.20200828144457-65d3ef77d385/go.mod h1:gHp9y86a/pxhjJ+zMjNXiQAA197Xk9wLxaz+fGG+kWk= +github.com/influxdata/line-protocol v0.0.0-20180522152040-32c6aa80de5e/go.mod h1:4kt73NQhadE3daL3WhR5EJ/J2ocX0PZzwxQ0gXJ7oFE= +github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= +github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= +github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19ybifQhZoQNF5D8= +github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= +github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= +github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -909,14 +1028,18 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr 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= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.0.0-20210419104244-841f0c0fe66d/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= +github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= @@ -926,6 +1049,7 @@ github.com/kisielk/errcheck v1.6.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+NVZZA= +github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -933,8 +1057,11 @@ github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= -github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= +github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= +github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -954,8 +1081,11 @@ github.com/kulti/thelper v0.4.0/go.mod h1:vMu2Cizjy/grP+jmsvOFDx1kYP6+PD1lqg4Yu5 github.com/kunwardeep/paralleltest v1.0.2/go.mod h1:ZPqNm1fVHPllh5LPVujzbVz1JN2GhLxSfY+oqUsvG30= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= +github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= +github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/ldez/gomoddirectives v0.2.2/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= github.com/ldez/tagliatelle v0.2.0/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag= @@ -987,25 +1117,31 @@ github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GW github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= +github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -1015,6 +1151,8 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/mattn/go-zglob v0.0.3/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -1033,8 +1171,9 @@ github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7 github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a/go.mod h1:v8eSC2SMp9/7FTKUncp7fH9IwPfw+ysMObcEz5FWheQ= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= @@ -1052,9 +1191,11 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= +github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= @@ -1064,6 +1205,8 @@ github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2J github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= +github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae h1:O4SWKdcHVCvYqyDV+9CJA1fcDN2L11Bule0iFy3YlAI= +github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1071,11 +1214,13 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN 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/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= github.com/mozilla/scribe v0.0.0-20180711195314-fb71baf557c1/go.mod h1:FIczTrinKo8VaLxe6PWTPEXRXDIHz2QAwiaBaP5/4a8= github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s= 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= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/muesli/gitcha v0.2.0/go.mod h1:Ri8m9TZS4+ORG4JVmVKUQcWZuxDvUW3UKxMdQfzG2zI= @@ -1109,7 +1254,7 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/exhaustive v0.2.3/go.mod h1:bhIX678Nx8inLM9PbpvK1yv6oGtoP8BfaIeMzgBNKvc= github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ= @@ -1157,7 +1302,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799 h1:rc3tiVYb5z54aKaDfakKn0dDjIyPpTtszkjuMzyt7ec= +github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= +github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= @@ -1165,6 +1311,7 @@ github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rm github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= +github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -1175,9 +1322,11 @@ github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mo github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= +github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= @@ -1185,6 +1334,8 @@ github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh 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.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY= +github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= github.com/otiai10/copy v1.6.0/go.mod h1:XWfuS3CrI0R6IE0FbgHsEazaXO8G0LpMp9o8tos0x4E= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= @@ -1195,6 +1346,7 @@ github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIw github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -1207,10 +1359,12 @@ github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwb github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= +github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -1222,6 +1376,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -1298,13 +1453,15 @@ github.com/radovskyb/watcher v1.0.7/go.mod h1:78okwvY5wPdzcb1UYnip1pvrZNIVEIh/Cm github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rdegges/go-ipify v0.0.0-20150526035502-2d94a6a86c40/go.mod h1:j4c6zEU0eMG1oiZPUy+zD4ykX0NIpjZAEOEAviTWC18= github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= +github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= @@ -1314,8 +1471,8 @@ github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.6.2 h1:aIihoIOHCiLZHxyoNQ+ABL4NKhFTgKLBdMLyEAh98m0= github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= @@ -1338,19 +1495,24 @@ github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8 github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= -github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= +github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= +github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/securego/gosec/v2 v2.8.1/go.mod h1:pUmsq6+VyFEElJMUX+QB3p3LWNHXg1R3xh2ssVJPs8Q= github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= +github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= +github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/ksuid v1.0.3/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.21.7/go.mod h1:RGl11Y7XMTQPmHh8F0ayC6haKNBgH4PXMJuTAcMOlz4= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= @@ -1364,6 +1526,7 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= +github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -1380,8 +1543,8 @@ github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2 github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= +github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= +github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -1394,8 +1557,8 @@ github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHN github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= +github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= +github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -1410,13 +1573,15 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= -github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+zgdYw= +github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= +github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= github.com/ssgreg/nlreturn/v2 v2.1.0/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= +github.com/strangelove-ventures/packet-forward-middleware/v3 v3.0.0 h1:V1RVRa2hga4TV//RQpk2PCt314slS3N12024TsJoJUo= +github.com/strangelove-ventures/packet-forward-middleware/v3 v3.0.0/go.mod h1:sRBHb6KwuHQVc07vy8Ice9wUKVdvzn7eEms9scr2Zco= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= @@ -1424,11 +1589,13 @@ github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1437,16 +1604,18 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= 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-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= @@ -1466,8 +1635,8 @@ github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= github.com/tendermint/tendermint v0.34.13/go.mod h1:6RVVRBqwtKhA+H59APKumO+B7Nye4QXSFc6+TYxAxCI= github.com/tendermint/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/tendermint/tendermint v0.34.21 h1:UiGGnBFHVrZhoQVQ7EfwSOLuCtarqCSsRf8VrklqB7s= -github.com/tendermint/tendermint v0.34.21/go.mod h1:XDvfg6U7grcFTDx7VkzxnhazQ/bspGJAn4DZ6DcLLjQ= +github.com/tendermint/tendermint v0.34.24 h1:879MKKJWYYPJEMMKME+DWUTY4V9f/FBpnZDI82ky+4k= +github.com/tendermint/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= @@ -1476,12 +1645,20 @@ github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXO github.com/tendermint/vue v0.1.58/go.mod h1:Sg9MGPF+uY+SJ79sdZgtC2LnH+FDU2qWuiRxoZn5bmw= github.com/tetafro/godot v1.4.9/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= +github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= +github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= github.com/timakin/bodyclose v0.0.0-20200424151742-cb6215831a94/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= +github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= +github.com/tklauser/go-sysconf v0.3.5/go.mod h1:MkWzOF4RMCshBAMXuhXJs64Rte09mITnppBXY/rYEFI= github.com/tklauser/go-sysconf v0.3.7/go.mod h1:JZIdXh4RmBvZDBZ41ld2bGxRV3n4daiiqA3skYhAoQ4= +github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZFu0T9wgjM= github.com/tklauser/numcpus v0.2.3/go.mod h1:vpEPS/JC+oZGGQ/My/vJnNsvMDQL6PwOqt8dsCw5j+E= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -1505,9 +1682,12 @@ github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/uudashr/gocognit v1.0.5/go.mod h1:wgYz0mitoKOTysqxTDMOUXg+Jb5SvtihkfmugIZYpEA= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.16.0/go.mod h1:YOKImeEosDdBPnxc0gy7INqi3m1zK6A+xl6TwOBhHCA= +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= github.com/valyala/quicktemplate v1.6.3/go.mod h1:fwPzK2fHuYEODzJ9pkw0ipCPNHZ2tD5KW4lOuSdPKzY= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= @@ -1518,15 +1698,23 @@ github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmF github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vmihailenco/msgpack/v5 v5.1.4/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZGo8UTqP/9/XvLI= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= +github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= @@ -1544,8 +1732,9 @@ github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGj github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= +github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= +github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= @@ -1578,6 +1767,7 @@ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+ go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= @@ -1617,11 +1807,15 @@ 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-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/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.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +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= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= @@ -1635,6 +1829,7 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMk golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= +golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -1661,6 +1856,8 @@ 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 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1708,18 +1905,23 @@ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= @@ -1781,6 +1983,7 @@ golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1797,6 +2000,7 @@ golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200107162124-548cf772de50/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1825,6 +2029,7 @@ golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200817155316-9781c653f443/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1848,10 +2053,12 @@ golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1860,13 +2067,20 @@ golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/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-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.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1892,9 +2106,12 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/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/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1933,6 +2150,7 @@ golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20191224055732-dd894d0a8a40/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1995,10 +2213,18 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= +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= +gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -2044,6 +2270,7 @@ google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190522204451-c2c4e71fbf69/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -2052,6 +2279,7 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= @@ -2076,6 +2304,7 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -2098,6 +2327,7 @@ google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37 h1:jmIfw8+gSvXcZSg google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= 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= @@ -2112,8 +2342,8 @@ google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX7 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.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= +google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= 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= @@ -2121,8 +2351,9 @@ gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= @@ -2162,9 +2393,11 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +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.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= 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= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2172,6 +2405,7 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= honnef.co/go/tools v0.2.1/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= @@ -2206,12 +2440,15 @@ 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.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= 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= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/tests/e2e/address.go b/tests/e2e/address.go new file mode 100644 index 00000000..33079aa8 --- /dev/null +++ b/tests/e2e/address.go @@ -0,0 +1,33 @@ +package e2e + +import ( + "fmt" + "math/rand" + "strconv" + + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + crypto "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// HDPath generates an HD path based on the wallet index +func HDPath(index int) string { + return fmt.Sprintf("m/44'/118'/0'/0/%d", index) +} + +// PubKey returns a sample account PubKey +func PubKey() crypto.PubKey { + seed := []byte(strconv.Itoa(rand.Int())) + return ed25519.GenPrivKeyFromSecret(seed).PubKey() +} + +// AccAddress returns a sample account address +func AccAddress() sdk.AccAddress { + addr := PubKey().Address() + return sdk.AccAddress(addr) +} + +// Address returns a sample string account address +func Address() string { + return AccAddress().String() +} diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go new file mode 100644 index 00000000..4e346824 --- /dev/null +++ b/tests/e2e/chain.go @@ -0,0 +1,124 @@ +package e2e + +import ( + "fmt" + "os" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + tmrand "github.com/tendermint/tendermint/libs/rand" + + gaia "github.com/cosmos/gaia/v8/app" + "github.com/cosmos/gaia/v8/app/params" +) + +const ( + keyringPassphrase = "testpassphrase" + keyringAppName = "testnet" +) + +var ( + encodingConfig params.EncodingConfig + cdc codec.Codec + txConfig client.TxConfig +) + +func init() { + encodingConfig = gaia.MakeTestEncodingConfig() + authvesting.RegisterInterfaces(encodingConfig.InterfaceRegistry) + stakingtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + evidencetypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + cdc = encodingConfig.Codec + txConfig = encodingConfig.TxConfig +} + +type chain struct { + dataDir string + id string + validators []*validator + accounts []*account //nolint:unused + // initial accounts in genesis + genesisAccounts []*account + genesisVestingAccounts map[string]sdk.AccAddress +} + +func newChain() (*chain, error) { + tmpDir, err := os.MkdirTemp("", "aurad-e2e-testnet-") + if err != nil { + return nil, err + } + + return &chain{ + id: "chain-" + tmrand.Str(6), + dataDir: tmpDir, + }, nil +} + +func (c *chain) configDir() string { + return fmt.Sprintf("%s/%s", c.dataDir, c.id) +} + +func (c *chain) createAndInitValidators(count int) error { + for i := 0; i < count; i++ { + node := c.createValidator(i) + + // generate genesis files + if err := node.init(); err != nil { + return err + } + + c.validators = append(c.validators, node) + + // create keys + if err := node.createKey("val"); err != nil { + return err + } + if err := node.createNodeKey(); err != nil { + return err + } + if err := node.createConsensusKey(); err != nil { + return err + } + } + + return nil +} + +func (c *chain) createAndInitValidatorsWithMnemonics(count int, mnemonics []string) error { //nolint:unused // this is called during e2e tests + for i := 0; i < count; i++ { + // create node + node := c.createValidator(i) + + // generate genesis files + if err := node.init(); err != nil { + return err + } + + c.validators = append(c.validators, node) + + // create keys + if err := node.createKeyFromMnemonic("val", mnemonics[i]); err != nil { + return err + } + if err := node.createNodeKey(); err != nil { + return err + } + if err := node.createConsensusKey(); err != nil { + return err + } + } + + return nil +} + +func (c *chain) createValidator(index int) *validator { + return &validator{ + chain: c, + index: index, + moniker: fmt.Sprintf("%s-gaia-%d", c.id, index), + } +} diff --git a/tests/e2e/e2e_distribution_test.go b/tests/e2e/e2e_distribution_test.go new file mode 100644 index 00000000..7f7f41da --- /dev/null +++ b/tests/e2e/e2e_distribution_test.go @@ -0,0 +1,88 @@ +package e2e + +import ( + "fmt" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (s *IntegrationTestSuite) testDistribution() { + chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + + validatorB := s.chainA.validators[1] + validatorBAddr := validatorB.keyInfo.GetAddress() + + valOperAddressA := sdk.ValAddress(validatorBAddr).String() + + delegatorAddress := s.chainA.genesisAccounts[2].keyInfo.GetAddress().String() + + newWithdrawalAddress := s.chainA.genesisAccounts[3].keyInfo.GetAddress().String() + fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1000)) + + beforeBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uatomDenom) + s.Require().NoError(err) + if beforeBalance.IsNil() { + beforeBalance = sdk.NewCoin(uatomDenom, sdk.NewInt(0)) + } + + s.execSetWithdrawAddress(s.chainA, 0, fees.String(), delegatorAddress, newWithdrawalAddress, gaiaHomePath) + + // Verify + s.Require().Eventually( + func() bool { + res, err := queryDelegatorWithdrawalAddress(chainEndpoint, delegatorAddress) + s.Require().NoError(err) + + return res.WithdrawAddress == newWithdrawalAddress + }, + 10*time.Second, + 5*time.Second, + ) + + s.execWithdrawReward(s.chainA, 0, delegatorAddress, valOperAddressA, gaiaHomePath) + s.Require().Eventually( + func() bool { + afterBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uatomDenom) + s.Require().NoError(err) + + return afterBalance.IsGTE(beforeBalance) + }, + 10*time.Second, + 5*time.Second, + ) +} + +/* +fundCommunityPool tests the funding of the community pool on behalf of the distribution module. +Test Benchmarks: +1. Validation that balance of the distribution module account before funding +2. Execution funding the community pool +3. Verification that correct funds have been deposited to distribution module account +*/ +func (s *IntegrationTestSuite) fundCommunityPool() { + chainAAPIEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + sender := s.chainA.validators[0].keyInfo.GetAddress() + + beforeDistUatomBalance, _ := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) + if beforeDistUatomBalance.IsNil() { + // Set balance to 0 if previous balance does not exist + beforeDistUatomBalance = sdk.NewInt64Coin(uatomDenom, 0) + } + + s.execDistributionFundCommunityPool(s.chainA, 0, sender.String(), tokenAmount.String(), standardFees.String()) + + // there are still tokens being added to the community pool through block production rewards but they should be less than 500 tokens + marginOfErrorForBlockReward := sdk.NewInt64Coin(uatomDenom, 500) + + s.Require().Eventually( + func() bool { + afterDistPhotonBalance, err := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) + s.Require().NoErrorf(err, "Error getting balance: %s", afterDistPhotonBalance) + + return afterDistPhotonBalance.Sub(beforeDistUatomBalance.Add(tokenAmount.Add(standardFees))).IsLT(marginOfErrorForBlockReward) + }, + 15*time.Second, + 5*time.Second, + ) +} diff --git a/tests/e2e/e2e_encode_test.go b/tests/e2e/e2e_encode_test.go new file mode 100644 index 00000000..073c6e2a --- /dev/null +++ b/tests/e2e/e2e_encode_test.go @@ -0,0 +1,50 @@ +package e2e + +import ( + "encoding/base64" + "path/filepath" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +const ( + rawTxFile = "tx_raw.json" +) + +func (s *IntegrationTestSuite) testEncode() { + chain := s.chainA + _, encoded, err := buildRawTx() + s.Require().NoError(err) + + got := s.execEncode(chain, filepath.Join(gaiaHomePath, rawTxFile)) + s.T().Logf("encoded tx: %s", got) + s.Require().Equal(encoded, got) +} + +func (s *IntegrationTestSuite) testDecode() { + chain := s.chainA + rawTx, encoded, err := buildRawTx() + s.Require().NoError(err) + + got := s.execDecode(chain, encoded) + s.T().Logf("raw tx: %s", got) + s.Require().Equal(string(rawTx), got) +} + +// buildRawTx build a dummy tx using the TxBuilder and +// return the JSON and encoded tx's +func buildRawTx() ([]byte, string, error) { + builder := txConfig.NewTxBuilder() + builder.SetGasLimit(gas) + builder.SetFeeAmount(sdk.NewCoins(standardFees)) + builder.SetMemo("foomemo") + tx, err := txConfig.TxJSONEncoder()(builder.GetTx()) + if err != nil { + return nil, "", err + } + txBytes, err := txConfig.TxEncoder()(builder.GetTx()) + if err != nil { + return nil, "", err + } + return tx, base64.StdEncoding.EncodeToString(txBytes), err +} diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go new file mode 100644 index 00000000..d3c0f533 --- /dev/null +++ b/tests/e2e/e2e_exec_test.go @@ -0,0 +1,662 @@ +//nolint:unused +package e2e + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "strconv" + "strings" + "time" + + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + "github.com/cosmos/cosmos-sdk/x/feegrant" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ory/dockertest/v3/docker" +) + +const ( + flagFrom = "from" + flagHome = "home" + flagFees = "fees" + flagGas = "gas" + flagOutput = "output" + flagChainID = "chain-id" + flagSpendLimit = "spend-limit" + flagGasAdjustment = "gas-adjustment" + flagBroadcastMode = "broadcast-mode" + flagKeyringBackend = "keyring-backend" +) + +type flagOption func(map[string]interface{}) + +// withKeyValue add a new flag to command +func withKeyValue(key string, value interface{}) flagOption { + return func(o map[string]interface{}) { + o[key] = value + } +} + +func applyOptions(chainID string, options []flagOption) map[string]interface{} { + opts := map[string]interface{}{ + flagKeyringBackend: "test", + flagOutput: "json", + flagGas: "auto", + flagFrom: "alice", + flagBroadcastMode: "sync", + flagGasAdjustment: "1.5", + flagChainID: chainID, + flagHome: gaiaHomePath, + flagFees: standardFees.String(), + } + for _, apply := range options { + apply(opts) + } + return opts +} + +func (s *IntegrationTestSuite) execEncode( + c *chain, + txPath string, + opt ...flagOption, +) string { + opts := applyOptions(c.id, opt) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("%s - Executing gaiad encoding with %v", c.id, txPath) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + "encode", + txPath, + } + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + var encoded string + s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { + if stdErr != nil { + return false + } + encoded = strings.TrimSuffix(string(stdOut), "\n") + return true + }) + s.T().Logf("successfully encode with %v", txPath) + return encoded +} + +func (s *IntegrationTestSuite) execDecode( + c *chain, + txPath string, + opt ...flagOption, +) string { + opts := applyOptions(c.id, opt) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("%s - Executing gaiad decoding with %v", c.id, txPath) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + "decode", + txPath, + } + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + var decoded string + s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { + if stdErr != nil { + return false + } + decoded = strings.TrimSuffix(string(stdOut), "\n") + return true + }) + s.T().Logf("successfully decode %v", txPath) + return decoded +} + +func (s *IntegrationTestSuite) execVestingTx( + c *chain, + method string, + args []string, + opt ...flagOption, +) { + opts := applyOptions(c.id, opt) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("%s - Executing gaiad %s with %v", c.id, method, args) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + vestingtypes.ModuleName, + method, + "-y", + } + gaiaCommand = append(gaiaCommand, args...) + + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) + s.T().Logf("successfully %s with %v", method, args) +} + +func (s *IntegrationTestSuite) execCreatePeriodicVestingAccount( + c *chain, + address, + jsonPath string, + opt ...flagOption, +) { + s.T().Logf("Executing gaiad create periodic vesting account %s", c.id) + s.execVestingTx(c, "create-periodic-vesting-account", []string{address, jsonPath}, opt...) + s.T().Logf("successfully created periodic vesting account %s with %s", address, jsonPath) +} + +func (s *IntegrationTestSuite) execUnjail( + c *chain, + opt ...flagOption, +) { + opts := applyOptions(c.id, opt) + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad slashing unjail %s with options: %v", c.id, opt) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + slashingtypes.ModuleName, + "unjail", + "-y", + } + + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) + s.T().Logf("successfully unjail with options %v", opt) +} + +func (s *IntegrationTestSuite) execFeeGrant(c *chain, valIdx int, granter, grantee, spendLimit string, opt ...flagOption) { + opt = append(opt, withKeyValue(flagFrom, granter)) + opt = append(opt, withKeyValue(flagSpendLimit, spendLimit)) + opts := applyOptions(c.id, opt) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("granting %s fee from %s on chain %s", grantee, granter, c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + feegrant.ModuleName, + "grant", + granter, + grantee, + "-y", + } + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +} + +func (s *IntegrationTestSuite) execFeeGrantRevoke(c *chain, valIdx int, granter, grantee string, opt ...flagOption) { + opt = append(opt, withKeyValue(flagFrom, granter)) + opts := applyOptions(c.id, opt) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("revoking %s fee grant from %s on chain %s", grantee, granter, c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + feegrant.ModuleName, + "revoke", + granter, + grantee, + "-y", + } + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) +} + +func (s *IntegrationTestSuite) execBankSend( + c *chain, + valIdx int, + from, + to, + amt, + fees string, + expectErr bool, + opt ...flagOption, +) { + // TODO remove the hardcode opt after refactor, all methods should accept custom flags + opt = append(opt, withKeyValue(flagFees, fees)) + opt = append(opt, withKeyValue(flagFrom, from)) + opts := applyOptions(c.id, opt) + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("sending %s tokens from %s to %s on chain %s", amt, from, to, c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + banktypes.ModuleName, + "send", + from, + to, + amt, + "-y", + } + for flag, value := range opts { + gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) +} + +type txBankSend struct { + from string + to string + amt string + fees string + log string + expectErr bool +} + +func (s *IntegrationTestSuite) execBankSendBatch( + c *chain, + valIdx int, //nolint:unparam + txs ...txBankSend, +) int { + sucessBankSendCount := 0 + + for i := range txs { + s.T().Logf(txs[i].log) + + s.execBankSend(c, valIdx, txs[i].from, txs[i].to, txs[i].amt, txs[i].fees, txs[i].expectErr) + if !txs[i].expectErr { + if !txs[i].expectErr { + sucessBankSendCount++ + } + } + } + + return sucessBankSendCount +} + +func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, payee, fees string, expectErr bool) { //nolint:unparam + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + distributiontypes.ModuleName, + "withdraw-all-rewards", + fmt.Sprintf("--%s=%s", flags.FlagFrom, payee), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + "--keyring-backend=test", + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) +} + +func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valIdx int, from, amt, fees string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx distribution fund-community-pool on chain %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + distributiontypes.ModuleName, + "fund-community-pool", + amt, + fmt.Sprintf("--%s=%s", flags.FlagFrom, from), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagFees, fees), + "--keyring-backend=test", + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("Successfully funded community pool") +} + +func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, govCommand string, proposalFlags []string, fees string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + govtypes.ModuleName, + govCommand, + } + + generalFlags := []string{ + fmt.Sprintf("--%s=%s", flags.FlagFrom, submitterAddr), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + "--keyring-backend=test", + "--output=json", + "-y", + } + + gaiaCommand = concatFlags(gaiaCommand, proposalFlags, generalFlags) + + s.T().Logf("Executing gaiad tx gov %s on chain %s", govCommand, c.id) + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("Successfully executed %s", govCommand) +} + +func (s *IntegrationTestSuite) executeGKeysAddCommand(c *chain, valIdx int, name string, home string) string { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + gaiaCommand := []string{ + gaiadBinary, + keysCommand, + "add", + name, + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--keyring-backend=test", + "--output=json", + } + + var addrRecord AddressResponse + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { + // Gaiad keys add by default returns payload to stdErr + if err := json.Unmarshal(stdErr, &addrRecord); err != nil { + return false + } + return strings.Contains(addrRecord.Address, "aura") + }) + return addrRecord.Address +} + +func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + gaiaCommand := []string{ + gaiadBinary, + keysCommand, + "list", + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func([]byte, []byte) bool { + return true + }) +} + +func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, valOperAddress, delegatorAddr, home, delegateFees string) { //nolint:unparam + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx staking delegate %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + stakingtypes.ModuleName, + "delegate", + valOperAddress, + amount, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGas, "auto"), + fmt.Sprintf("--%s=%s", flags.FlagFees, delegateFees), + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("%s successfully delegated %s to %s", delegatorAddr, amount, valOperAddress) +} + +func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, originalValOperAddress, + newValOperAddress, delegatorAddr, home, delegateFees string, +) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Executing gaiad tx staking redelegate %s", c.id) + + gaiaCommand := []string{ + gaiadBinary, + txCommand, + stakingtypes.ModuleName, + "redelegate", + originalValOperAddress, + newValOperAddress, + amount, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddr), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagGas, "auto"), + fmt.Sprintf("--%s=%s", flags.FlagFees, delegateFees), + "--keyring-backend=test", + fmt.Sprintf("--%s=%s", flags.FlagHome, home), + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("%s successfully redelegated %s from %s to %s", delegatorAddr, amount, originalValOperAddress, newValOperAddress) +} + +func (s *IntegrationTestSuite) getLatestBlockHeight(c *chain, valIdx int) int { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + type syncInfo struct { + SyncInfo struct { + LatestHeight string `json:"latest_block_height"` + } `json:"SyncInfo"` + } + + var currentHeight int + gaiaCommand := []string{gaiadBinary, "status"} + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { + var ( + err error + block syncInfo + ) + s.Require().NoError(json.Unmarshal(stdErr, &block)) + currentHeight, err = strconv.Atoi(block.SyncInfo.LatestHeight) + s.Require().NoError(err) + return currentHeight > 0 + }) + return currentHeight +} + +func (s *IntegrationTestSuite) verifyBalanceChange(endpoint string, expectedAmount sdk.Coin, recipientAddress string) { + s.Require().Eventually( + func() bool { + afterAtomBalance, err := getSpecificBalance(endpoint, recipientAddress, uatomDenom) + s.Require().NoError(err) + + return afterAtomBalance.IsEqual(expectedAmount) + }, + 20*time.Second, + 5*time.Second, + ) +} + +func (s *IntegrationTestSuite) execSetWithdrawAddress( + c *chain, + valIdx int, + fees, + delegatorAddress, + newWithdrawalAddress, + homePath string, +) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Setting distribution withdrawal address on chain %s for %s to %s", c.id, delegatorAddress, newWithdrawalAddress) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + distributiontypes.ModuleName, + "set-withdraw-addr", + newWithdrawalAddress, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, fees), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), + "--keyring-backend=test", + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("Successfully set new distribution withdrawal address for %s to %s", delegatorAddress, newWithdrawalAddress) +} + +func (s *IntegrationTestSuite) execWithdrawReward( + c *chain, + valIdx int, + delegatorAddress, + validatorAddress, + homePath string, +) { + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + s.T().Logf("Withdrawing distribution rewards on chain %s for delegator %s from %s validator", c.id, delegatorAddress, validatorAddress) + gaiaCommand := []string{ + gaiadBinary, + txCommand, + distributiontypes.ModuleName, + "withdraw-rewards", + validatorAddress, + fmt.Sprintf("--%s=%s", flags.FlagFrom, delegatorAddress), + fmt.Sprintf("--%s=%s", flags.FlagGasPrices, "300uatom"), + fmt.Sprintf("--%s=%s", flags.FlagGas, "auto"), + fmt.Sprintf("--%s=%s", flags.FlagGasAdjustment, "1.5"), + fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), + fmt.Sprintf("--%s=%s", flags.FlagHome, homePath), + "--keyring-backend=test", + "--output=json", + "-y", + } + + s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("Successfully withdrew distribution rewards for delegator %s from validator %s", delegatorAddress, validatorAddress) +} + +func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chain, gaiaCommand []string, valIdx int, validation func([]byte, []byte) bool) { + if validation == nil { + validation = s.defaultExecValidation(s.chainA, 0) + } + var ( + outBuf bytes.Buffer + errBuf bytes.Buffer + ) + exec, err := s.dkrPool.Client.CreateExec(docker.CreateExecOptions{ + Context: ctx, + AttachStdout: true, + AttachStderr: true, + Container: s.valResources[c.id][valIdx].Container.ID, + User: "nonroot", + Cmd: gaiaCommand, + }) + s.Require().NoError(err) + + err = s.dkrPool.Client.StartExec(exec.ID, docker.StartExecOptions{ + Context: ctx, + Detach: false, + OutputStream: &outBuf, + ErrorStream: &errBuf, + }) + s.Require().NoError(err) + + stdOut := outBuf.Bytes() + stdErr := errBuf.Bytes() + if !validation(stdOut, stdErr) { + s.Require().FailNowf("tx validation failed", "stdout: %s, stderr: %s", + string(stdOut), string(stdErr)) + } +} + +func (s *IntegrationTestSuite) expectErrExecValidation(chain *chain, valIdx int, expectErr bool) func([]byte, []byte) bool { + return func(stdOut []byte, stdErr []byte) bool { + var txResp sdk.TxResponse + gotErr := cdc.UnmarshalJSON(stdOut, &txResp) != nil + if gotErr { + s.Require().True(expectErr) + } + + endpoint := fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) + // wait for the tx to be committed on chain + s.Require().Eventuallyf( + func() bool { + gotErr := queryGaiaTx(endpoint, txResp.TxHash) != nil + return gotErr == expectErr + }, + time.Minute, + 5*time.Second, + "stdOut: %s, stdErr: %s", + string(stdOut), string(stdErr), + ) + return true + } +} + +func (s *IntegrationTestSuite) defaultExecValidation(chain *chain, valIdx int) func([]byte, []byte) bool { + return func(stdOut []byte, stdErr []byte) bool { + var txResp sdk.TxResponse + if err := cdc.UnmarshalJSON(stdOut, &txResp); err != nil { + return false + } + if strings.Contains(txResp.String(), "code: 0") || txResp.Code == 0 { + endpoint := fmt.Sprintf("http://%s", s.valResources[chain.id][valIdx].GetHostPort("1317/tcp")) + s.Require().Eventually( + func() bool { + return queryGaiaTx(endpoint, txResp.TxHash) == nil + }, + time.Minute, + 5*time.Second, + "stdOut: %s, stdErr: %s", + string(stdOut), string(stdErr), + ) + return true + } + return false + } +} diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go new file mode 100644 index 00000000..be24d88d --- /dev/null +++ b/tests/e2e/e2e_setup_test.go @@ -0,0 +1,395 @@ +package e2e + +import ( + "context" + "encoding/json" + "fmt" + "github.com/davecgh/go-spew/spew" + "os" + "os/exec" + "path/filepath" + "strconv" + "strings" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/server" + srvconfig "github.com/cosmos/cosmos-sdk/server/config" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + ibcclienttypes "github.com/cosmos/ibc-go/v3/modules/core/02-client/types" + ibcchanneltypes "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types" + "github.com/ory/dockertest/v3" + "github.com/ory/dockertest/v3/docker" + "github.com/spf13/viper" + "github.com/stretchr/testify/suite" + tmconfig "github.com/tendermint/tendermint/config" + tmjson "github.com/tendermint/tendermint/libs/json" + rpchttp "github.com/tendermint/tendermint/rpc/client/http" + + "github.com/cosmos/gaia/v8/app/params" +) + +const ( + gaiadBinary = "/usr/bin/aurad" + txCommand = "tx" + keysCommand = "keys" + gaiaHomePath = "/root/.aura" + uatomDenom = "uatom" + initBalanceStr = "110000000000uaura,100000000000000000uaura,100000000000000000uaura" + minGasPrice = "0.00001" + initialGlobalFeeAmt = "0.00001" + gas = 200000 + numberOfEvidences = 10 +) + +var ( + gaiaConfigPath = filepath.Join(gaiaHomePath, "config") + stakingAmount = sdk.NewInt(100000000000) + stakingAmountCoin = sdk.NewCoin(uatomDenom, stakingAmount) + tokenAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(3300000000)) // 3,300uatom + standardFees = sdk.NewCoin(uatomDenom, sdk.NewInt(330000)) // 0.33uatom + depositAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(10000000)) // 10uatom + distModuleAddress = authtypes.NewModuleAddress(distrtypes.ModuleName).String() + proposalCounter = 0 +) + +type IntegrationTestSuite struct { + suite.Suite + + tmpDirs []string + chainA *chain + dkrPool *dockertest.Pool + dkrNet *dockertest.Network + + valResources map[string][]*dockertest.Resource +} + +type AddressResponse struct { + Name string `json:"name"` + Type string `json:"type"` + Address string `json:"address"` + Mnemonic string `json:"mnemonic"` +} + +func TestIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) +} + +func (s *IntegrationTestSuite) SetupSuite() { + s.T().Log("setting up e2e integration test suite...") + + var err error + s.chainA, err = newChain() + s.Require().NoError(err) + + s.dkrPool, err = dockertest.NewPool("") + s.Require().NoError(err) + + s.dkrNet, err = s.dkrPool.CreateNetwork(fmt.Sprintf("%s-testnet", s.chainA.id)) + s.Require().NoError(err) + + s.valResources = make(map[string][]*dockertest.Resource) + + s.T().Logf("starting e2e infrastructure for chain A; chain-id: %s; datadir: %s", s.chainA.id, s.chainA.dataDir) + s.initNodes(s.chainA) + s.initGenesis(s.chainA) + s.initValidatorConfigs(s.chainA) + s.runValidators(s.chainA, 0) + time.Sleep(10 * time.Second) + +} + +func (s *IntegrationTestSuite) TearDownSuite() { + if str := os.Getenv("GAIA_E2E_SKIP_CLEANUP"); len(str) > 0 { + skipCleanup, err := strconv.ParseBool(str) + s.Require().NoError(err) + + if skipCleanup { + return + } + } + + s.T().Log("tearing down e2e integration test suite...") + + for _, vr := range s.valResources { + for _, r := range vr { + s.Require().NoError(s.dkrPool.Purge(r)) + } + } + + s.Require().NoError(s.dkrPool.RemoveNetwork(s.dkrNet)) + + os.RemoveAll(s.chainA.dataDir) + + for _, td := range s.tmpDirs { + os.RemoveAll(td) + } +} + +func (s *IntegrationTestSuite) initNodes(c *chain) { + s.Require().NoError(c.createAndInitValidators(1)) + /* Adding 4 accounts to val0 local directory + c.genesisAccounts[0]: Relayer Wallet + c.genesisAccounts[1]: ICA Owner + c.genesisAccounts[2]: Test Account 1 + c.genesisAccounts[3]: Test Account 2 + */ + s.Require().NoError(c.addAccountFromMnemonic(4)) + // Initialize a genesis file for the first validator + val0ConfigDir := c.validators[0].configDir() + var addrAll []sdk.AccAddress + for _, val := range c.validators { + address := val.keyInfo.GetAddress() + addrAll = append(addrAll, address) + } + + for _, addr := range c.genesisAccounts { + acctAddr := addr.keyInfo.GetAddress() + addrAll = append(addrAll, acctAddr) + } + + // copy the genesis file to the remaining validators + for _, val := range c.validators[1:] { + _, err := copyFile( + filepath.Join(val0ConfigDir, "config", "genesis.json"), + filepath.Join(val.configDir(), "config", "genesis.json"), + ) + s.Require().NoError(err) + } +} + +// TODO find a better way to manipulate accounts to add genesis accounts + +func (s *IntegrationTestSuite) initGenesis(c *chain) { + var ( + serverCtx = server.NewDefaultContext() + config = serverCtx.Config + validator = c.validators[0] + ) + + config.SetRoot(validator.configDir()) + config.Moniker = validator.moniker + + genFilePath := config.GenesisFile() + appGenState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFilePath) + s.Require().NoError(err) + + //var evidenceGenState evidencetypes.GenesisState + //s.Require().NoError(cdc.UnmarshalJSON(appGenState[evidencetypes.ModuleName], &evidenceGenState)) + // + //evidenceGenState.Evidence = make([]*codectypes.Any, numberOfEvidences) + //for i := range evidenceGenState.Evidence { + // pk := ed25519.GenPrivKey() + // evidence := &evidencetypes.Equivocation{ + // Height: 1, + // Power: 100, + // Time: time.Now().UTC(), + // ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), + // } + // evidenceGenState.Evidence[i], err = codectypes.NewAnyWithValue(evidence) + // s.Require().NoError(err) + //} + // + //appGenState[evidencetypes.ModuleName], err = cdc.MarshalJSON(&evidenceGenState) + //s.Require().NoError(err) + + var genUtilGenState genutiltypes.GenesisState + s.Require().NoError(cdc.UnmarshalJSON(appGenState[genutiltypes.ModuleName], &genUtilGenState)) + + // generate genesis txs + genTxs := make([]json.RawMessage, len(c.validators)) + for i, val := range c.validators { + createValmsg, err := val.buildCreateValidatorMsg(stakingAmountCoin) + s.Require().NoError(err) + signedTx, err := val.signMsg(createValmsg) + + s.Require().NoError(err) + + txRaw, err := cdc.MarshalJSON(signedTx) + s.Require().NoError(err) + + genTxs[i] = txRaw + } + + genUtilGenState.GenTxs = genTxs + + appGenState[genutiltypes.ModuleName], err = cdc.MarshalJSON(&genUtilGenState) + s.Require().NoError(err) + + genDoc.AppState, err = json.MarshalIndent(appGenState, "", " ") + s.Require().NoError(err) + + s.T().Logf("genDoc") + spew.Dump(genDoc) + + bz, err := tmjson.MarshalIndent(genDoc, "", " ") + s.Require().NoError(err) + + rawTx, _, err := buildRawTx() + s.Require().NoError(err) + + // write the updated genesis file to each validator. + for _, val := range c.validators { + err = writeFile(filepath.Join(val.configDir(), "config", "genesis.json"), bz) + s.Require().NoError(err) + + err = writeFile(filepath.Join(val.configDir(), rawTxFile), rawTx) + s.Require().NoError(err) + } +} + +// initValidatorConfigs initializes the validator configs for the given chain. +func (s *IntegrationTestSuite) initValidatorConfigs(c *chain) { + for i, val := range c.validators { + tmCfgPath := filepath.Join(val.configDir(), "config", "config.toml") + + vpr := viper.New() + vpr.SetConfigFile(tmCfgPath) + s.Require().NoError(vpr.ReadInConfig()) + + valConfig := tmconfig.DefaultConfig() + + s.Require().NoError(vpr.Unmarshal(valConfig)) + + valConfig.P2P.ListenAddress = "tcp://0.0.0.0:26656" + valConfig.P2P.AddrBookStrict = false + valConfig.P2P.ExternalAddress = fmt.Sprintf("%s:%d", val.instanceName(), 26656) + valConfig.RPC.ListenAddress = "tcp://0.0.0.0:26657" + valConfig.StateSync.Enable = false + valConfig.LogLevel = "info" + + var peers []string + + for j := 0; j < len(c.validators); j++ { + if i == j { + continue + } + + peer := c.validators[j] + peerID := fmt.Sprintf("%s@%s%d:26656", peer.nodeKey.ID(), peer.moniker, j) + peers = append(peers, peerID) + } + + valConfig.P2P.PersistentPeers = strings.Join(peers, ",") + + tmconfig.WriteConfigFile(tmCfgPath, valConfig) + + // set application configuration + appCfgPath := filepath.Join(val.configDir(), "config", "app.toml") + + appConfig := srvconfig.DefaultConfig() + appConfig.API.Enable = true + appConfig.MinGasPrices = fmt.Sprintf("%s%s", minGasPrice, uatomDenom) + + // srvconfig.WriteConfigFile(appCfgPath, appConfig) + appCustomConfig := params.CustomAppConfig{ + Config: *appConfig, + BypassMinFeeMsgTypes: []string{ + // todo: use ibc as example ? + sdk.MsgTypeURL(&ibcchanneltypes.MsgRecvPacket{}), + sdk.MsgTypeURL(&ibcchanneltypes.MsgAcknowledgement{}), + sdk.MsgTypeURL(&ibcclienttypes.MsgUpdateClient{}), + "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + }, + } + + customAppTemplate := ` +############################################################################### +### Custom Gaia Configuration ### +############################################################################### +# bypass-min-fee-msg-types defines custom message types the operator may set that +# will bypass minimum fee checks during CheckTx. +# +# Example: +# ["/ibc.core.channel.v1.MsgRecvPacket", "/ibc.core.channel.v1.MsgAcknowledgement", ...] +bypass-min-fee-msg-types = ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward","/ibc.applications.transfer.v1.MsgTransfer"] +` + srvconfig.DefaultConfigTemplate + srvconfig.SetConfigTemplate(customAppTemplate) + srvconfig.WriteConfigFile(appCfgPath, appCustomConfig) + } +} + +// runValidators runs the validators in the chain +func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { + s.T().Logf("starting Gaia %s validator containers...", c.id) + + s.T().Logf("Number validators = %d", len(c.validators)) + + s.valResources[c.id] = make([]*dockertest.Resource, len(c.validators)) + for i, val := range c.validators { + s.T().Logf("configDir %v", val.configDir()) + runOpts := &dockertest.RunOptions{ + Name: val.instanceName(), + NetworkID: s.dkrNet.Network.ID, + Mounts: []string{ + fmt.Sprintf("%s/:%s", val.configDir(), gaiaHomePath), + }, + Repository: "tiennv83/aurade2e", + Tag: "latest", + } + + s.Require().NoError(exec.Command("chmod", "-R", "0777", val.configDir()).Run()) //nolint:gosec // this is a test + + // expose the first validator for debugging and communication + if val.index == 0 { + runOpts.PortBindings = map[docker.Port][]docker.PortBinding{ + "1317/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 1317+portOffset)}}, + "6060/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6060+portOffset)}}, + "6061/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6061+portOffset)}}, + "6062/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6062+portOffset)}}, + "6063/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6063+portOffset)}}, + "6064/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6064+portOffset)}}, + "6065/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 6065+portOffset)}}, + "9090/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 9090+portOffset)}}, + "26656/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 26656+portOffset)}}, + "26657/tcp": {{HostIP: "", HostPort: fmt.Sprintf("%d", 26657+portOffset)}}, + } + } + + resource, err := s.dkrPool.RunWithOptions(runOpts, noRestart) + + s.T().Logf("Resource: %v", resource) + + s.Require().NoError(err) + + s.valResources[c.id][i] = resource + s.T().Logf("started Gaia %s validator container: %s", c.id, resource.Container.ID) + } + + rpcClient, err := rpchttp.New("tcp://localhost:26657", "/websocket") + s.Require().NoError(err) + + s.Require().Eventually( + func() bool { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) + defer cancel() + + status, err := rpcClient.Status(ctx) + s.T().Logf("Status:-----%v", status) + s.T().Logf("Error:-----%v", err) + if err != nil { + return false + } + + // let the node produce a few blocks + if status.SyncInfo.CatchingUp || status.SyncInfo.LatestBlockHeight < 3 { + return false + } + + return true + }, + 5*time.Minute, + time.Second, + "Gaia node failed to produce blocks", + ) +} + +func noRestart(config *docker.HostConfig) { + // in this case we don't want the nodes to restart on failure + config.RestartPolicy = docker.RestartPolicy{ + Name: "no", + } +} diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go new file mode 100644 index 00000000..592d4e23 --- /dev/null +++ b/tests/e2e/e2e_staking_test.go @@ -0,0 +1,59 @@ +package e2e + +import ( + "fmt" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (s *IntegrationTestSuite) testStaking() { + chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) + + validatorA := s.chainA.validators[0] + validatorB := s.chainA.validators[1] + validatorAAddr := validatorA.keyInfo.GetAddress() + validatorBAddr := validatorB.keyInfo.GetAddress() + + validatorAddressA := sdk.ValAddress(validatorAAddr).String() + validatorAddressB := sdk.ValAddress(validatorBAddr).String() + + delegatorAddress := s.chainA.genesisAccounts[2].keyInfo.GetAddress().String() + + fees := sdk.NewCoin(uatomDenom, sdk.NewInt(10)) + + delegationAmount := sdk.NewInt(500000000) + delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom + + // Alice delegate uatom to Validator A + s.executeDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress, gaiaHomePath, fees.String()) + + // Validate delegation successful + s.Require().Eventually( + func() bool { + res, err := queryDelegation(chainEndpoint, validatorAddressA, delegatorAddress) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + return amt.Equal(sdk.NewDecFromInt(delegationAmount)) + }, + 20*time.Second, + 5*time.Second, + ) + + // Alice re-delegate uatom from Validator A to Validator B + s.executeRedelegate(s.chainA, 0, delegation.String(), validatorAddressA, validatorAddressB, delegatorAddress, gaiaHomePath, fees.String()) + + // Validate re-delegation successful + s.Require().Eventually( + func() bool { + res, err := queryDelegation(chainEndpoint, validatorAddressB, delegatorAddress) + amt := res.GetDelegationResponse().GetDelegation().GetShares() + s.Require().NoError(err) + + return amt.Equal(sdk.NewDecFromInt(delegationAmount)) + }, + 20*time.Second, + 5*time.Second, + ) +} diff --git a/tests/e2e/e2e_test.go b/tests/e2e/e2e_test.go new file mode 100644 index 00000000..72d15c26 --- /dev/null +++ b/tests/e2e/e2e_test.go @@ -0,0 +1,23 @@ +package e2e + +var ( + runEncodeTest = true + runStakingAndDistributionTest = true +) + +func (s *IntegrationTestSuite) TestEncode() { + if !runEncodeTest { + s.T().Skip() + } + s.testEncode() + s.testDecode() +} + +// todo add fee test with wrong denom order +func (s *IntegrationTestSuite) TestStakingAndDistribution() { + if !runStakingAndDistributionTest { + s.T().Skip() + } + s.testStaking() + s.testDistribution() +} diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go new file mode 100644 index 00000000..0cc52e2c --- /dev/null +++ b/tests/e2e/genesis.go @@ -0,0 +1,32 @@ +package e2e + +import ( + "fmt" + "github.com/cosmos/cosmos-sdk/server" + tmtypes "github.com/tendermint/tendermint/types" + "os" +) + +func getGenDoc(path string) (*tmtypes.GenesisDoc, error) { + serverCtx := server.NewDefaultContext() + config := serverCtx.Config + config.SetRoot(path) + + genFile := config.GenesisFile() + doc := &tmtypes.GenesisDoc{} + + if _, err := os.Stat(genFile); err != nil { + if !os.IsNotExist(err) { + return nil, err + } + } else { + var err error + + doc, err = tmtypes.GenesisDocFromFile(genFile) + if err != nil { + return nil, fmt.Errorf("failed to read genesis doc from file: %w", err) + } + } + + return doc, nil +} diff --git a/tests/e2e/http_util.go b/tests/e2e/http_util.go new file mode 100644 index 00000000..cbd2b2a1 --- /dev/null +++ b/tests/e2e/http_util.go @@ -0,0 +1,22 @@ +package e2e + +import ( + "fmt" + "io" + "net/http" +) + +func httpGet(endpoint string) ([]byte, error) { + resp, err := http.Get(endpoint) //nolint:gosec // this is only used during tests + if err != nil { + return nil, fmt.Errorf("failed to execute HTTP request: %w", err) + } + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + return body, nil +} diff --git a/tests/e2e/io.go b/tests/e2e/io.go new file mode 100644 index 00000000..40b316be --- /dev/null +++ b/tests/e2e/io.go @@ -0,0 +1,44 @@ +package e2e + +import ( + "fmt" + "io" + "os" +) + +// copyFile copy file from src to dst +func copyFile(src, dst string) (int64, error) { //nolint:unparam + sourceFileStat, err := os.Stat(src) + if err != nil { + return 0, err + } + + if !sourceFileStat.Mode().IsRegular() { + return 0, fmt.Errorf("%s is not a regular file", src) + } + + source, err := os.Open(src) + if err != nil { + return 0, err + } + defer source.Close() + + destination, err := os.Create(dst) + if err != nil { + return 0, err + } + defer destination.Close() + + nBytes, err := io.Copy(destination, source) + return nBytes, err +} + +// writeFile write a byte slice into a file path +func writeFile(path string, body []byte) error { + _, err := os.Create(path) + if err != nil { + return err + } + + return os.WriteFile(path, body, 0o600) +} diff --git a/tests/e2e/keys.go b/tests/e2e/keys.go new file mode 100644 index 00000000..d47a7ce5 --- /dev/null +++ b/tests/e2e/keys.go @@ -0,0 +1,20 @@ +package e2e + +import ( + "github.com/cosmos/go-bip39" +) + +// createMnemonic creates a random string mnemonic +func createMnemonic() (string, error) { + entropySeed, err := bip39.NewEntropy(256) + if err != nil { + return "", err + } + + mnemonic, err := bip39.NewMnemonic(entropySeed) + if err != nil { + return "", err + } + + return mnemonic, nil +} diff --git a/tests/e2e/query.go b/tests/e2e/query.go new file mode 100644 index 00000000..6717a9e1 --- /dev/null +++ b/tests/e2e/query.go @@ -0,0 +1,256 @@ +package e2e + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + globalfee "github.com/cosmos/gaia/v8/x/globalfee/types" +) + +func queryGaiaTx(endpoint, txHash string) error { + resp, err := http.Get(fmt.Sprintf("%s/cosmos/tx/v1beta1/txs/%s", endpoint, txHash)) + if err != nil { + return fmt.Errorf("failed to execute HTTP request: %w", err) + } + + defer resp.Body.Close() + + if resp.StatusCode != 200 { + return fmt.Errorf("tx query returned non-200 status: %d", resp.StatusCode) + } + + var result map[string]interface{} + if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { + return fmt.Errorf("failed to read response body: %w", err) + } + + txResp := result["tx_response"].(map[string]interface{}) + if v := txResp["code"]; v.(float64) != 0 { + return fmt.Errorf("tx %s failed with status code %v", txHash, v) + } + + return nil +} + +// if coin is zero, return empty coin. +func getSpecificBalance(endpoint, addr, denom string) (amt sdk.Coin, err error) { + balances, err := queryGaiaAllBalances(endpoint, addr) + if err != nil { + return amt, err + } + for _, c := range balances { + if strings.Contains(c.Denom, denom) { + amt = c + break + } + } + return amt, nil +} + +func queryGaiaAllBalances(endpoint, addr string) (sdk.Coins, error) { + body, err := httpGet(fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s", endpoint, addr)) + if err != nil { + return nil, fmt.Errorf("failed to execute HTTP request: %w", err) + } + + var balancesResp banktypes.QueryAllBalancesResponse + if err := cdc.UnmarshalJSON(body, &balancesResp); err != nil { + return nil, err + } + + return balancesResp.Balances, nil +} + +func queryGlobalFees(endpoint string) (amt sdk.DecCoins, err error) { + body, err := httpGet(fmt.Sprintf("%s/gaia/globalfee/v1beta1/minimum_gas_prices", endpoint)) + if err != nil { + return nil, fmt.Errorf("failed to execute HTTP request: %w", err) + } + + var fees globalfee.QueryMinimumGasPricesResponse + if err := cdc.UnmarshalJSON(body, &fees); err != nil { + return sdk.DecCoins{}, err + } + + return fees.MinimumGasPrices, nil +} + +func queryDelegation(endpoint string, validatorAddr string, delegatorAddr string) (stakingtypes.QueryDelegationResponse, error) { + var res stakingtypes.QueryDelegationResponse + + body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s/delegations/%s", endpoint, validatorAddr, delegatorAddr)) + if err != nil { + return res, err + } + + if err = cdc.UnmarshalJSON(body, &res); err != nil { + return res, err + } + return res, nil +} + +func queryDelegatorWithdrawalAddress(endpoint string, delegatorAddr string) (disttypes.QueryDelegatorWithdrawAddressResponse, error) { + var res disttypes.QueryDelegatorWithdrawAddressResponse + + body, err := httpGet(fmt.Sprintf("%s/cosmos/distribution/v1beta1/delegators/%s/withdraw_address", endpoint, delegatorAddr)) + if err != nil { + return res, err + } + + if err = cdc.UnmarshalJSON(body, &res); err != nil { + return res, err + } + return res, nil +} + +func queryGovProposal(endpoint string, proposalID int) (govtypes.QueryProposalResponse, error) { + var govProposalResp govtypes.QueryProposalResponse + + path := fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%d", endpoint, proposalID) + + body, err := httpGet(path) + if err != nil { + return govProposalResp, fmt.Errorf("failed to execute HTTP request: %w", err) + } + if err := cdc.UnmarshalJSON(body, &govProposalResp); err != nil { + return govProposalResp, err + } + + return govProposalResp, nil +} + +func queryAccount(endpoint, address string) (acc authtypes.AccountI, err error) { + var res authtypes.QueryAccountResponse + resp, err := http.Get(fmt.Sprintf("%s/cosmos/auth/v1beta1/accounts/%s", endpoint, address)) + if err != nil { + return nil, fmt.Errorf("failed to execute HTTP request: %w", err) + } + defer resp.Body.Close() + + bz, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + if err := cdc.UnmarshalJSON(bz, &res); err != nil { + return nil, err + } + return acc, cdc.UnpackAny(res.Account, &acc) +} + +func queryDelayedVestingAccount(endpoint, address string) (authvesting.DelayedVestingAccount, error) { + baseAcc, err := queryAccount(endpoint, address) + if err != nil { + return authvesting.DelayedVestingAccount{}, err + } + acc, ok := baseAcc.(*authvesting.DelayedVestingAccount) + if !ok { + return authvesting.DelayedVestingAccount{}, + fmt.Errorf("cannot cast %v to DelayedVestingAccount", baseAcc) + } + return *acc, nil +} + +func queryContinuousVestingAccount(endpoint, address string) (authvesting.ContinuousVestingAccount, error) { + baseAcc, err := queryAccount(endpoint, address) + if err != nil { + return authvesting.ContinuousVestingAccount{}, err + } + acc, ok := baseAcc.(*authvesting.ContinuousVestingAccount) + if !ok { + return authvesting.ContinuousVestingAccount{}, + fmt.Errorf("cannot cast %v to ContinuousVestingAccount", baseAcc) + } + return *acc, nil +} + +func queryPermanentLockedAccount(endpoint, address string) (authvesting.PermanentLockedAccount, error) { //nolint:unused // this is called during e2e tests + baseAcc, err := queryAccount(endpoint, address) + if err != nil { + return authvesting.PermanentLockedAccount{}, err + } + acc, ok := baseAcc.(*authvesting.PermanentLockedAccount) + if !ok { + return authvesting.PermanentLockedAccount{}, + fmt.Errorf("cannot cast %v to PermanentLockedAccount", baseAcc) + } + return *acc, nil +} + +func queryPeriodicVestingAccount(endpoint, address string) (authvesting.PeriodicVestingAccount, error) { //nolint:unused // this is called during e2e tests + baseAcc, err := queryAccount(endpoint, address) + if err != nil { + return authvesting.PeriodicVestingAccount{}, err + } + acc, ok := baseAcc.(*authvesting.PeriodicVestingAccount) + if !ok { + return authvesting.PeriodicVestingAccount{}, + fmt.Errorf("cannot cast %v to PeriodicVestingAccount", baseAcc) + } + return *acc, nil +} + +func queryValidator(endpoint, address string) (stakingtypes.Validator, error) { + var res stakingtypes.QueryValidatorResponse + + body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s", endpoint, address)) + if err != nil { + return stakingtypes.Validator{}, fmt.Errorf("failed to execute HTTP request: %w", err) + } + + if err := cdc.UnmarshalJSON(body, &res); err != nil { + return stakingtypes.Validator{}, err + } + return res.Validator, nil +} + +func queryValidators(endpoint string) (stakingtypes.Validators, error) { + var res stakingtypes.QueryValidatorsResponse + body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators", endpoint)) + if err != nil { + return nil, fmt.Errorf("failed to execute HTTP request: %w", err) + } + + if err := cdc.UnmarshalJSON(body, &res); err != nil { + return nil, err + } + return res.Validators, nil +} + +func queryEvidence(endpoint, hash string) (evidencetypes.QueryEvidenceResponse, error) { //nolint:unused // this is called during e2e tests + var res evidencetypes.QueryEvidenceResponse + body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence/%s", endpoint, hash)) + if err != nil { + return res, err + } + + if err = cdc.UnmarshalJSON(body, &res); err != nil { + return res, err + } + return res, nil +} + +func queryAllEvidence(endpoint string) (evidencetypes.QueryAllEvidenceResponse, error) { + var res evidencetypes.QueryAllEvidenceResponse + body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence", endpoint)) + if err != nil { + return res, err + } + + if err = cdc.UnmarshalJSON(body, &res); err != nil { + return res, err + } + return res, nil +} diff --git a/tests/e2e/util.go b/tests/e2e/util.go new file mode 100644 index 00000000..ae136313 --- /dev/null +++ b/tests/e2e/util.go @@ -0,0 +1,52 @@ +package e2e + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/codec/unknownproto" + sdktx "github.com/cosmos/cosmos-sdk/types/tx" +) + +func decodeTx(txBytes []byte) (*sdktx.Tx, error) { + var raw sdktx.TxRaw + + // reject all unknown proto fields in the root TxRaw + err := unknownproto.RejectUnknownFieldsStrict(txBytes, &raw, encodingConfig.InterfaceRegistry) + if err != nil { + return nil, fmt.Errorf("failed to reject unknown fields: %w", err) + } + + if err := cdc.Unmarshal(txBytes, &raw); err != nil { + return nil, err + } + + var body sdktx.TxBody + if err := cdc.Unmarshal(raw.BodyBytes, &body); err != nil { + return nil, fmt.Errorf("failed to decode tx: %w", err) + } + + var authInfo sdktx.AuthInfo + + // reject all unknown proto fields in AuthInfo + err = unknownproto.RejectUnknownFieldsStrict(raw.AuthInfoBytes, &authInfo, encodingConfig.InterfaceRegistry) + if err != nil { + return nil, fmt.Errorf("failed to reject unknown fields: %w", err) + } + + if err := cdc.Unmarshal(raw.AuthInfoBytes, &authInfo); err != nil { + return nil, fmt.Errorf("failed to decode auth info: %w", err) + } + + return &sdktx.Tx{ + Body: &body, + AuthInfo: &authInfo, + Signatures: raw.Signatures, + }, nil +} + +func concatFlags(originalCollection []string, commandFlags []string, generalFlags []string) []string { + originalCollection = append(originalCollection, commandFlags...) + originalCollection = append(originalCollection, generalFlags...) + + return originalCollection +} diff --git a/tests/e2e/validator.go b/tests/e2e/validator.go new file mode 100644 index 00000000..6b3fe675 --- /dev/null +++ b/tests/e2e/validator.go @@ -0,0 +1,318 @@ +package e2e + +import ( + "encoding/json" + "fmt" + "github.com/aura-nw/aura/app" + "os" + "path" + "path/filepath" + + sdkcrypto "github.com/cosmos/cosmos-sdk/crypto" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/server" + sdk "github.com/cosmos/cosmos-sdk/types" + sdktx "github.com/cosmos/cosmos-sdk/types/tx" + txsigning "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + "github.com/cosmos/cosmos-sdk/x/genutil" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + tmcfg "github.com/tendermint/tendermint/config" + tmos "github.com/tendermint/tendermint/libs/os" + "github.com/tendermint/tendermint/p2p" + "github.com/tendermint/tendermint/privval" +) + +//nolint:unused +type validator struct { + chain *chain + index int + moniker string + mnemonic string + keyInfo keyring.Info + privateKey cryptotypes.PrivKey + consensusKey privval.FilePVKey + consensusPrivKey cryptotypes.PrivKey + nodeKey p2p.NodeKey +} + +type account struct { + moniker string //nolint:unused + mnemonic string + keyInfo keyring.Info + privateKey cryptotypes.PrivKey +} + +func (v *validator) instanceName() string { + return fmt.Sprintf("%s%d", v.moniker, v.index) +} + +func (v *validator) configDir() string { + return fmt.Sprintf("%s/%s", v.chain.configDir(), v.instanceName()) +} + +func (v *validator) createConfig() error { + p := path.Join(v.configDir(), "config") + return os.MkdirAll(p, 0o755) +} + +func (v *validator) init() error { + if err := v.createConfig(); err != nil { + return err + } + + serverCtx := server.NewDefaultContext() + config := serverCtx.Config + + config.SetRoot(v.configDir()) + config.Moniker = v.moniker + + genDoc, err := getGenDoc(v.configDir()) + if err != nil { + return err + } + + appState, err := json.MarshalIndent(app.ModuleBasics.DefaultGenesis(cdc), "", " ") + if err != nil { + return fmt.Errorf("failed to JSON encode app genesis state: %w", err) + } + + genDoc.ChainID = v.chain.id + genDoc.Validators = nil + genDoc.AppState = appState + + if err = genutil.ExportGenesisFile(genDoc, config.GenesisFile()); err != nil { + return fmt.Errorf("failed to export app genesis state: %w", err) + } + + tmcfg.WriteConfigFile(filepath.Join(config.RootDir, "config", "config.toml"), config) + return nil +} + +func (v *validator) createNodeKey() error { + serverCtx := server.NewDefaultContext() + config := serverCtx.Config + + config.SetRoot(v.configDir()) + config.Moniker = v.moniker + + nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) + if err != nil { + return err + } + + v.nodeKey = *nodeKey + return nil +} + +func (v *validator) createConsensusKey() error { + serverCtx := server.NewDefaultContext() + config := serverCtx.Config + + config.SetRoot(v.configDir()) + config.Moniker = v.moniker + + pvKeyFile := config.PrivValidatorKeyFile() + if err := tmos.EnsureDir(filepath.Dir(pvKeyFile), 0o777); err != nil { + return err + } + + pvStateFile := config.PrivValidatorStateFile() + if err := tmos.EnsureDir(filepath.Dir(pvStateFile), 0o777); err != nil { + return err + } + + filePV := privval.LoadOrGenFilePV(pvKeyFile, pvStateFile) + v.consensusKey = filePV.Key + + return nil +} + +func (v *validator) createKeyFromMnemonic(name, mnemonic string) error { + dir := v.configDir() + kb, err := keyring.New(keyringAppName, keyring.BackendTest, dir, nil) + if err != nil { + return err + } + + keyringAlgos, _ := kb.SupportedAlgorithms() + algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) + if err != nil { + return err + } + + info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) + if err != nil { + return err + } + + privKeyArmor, err := kb.ExportPrivKeyArmor(name, keyringPassphrase) + if err != nil { + return err + } + + privKey, _, err := sdkcrypto.UnarmorDecryptPrivKey(privKeyArmor, keyringPassphrase) + if err != nil { + return err + } + + v.keyInfo = info + v.mnemonic = mnemonic + v.privateKey = privKey + + return nil +} + +func (c *chain) addAccountFromMnemonic(counts int) error { + val0ConfigDir := c.validators[0].configDir() + kb, err := keyring.New(keyringAppName, keyring.BackendTest, val0ConfigDir, nil) + if err != nil { + return err + } + + keyringAlgos, _ := kb.SupportedAlgorithms() + algo, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), keyringAlgos) + if err != nil { + return err + } + + for i := 0; i < counts; i++ { + name := fmt.Sprintf("acct-%d", i) + mnemonic, err := createMnemonic() + if err != nil { + return err + } + info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) + if err != nil { + return err + } + + privKeyArmor, err := kb.ExportPrivKeyArmor(name, keyringPassphrase) + if err != nil { + return err + } + + privKey, _, err := sdkcrypto.UnarmorDecryptPrivKey(privKeyArmor, keyringPassphrase) + if err != nil { + return err + } + acct := account{} + acct.keyInfo = info + acct.mnemonic = mnemonic + acct.privateKey = privKey + c.genesisAccounts = append(c.genesisAccounts, &acct) + } + + return nil +} + +func (v *validator) createKey(name string) error { + mnemonic, err := createMnemonic() + if err != nil { + return err + } + + return v.createKeyFromMnemonic(name, mnemonic) +} + +func (v *validator) buildCreateValidatorMsg(amount sdk.Coin) (sdk.Msg, error) { + description := stakingtypes.NewDescription(v.moniker, "", "", "", "") + commissionRates := stakingtypes.CommissionRates{ + Rate: sdk.MustNewDecFromStr("0.1"), + MaxRate: sdk.MustNewDecFromStr("0.2"), + MaxChangeRate: sdk.MustNewDecFromStr("0.01"), + } + + // get the initial validator min self delegation + minSelfDelegation := sdk.OneInt() + + valPubKey, err := cryptocodec.FromTmPubKeyInterface(v.consensusKey.PubKey) + if err != nil { + return nil, err + } + + return stakingtypes.NewMsgCreateValidator( + sdk.ValAddress(v.keyInfo.GetAddress()), + valPubKey, + amount, + description, + commissionRates, + minSelfDelegation, + ) +} + +func (v *validator) signMsg(msgs ...sdk.Msg) (*sdktx.Tx, error) { + txBuilder := encodingConfig.TxConfig.NewTxBuilder() + + if err := txBuilder.SetMsgs(msgs...); err != nil { + return nil, err + } + + txBuilder.SetMemo(fmt.Sprintf("%s@%s:26656", v.nodeKey.ID(), v.instanceName())) + txBuilder.SetFeeAmount(sdk.NewCoins()) + txBuilder.SetGasLimit(200000) + + signerData := authsigning.SignerData{ + ChainID: v.chain.id, + AccountNumber: 0, + Sequence: 0, + } + + // For SIGN_MODE_DIRECT, calling SetSignatures calls setSignerInfos on + // TxBuilder under the hood, and SignerInfos is needed to generate the sign + // bytes. This is the reason for setting SetSignatures here, with a nil + // signature. + // + // Note: This line is not needed for SIGN_MODE_LEGACY_AMINO, but putting it + // also doesn't affect its generated sign bytes, so for code's simplicity + // sake, we put it here. + sig := txsigning.SignatureV2{ + PubKey: v.keyInfo.GetPubKey(), + Data: &txsigning.SingleSignatureData{ + SignMode: txsigning.SignMode_SIGN_MODE_DIRECT, + Signature: nil, + }, + Sequence: 0, + } + + if err := txBuilder.SetSignatures(sig); err != nil { + return nil, err + } + + bytesToSign, err := encodingConfig.TxConfig.SignModeHandler().GetSignBytes( + txsigning.SignMode_SIGN_MODE_DIRECT, + signerData, + txBuilder.GetTx(), + ) + if err != nil { + return nil, err + } + + sigBytes, err := v.privateKey.Sign(bytesToSign) + if err != nil { + return nil, err + } + + sig = txsigning.SignatureV2{ + PubKey: v.keyInfo.GetPubKey(), + Data: &txsigning.SingleSignatureData{ + SignMode: txsigning.SignMode_SIGN_MODE_DIRECT, + Signature: sigBytes, + }, + Sequence: 0, + } + if err := txBuilder.SetSignatures(sig); err != nil { + return nil, err + } + + signedTx := txBuilder.GetTx() + bz, err := encodingConfig.TxConfig.TxEncoder()(signedTx) + if err != nil { + return nil, err + } + + return decodeTx(bz) +} From 786e26fd2e995776a58e2fc97dd84f62f5f07f32 Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Mon, 16 Jan 2023 16:14:22 +0700 Subject: [PATCH 10/12] Fix docker build --- tests/e2e/chain.go | 10 +- tests/e2e/e2e_distribution_test.go | 16 +-- tests/e2e/e2e_encode_test.go | 2 +- tests/e2e/e2e_exec_test.go | 38 +++---- tests/e2e/e2e_setup_test.go | 65 ++++-------- tests/e2e/e2e_staking_test.go | 8 +- tests/e2e/genesis.go | 111 ++++++++++++++++++++ tests/e2e/query.go | 161 ----------------------------- tests/e2e/validator.go | 4 + 9 files changed, 170 insertions(+), 245 deletions(-) diff --git a/tests/e2e/chain.go b/tests/e2e/chain.go index 4e346824..8c2f7d5d 100644 --- a/tests/e2e/chain.go +++ b/tests/e2e/chain.go @@ -37,11 +37,9 @@ func init() { } type chain struct { - dataDir string - id string - validators []*validator - accounts []*account //nolint:unused - // initial accounts in genesis + dataDir string + id string + validators []*validator genesisAccounts []*account genesisVestingAccounts map[string]sdk.AccAddress } @@ -119,6 +117,6 @@ func (c *chain) createValidator(index int) *validator { return &validator{ chain: c, index: index, - moniker: fmt.Sprintf("%s-gaia-%d", c.id, index), + moniker: fmt.Sprintf("%s-aurad-%d", c.id, index), } } diff --git a/tests/e2e/e2e_distribution_test.go b/tests/e2e/e2e_distribution_test.go index 7f7f41da..1af215ca 100644 --- a/tests/e2e/e2e_distribution_test.go +++ b/tests/e2e/e2e_distribution_test.go @@ -18,15 +18,15 @@ func (s *IntegrationTestSuite) testDistribution() { delegatorAddress := s.chainA.genesisAccounts[2].keyInfo.GetAddress().String() newWithdrawalAddress := s.chainA.genesisAccounts[3].keyInfo.GetAddress().String() - fees := sdk.NewCoin(uatomDenom, sdk.NewInt(1000)) + fees := sdk.NewCoin(uauraDenom, sdk.NewInt(1000)) - beforeBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uatomDenom) + beforeBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uauraDenom) s.Require().NoError(err) if beforeBalance.IsNil() { - beforeBalance = sdk.NewCoin(uatomDenom, sdk.NewInt(0)) + beforeBalance = sdk.NewCoin(uauraDenom, sdk.NewInt(0)) } - s.execSetWithdrawAddress(s.chainA, 0, fees.String(), delegatorAddress, newWithdrawalAddress, gaiaHomePath) + s.execSetWithdrawAddress(s.chainA, 0, fees.String(), delegatorAddress, newWithdrawalAddress, auraHomePath) // Verify s.Require().Eventually( @@ -40,10 +40,10 @@ func (s *IntegrationTestSuite) testDistribution() { 5*time.Second, ) - s.execWithdrawReward(s.chainA, 0, delegatorAddress, valOperAddressA, gaiaHomePath) + s.execWithdrawReward(s.chainA, 0, delegatorAddress, valOperAddressA, auraHomePath) s.Require().Eventually( func() bool { - afterBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uatomDenom) + afterBalance, err := getSpecificBalance(chainEndpoint, newWithdrawalAddress, uauraDenom) s.Require().NoError(err) return afterBalance.IsGTE(beforeBalance) @@ -67,13 +67,13 @@ func (s *IntegrationTestSuite) fundCommunityPool() { beforeDistUatomBalance, _ := getSpecificBalance(chainAAPIEndpoint, distModuleAddress, tokenAmount.Denom) if beforeDistUatomBalance.IsNil() { // Set balance to 0 if previous balance does not exist - beforeDistUatomBalance = sdk.NewInt64Coin(uatomDenom, 0) + beforeDistUatomBalance = sdk.NewInt64Coin(uauraDenom, 0) } s.execDistributionFundCommunityPool(s.chainA, 0, sender.String(), tokenAmount.String(), standardFees.String()) // there are still tokens being added to the community pool through block production rewards but they should be less than 500 tokens - marginOfErrorForBlockReward := sdk.NewInt64Coin(uatomDenom, 500) + marginOfErrorForBlockReward := sdk.NewInt64Coin(uauraDenom, 500) s.Require().Eventually( func() bool { diff --git a/tests/e2e/e2e_encode_test.go b/tests/e2e/e2e_encode_test.go index 073c6e2a..e558719b 100644 --- a/tests/e2e/e2e_encode_test.go +++ b/tests/e2e/e2e_encode_test.go @@ -16,7 +16,7 @@ func (s *IntegrationTestSuite) testEncode() { _, encoded, err := buildRawTx() s.Require().NoError(err) - got := s.execEncode(chain, filepath.Join(gaiaHomePath, rawTxFile)) + got := s.execEncode(chain, filepath.Join(auraHomePath, rawTxFile)) s.T().Logf("encoded tx: %s", got) s.Require().Equal(encoded, got) } diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index d3c0f533..a6effeba 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -53,7 +53,7 @@ func applyOptions(chainID string, options []flagOption) map[string]interface{} { flagBroadcastMode: "sync", flagGasAdjustment: "1.5", flagChainID: chainID, - flagHome: gaiaHomePath, + flagHome: auraHomePath, flagFees: standardFees.String(), } for _, apply := range options { @@ -73,7 +73,7 @@ func (s *IntegrationTestSuite) execEncode( s.T().Logf("%s - Executing gaiad encoding with %v", c.id, txPath) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, "encode", txPath, @@ -105,7 +105,7 @@ func (s *IntegrationTestSuite) execDecode( s.T().Logf("%s - Executing gaiad decoding with %v", c.id, txPath) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, "decode", txPath, @@ -138,7 +138,7 @@ func (s *IntegrationTestSuite) execVestingTx( s.T().Logf("%s - Executing gaiad %s with %v", c.id, method, args) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, vestingtypes.ModuleName, method, @@ -175,7 +175,7 @@ func (s *IntegrationTestSuite) execUnjail( s.T().Logf("Executing gaiad slashing unjail %s with options: %v", c.id, opt) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, slashingtypes.ModuleName, "unjail", @@ -201,7 +201,7 @@ func (s *IntegrationTestSuite) execFeeGrant(c *chain, valIdx int, granter, grant s.T().Logf("granting %s fee from %s on chain %s", grantee, granter, c.id) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, feegrant.ModuleName, "grant", @@ -226,7 +226,7 @@ func (s *IntegrationTestSuite) execFeeGrantRevoke(c *chain, valIdx int, granter, s.T().Logf("revoking %s fee grant from %s on chain %s", grantee, granter, c.id) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, feegrant.ModuleName, "revoke", @@ -262,7 +262,7 @@ func (s *IntegrationTestSuite) execBankSend( s.T().Logf("sending %s tokens from %s to %s on chain %s", amt, from, to, c.id) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, banktypes.ModuleName, "send", @@ -313,7 +313,7 @@ func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, paye defer cancel() gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, distributiontypes.ModuleName, "withdraw-all-rewards", @@ -335,7 +335,7 @@ func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valId s.T().Logf("Executing gaiad tx distribution fund-community-pool on chain %s", c.id) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, distributiontypes.ModuleName, "fund-community-pool", @@ -357,7 +357,7 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g defer cancel() gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, govtypes.ModuleName, govCommand, @@ -384,7 +384,7 @@ func (s *IntegrationTestSuite) executeGKeysAddCommand(c *chain, valIdx int, name defer cancel() gaiaCommand := []string{ - gaiadBinary, + auradBinary, keysCommand, "add", name, @@ -409,7 +409,7 @@ func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string defer cancel() gaiaCommand := []string{ - gaiadBinary, + auradBinary, keysCommand, "list", "--keyring-backend=test", @@ -429,7 +429,7 @@ func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, val s.T().Logf("Executing gaiad tx staking delegate %s", c.id) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, stakingtypes.ModuleName, "delegate", @@ -458,7 +458,7 @@ func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, o s.T().Logf("Executing gaiad tx staking redelegate %s", c.id) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, stakingtypes.ModuleName, "redelegate", @@ -490,7 +490,7 @@ func (s *IntegrationTestSuite) getLatestBlockHeight(c *chain, valIdx int) int { } var currentHeight int - gaiaCommand := []string{gaiadBinary, "status"} + gaiaCommand := []string{auradBinary, "status"} s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { var ( err error @@ -507,7 +507,7 @@ func (s *IntegrationTestSuite) getLatestBlockHeight(c *chain, valIdx int) int { func (s *IntegrationTestSuite) verifyBalanceChange(endpoint string, expectedAmount sdk.Coin, recipientAddress string) { s.Require().Eventually( func() bool { - afterAtomBalance, err := getSpecificBalance(endpoint, recipientAddress, uatomDenom) + afterAtomBalance, err := getSpecificBalance(endpoint, recipientAddress, uauraDenom) s.Require().NoError(err) return afterAtomBalance.IsEqual(expectedAmount) @@ -530,7 +530,7 @@ func (s *IntegrationTestSuite) execSetWithdrawAddress( s.T().Logf("Setting distribution withdrawal address on chain %s for %s to %s", c.id, delegatorAddress, newWithdrawalAddress) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, distributiontypes.ModuleName, "set-withdraw-addr", @@ -560,7 +560,7 @@ func (s *IntegrationTestSuite) execWithdrawReward( s.T().Logf("Withdrawing distribution rewards on chain %s for delegator %s from %s validator", c.id, delegatorAddress, validatorAddress) gaiaCommand := []string{ - gaiadBinary, + auradBinary, txCommand, distributiontypes.ModuleName, "withdraw-rewards", diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index be24d88d..a2a3f1e6 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "github.com/davecgh/go-spew/spew" "os" "os/exec" "path/filepath" @@ -33,27 +32,25 @@ import ( ) const ( - gaiadBinary = "/usr/bin/aurad" - txCommand = "tx" - keysCommand = "keys" - gaiaHomePath = "/root/.aura" - uatomDenom = "uatom" - initBalanceStr = "110000000000uaura,100000000000000000uaura,100000000000000000uaura" - minGasPrice = "0.00001" - initialGlobalFeeAmt = "0.00001" - gas = 200000 - numberOfEvidences = 10 + auradBinary = "/usr/bin/aurad" + txCommand = "tx" + keysCommand = "keys" + auraHomePath = "/root/.aura" + uauraDenom = "uaura" + minGasPrice = "0.00001" + gas = 200000 ) var ( - gaiaConfigPath = filepath.Join(gaiaHomePath, "config") + auraConfigPath = filepath.Join(auraHomePath, "config") stakingAmount = sdk.NewInt(100000000000) - stakingAmountCoin = sdk.NewCoin(uatomDenom, stakingAmount) - tokenAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(3300000000)) // 3,300uatom - standardFees = sdk.NewCoin(uatomDenom, sdk.NewInt(330000)) // 0.33uatom - depositAmount = sdk.NewCoin(uatomDenom, sdk.NewInt(10000000)) // 10uatom + stakingAmountCoin = sdk.NewCoin(uauraDenom, stakingAmount) + tokenAmount = sdk.NewCoin(uauraDenom, sdk.NewInt(3300000000)) // 3,300uatom + standardFees = sdk.NewCoin(uauraDenom, sdk.NewInt(330000)) // 0.33uatom + depositAmount = sdk.NewCoin(uauraDenom, sdk.NewInt(10000000)) // 10uatom distModuleAddress = authtypes.NewModuleAddress(distrtypes.ModuleName).String() proposalCounter = 0 + initBalanceStr = "100000000000000000uaura" ) type IntegrationTestSuite struct { @@ -131,15 +128,10 @@ func (s *IntegrationTestSuite) TearDownSuite() { func (s *IntegrationTestSuite) initNodes(c *chain) { s.Require().NoError(c.createAndInitValidators(1)) - /* Adding 4 accounts to val0 local directory - c.genesisAccounts[0]: Relayer Wallet - c.genesisAccounts[1]: ICA Owner - c.genesisAccounts[2]: Test Account 1 - c.genesisAccounts[3]: Test Account 2 - */ s.Require().NoError(c.addAccountFromMnemonic(4)) // Initialize a genesis file for the first validator val0ConfigDir := c.validators[0].configDir() + var addrAll []sdk.AccAddress for _, val := range c.validators { address := val.keyInfo.GetAddress() @@ -151,6 +143,9 @@ func (s *IntegrationTestSuite) initNodes(c *chain) { addrAll = append(addrAll, acctAddr) } + err := modifyGenesis(val0ConfigDir, "", initBalanceStr, addrAll, uauraDenom) + s.Require().NoError(err) + // copy the genesis file to the remaining validators for _, val := range c.validators[1:] { _, err := copyFile( @@ -177,25 +172,6 @@ func (s *IntegrationTestSuite) initGenesis(c *chain) { appGenState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFilePath) s.Require().NoError(err) - //var evidenceGenState evidencetypes.GenesisState - //s.Require().NoError(cdc.UnmarshalJSON(appGenState[evidencetypes.ModuleName], &evidenceGenState)) - // - //evidenceGenState.Evidence = make([]*codectypes.Any, numberOfEvidences) - //for i := range evidenceGenState.Evidence { - // pk := ed25519.GenPrivKey() - // evidence := &evidencetypes.Equivocation{ - // Height: 1, - // Power: 100, - // Time: time.Now().UTC(), - // ConsensusAddress: sdk.ConsAddress(pk.PubKey().Address().Bytes()).String(), - // } - // evidenceGenState.Evidence[i], err = codectypes.NewAnyWithValue(evidence) - // s.Require().NoError(err) - //} - // - //appGenState[evidencetypes.ModuleName], err = cdc.MarshalJSON(&evidenceGenState) - //s.Require().NoError(err) - var genUtilGenState genutiltypes.GenesisState s.Require().NoError(cdc.UnmarshalJSON(appGenState[genutiltypes.ModuleName], &genUtilGenState)) @@ -222,9 +198,6 @@ func (s *IntegrationTestSuite) initGenesis(c *chain) { genDoc.AppState, err = json.MarshalIndent(appGenState, "", " ") s.Require().NoError(err) - s.T().Logf("genDoc") - spew.Dump(genDoc) - bz, err := tmjson.MarshalIndent(genDoc, "", " ") s.Require().NoError(err) @@ -282,7 +255,7 @@ func (s *IntegrationTestSuite) initValidatorConfigs(c *chain) { appConfig := srvconfig.DefaultConfig() appConfig.API.Enable = true - appConfig.MinGasPrices = fmt.Sprintf("%s%s", minGasPrice, uatomDenom) + appConfig.MinGasPrices = fmt.Sprintf("%s%s", minGasPrice, uauraDenom) // srvconfig.WriteConfigFile(appCfgPath, appConfig) appCustomConfig := params.CustomAppConfig{ @@ -325,7 +298,7 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { Name: val.instanceName(), NetworkID: s.dkrNet.Network.ID, Mounts: []string{ - fmt.Sprintf("%s/:%s", val.configDir(), gaiaHomePath), + fmt.Sprintf("%s/:%s", val.configDir(), auraHomePath), }, Repository: "tiennv83/aurade2e", Tag: "latest", diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go index 592d4e23..88078275 100644 --- a/tests/e2e/e2e_staking_test.go +++ b/tests/e2e/e2e_staking_test.go @@ -20,13 +20,13 @@ func (s *IntegrationTestSuite) testStaking() { delegatorAddress := s.chainA.genesisAccounts[2].keyInfo.GetAddress().String() - fees := sdk.NewCoin(uatomDenom, sdk.NewInt(10)) + fees := sdk.NewCoin(uauraDenom, sdk.NewInt(10)) delegationAmount := sdk.NewInt(500000000) - delegation := sdk.NewCoin(uatomDenom, delegationAmount) // 500 atom + delegation := sdk.NewCoin(uauraDenom, delegationAmount) // 500 atom // Alice delegate uatom to Validator A - s.executeDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress, gaiaHomePath, fees.String()) + s.executeDelegate(s.chainA, 0, delegation.String(), validatorAddressA, delegatorAddress, auraHomePath, fees.String()) // Validate delegation successful s.Require().Eventually( @@ -42,7 +42,7 @@ func (s *IntegrationTestSuite) testStaking() { ) // Alice re-delegate uatom from Validator A to Validator B - s.executeRedelegate(s.chainA, 0, delegation.String(), validatorAddressA, validatorAddressB, delegatorAddress, gaiaHomePath, fees.String()) + s.executeRedelegate(s.chainA, 0, delegation.String(), validatorAddressA, validatorAddressB, delegatorAddress, auraHomePath, fees.String()) // Validate re-delegation successful s.Require().Eventually( diff --git a/tests/e2e/genesis.go b/tests/e2e/genesis.go index 0cc52e2c..9813f2e7 100644 --- a/tests/e2e/genesis.go +++ b/tests/e2e/genesis.go @@ -1,10 +1,19 @@ package e2e import ( + "encoding/json" "fmt" "github.com/cosmos/cosmos-sdk/server" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" tmtypes "github.com/tendermint/tendermint/types" "os" + "time" ) func getGenDoc(path string) (*tmtypes.GenesisDoc, error) { @@ -30,3 +39,105 @@ func getGenDoc(path string) (*tmtypes.GenesisDoc, error) { return doc, nil } + +func modifyGenesis(path, moniker, amountStr string, addrAll []sdk.AccAddress, denom string) error { + serverCtx := server.NewDefaultContext() + config := serverCtx.Config + config.SetRoot(path) + config.Moniker = moniker + + coins, err := sdk.ParseCoinsNormalized(amountStr) + if err != nil { + return fmt.Errorf("failed to parse coins: %w", err) + } + + var balances []banktypes.Balance + var genAccounts []*authtypes.BaseAccount + for _, addr := range addrAll { + balance := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} + balances = append(balances, balance) + genAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) + genAccounts = append(genAccounts, genAccount) + } + + genFile := config.GenesisFile() + appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) + if err != nil { + return fmt.Errorf("failed to unmarshal genesis state: %w", err) + } + + authGenState := authtypes.GetGenesisStateFromAppState(cdc, appState) + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + if err != nil { + return fmt.Errorf("failed to get accounts from any: %w", err) + } + + for _, addr := range addrAll { + if accs.Contains(addr) { + return fmt.Errorf("failed to add account to genesis state; account already exists: %s", addr) + } + } + + // Add the new account to the set of genesis accounts and sanitize the + // accounts afterwards. + for _, genAcct := range genAccounts { + accs = append(accs, genAcct) + accs = authtypes.SanitizeGenesisAccounts(accs) + } + + genAccs, err := authtypes.PackAccounts(accs) + if err != nil { + return fmt.Errorf("failed to convert accounts into any's: %w", err) + } + + authGenState.Accounts = genAccs + + authGenStateBz, err := cdc.MarshalJSON(&authGenState) + if err != nil { + return fmt.Errorf("failed to marshal auth genesis state: %w", err) + } + appState[authtypes.ModuleName] = authGenStateBz + + bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) + bankGenState.Balances = append(bankGenState.Balances, balances...) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + + bankGenStateBz, err := cdc.MarshalJSON(bankGenState) + if err != nil { + return fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + appState[banktypes.ModuleName] = bankGenStateBz + + stakingGenState := stakingtypes.GetGenesisStateFromAppState(cdc, appState) + stakingGenState.Params.BondDenom = denom + stakingGenStateBz, err := cdc.MarshalJSON(stakingGenState) + if err != nil { + return fmt.Errorf("failed to marshal staking genesis state: %s", err) + } + appState[stakingtypes.ModuleName] = stakingGenStateBz + + // Refactor to separate method + amnt := sdk.NewInt(10000) + quorum, _ := sdk.NewDecFromStr("0.000000000000000001") + threshold, _ := sdk.NewDecFromStr("0.000000000000000001") + + govState := govtypes.NewGenesisState(1, + govtypes.NewDepositParams(sdk.NewCoins(sdk.NewCoin(denom, amnt)), 10*time.Minute), + govtypes.NewVotingParams(15*time.Second), + govtypes.NewTallyParams(quorum, threshold, govtypes.DefaultVetoThreshold), + ) + + govGenStateBz, err := cdc.MarshalJSON(govState) + if err != nil { + return fmt.Errorf("failed to marshal gov genesis state: %w", err) + } + appState[govtypes.ModuleName] = govGenStateBz + + appStateJSON, err := json.Marshal(appState) + if err != nil { + return fmt.Errorf("failed to marshal application genesis state: %w", err) + } + genDoc.AppState = appStateJSON + + return genutil.ExportGenesisFile(genDoc, genFile) +} diff --git a/tests/e2e/query.go b/tests/e2e/query.go index 6717a9e1..0c094e68 100644 --- a/tests/e2e/query.go +++ b/tests/e2e/query.go @@ -3,21 +3,13 @@ package e2e import ( "encoding/json" "fmt" - "io" "net/http" "strings" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" disttypes "github.com/cosmos/cosmos-sdk/x/distribution/types" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - - globalfee "github.com/cosmos/gaia/v8/x/globalfee/types" ) func queryGaiaTx(endpoint, txHash string) error { @@ -74,20 +66,6 @@ func queryGaiaAllBalances(endpoint, addr string) (sdk.Coins, error) { return balancesResp.Balances, nil } -func queryGlobalFees(endpoint string) (amt sdk.DecCoins, err error) { - body, err := httpGet(fmt.Sprintf("%s/gaia/globalfee/v1beta1/minimum_gas_prices", endpoint)) - if err != nil { - return nil, fmt.Errorf("failed to execute HTTP request: %w", err) - } - - var fees globalfee.QueryMinimumGasPricesResponse - if err := cdc.UnmarshalJSON(body, &fees); err != nil { - return sdk.DecCoins{}, err - } - - return fees.MinimumGasPrices, nil -} - func queryDelegation(endpoint string, validatorAddr string, delegatorAddr string) (stakingtypes.QueryDelegationResponse, error) { var res stakingtypes.QueryDelegationResponse @@ -115,142 +93,3 @@ func queryDelegatorWithdrawalAddress(endpoint string, delegatorAddr string) (dis } return res, nil } - -func queryGovProposal(endpoint string, proposalID int) (govtypes.QueryProposalResponse, error) { - var govProposalResp govtypes.QueryProposalResponse - - path := fmt.Sprintf("%s/cosmos/gov/v1beta1/proposals/%d", endpoint, proposalID) - - body, err := httpGet(path) - if err != nil { - return govProposalResp, fmt.Errorf("failed to execute HTTP request: %w", err) - } - if err := cdc.UnmarshalJSON(body, &govProposalResp); err != nil { - return govProposalResp, err - } - - return govProposalResp, nil -} - -func queryAccount(endpoint, address string) (acc authtypes.AccountI, err error) { - var res authtypes.QueryAccountResponse - resp, err := http.Get(fmt.Sprintf("%s/cosmos/auth/v1beta1/accounts/%s", endpoint, address)) - if err != nil { - return nil, fmt.Errorf("failed to execute HTTP request: %w", err) - } - defer resp.Body.Close() - - bz, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - if err := cdc.UnmarshalJSON(bz, &res); err != nil { - return nil, err - } - return acc, cdc.UnpackAny(res.Account, &acc) -} - -func queryDelayedVestingAccount(endpoint, address string) (authvesting.DelayedVestingAccount, error) { - baseAcc, err := queryAccount(endpoint, address) - if err != nil { - return authvesting.DelayedVestingAccount{}, err - } - acc, ok := baseAcc.(*authvesting.DelayedVestingAccount) - if !ok { - return authvesting.DelayedVestingAccount{}, - fmt.Errorf("cannot cast %v to DelayedVestingAccount", baseAcc) - } - return *acc, nil -} - -func queryContinuousVestingAccount(endpoint, address string) (authvesting.ContinuousVestingAccount, error) { - baseAcc, err := queryAccount(endpoint, address) - if err != nil { - return authvesting.ContinuousVestingAccount{}, err - } - acc, ok := baseAcc.(*authvesting.ContinuousVestingAccount) - if !ok { - return authvesting.ContinuousVestingAccount{}, - fmt.Errorf("cannot cast %v to ContinuousVestingAccount", baseAcc) - } - return *acc, nil -} - -func queryPermanentLockedAccount(endpoint, address string) (authvesting.PermanentLockedAccount, error) { //nolint:unused // this is called during e2e tests - baseAcc, err := queryAccount(endpoint, address) - if err != nil { - return authvesting.PermanentLockedAccount{}, err - } - acc, ok := baseAcc.(*authvesting.PermanentLockedAccount) - if !ok { - return authvesting.PermanentLockedAccount{}, - fmt.Errorf("cannot cast %v to PermanentLockedAccount", baseAcc) - } - return *acc, nil -} - -func queryPeriodicVestingAccount(endpoint, address string) (authvesting.PeriodicVestingAccount, error) { //nolint:unused // this is called during e2e tests - baseAcc, err := queryAccount(endpoint, address) - if err != nil { - return authvesting.PeriodicVestingAccount{}, err - } - acc, ok := baseAcc.(*authvesting.PeriodicVestingAccount) - if !ok { - return authvesting.PeriodicVestingAccount{}, - fmt.Errorf("cannot cast %v to PeriodicVestingAccount", baseAcc) - } - return *acc, nil -} - -func queryValidator(endpoint, address string) (stakingtypes.Validator, error) { - var res stakingtypes.QueryValidatorResponse - - body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators/%s", endpoint, address)) - if err != nil { - return stakingtypes.Validator{}, fmt.Errorf("failed to execute HTTP request: %w", err) - } - - if err := cdc.UnmarshalJSON(body, &res); err != nil { - return stakingtypes.Validator{}, err - } - return res.Validator, nil -} - -func queryValidators(endpoint string) (stakingtypes.Validators, error) { - var res stakingtypes.QueryValidatorsResponse - body, err := httpGet(fmt.Sprintf("%s/cosmos/staking/v1beta1/validators", endpoint)) - if err != nil { - return nil, fmt.Errorf("failed to execute HTTP request: %w", err) - } - - if err := cdc.UnmarshalJSON(body, &res); err != nil { - return nil, err - } - return res.Validators, nil -} - -func queryEvidence(endpoint, hash string) (evidencetypes.QueryEvidenceResponse, error) { //nolint:unused // this is called during e2e tests - var res evidencetypes.QueryEvidenceResponse - body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence/%s", endpoint, hash)) - if err != nil { - return res, err - } - - if err = cdc.UnmarshalJSON(body, &res); err != nil { - return res, err - } - return res, nil -} - -func queryAllEvidence(endpoint string) (evidencetypes.QueryAllEvidenceResponse, error) { - var res evidencetypes.QueryAllEvidenceResponse - body, err := httpGet(fmt.Sprintf("%s/cosmos/evidence/v1beta1/evidence", endpoint)) - if err != nil { - return res, err - } - - if err = cdc.UnmarshalJSON(body, &res); err != nil { - return res, err - } - return res, nil -} diff --git a/tests/e2e/validator.go b/tests/e2e/validator.go index 6b3fe675..889f987e 100644 --- a/tests/e2e/validator.go +++ b/tests/e2e/validator.go @@ -185,7 +185,11 @@ func (c *chain) addAccountFromMnemonic(counts int) error { if err != nil { return err } + sdk.GetConfig().SetBech32PrefixForAccount("aura", "aurapub") + sdk.GetConfig().SetBech32PrefixForValidator("auravaloper", "auravaloperpub") + sdk.GetConfig().SetBech32PrefixForConsensusNode("auravalcons", "auravalconspub") info, err := kb.NewAccount(name, mnemonic, "", sdk.FullFundraiserPath, algo) + if err != nil { return err } From 60729d32cf47a6f6815cd6db74052d67fc4b8a9a Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Mon, 16 Jan 2023 16:50:45 +0700 Subject: [PATCH 11/12] Refactor --- tests/e2e/e2e_distribution_test.go | 3 + tests/e2e/e2e_exec_test.go | 96 +++++++++++++++--------------- tests/e2e/e2e_setup_test.go | 12 ++-- tests/e2e/e2e_staking_test.go | 3 + 4 files changed, 59 insertions(+), 55 deletions(-) diff --git a/tests/e2e/e2e_distribution_test.go b/tests/e2e/e2e_distribution_test.go index 1af215ca..801f1bf3 100644 --- a/tests/e2e/e2e_distribution_test.go +++ b/tests/e2e/e2e_distribution_test.go @@ -8,6 +8,9 @@ import ( ) func (s *IntegrationTestSuite) testDistribution() { + if len(s.chainA.validators) < 2 { + return + } chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) validatorB := s.chainA.validators[1] diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index a6effeba..213ed472 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -71,19 +71,19 @@ func (s *IntegrationTestSuite) execEncode( ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - s.T().Logf("%s - Executing gaiad encoding with %v", c.id, txPath) - gaiaCommand := []string{ + s.T().Logf("%s - Executing aurad encoding with %v", c.id, txPath) + auraCommand := []string{ auradBinary, txCommand, "encode", txPath, } for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + auraCommand = append(auraCommand, fmt.Sprintf("--%s=%v", flag, value)) } var encoded string - s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { + s.executeAuraTxCommand(ctx, c, auraCommand, 0, func(stdOut []byte, stdErr []byte) bool { if stdErr != nil { return false } @@ -103,19 +103,19 @@ func (s *IntegrationTestSuite) execDecode( ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - s.T().Logf("%s - Executing gaiad decoding with %v", c.id, txPath) - gaiaCommand := []string{ + s.T().Logf("%s - Executing aurad decoding with %v", c.id, txPath) + auraCommand := []string{ auradBinary, txCommand, "decode", txPath, } for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + auraCommand = append(auraCommand, fmt.Sprintf("--%s=%v", flag, value)) } var decoded string - s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, func(stdOut []byte, stdErr []byte) bool { + s.executeAuraTxCommand(ctx, c, auraCommand, 0, func(stdOut []byte, stdErr []byte) bool { if stdErr != nil { return false } @@ -137,20 +137,20 @@ func (s *IntegrationTestSuite) execVestingTx( defer cancel() s.T().Logf("%s - Executing gaiad %s with %v", c.id, method, args) - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, vestingtypes.ModuleName, method, "-y", } - gaiaCommand = append(gaiaCommand, args...) + auraCommand = append(auraCommand, args...) for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + auraCommand = append(auraCommand, fmt.Sprintf("--%s=%v", flag, value)) } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) + s.executeAuraTxCommand(ctx, c, auraCommand, 0, s.defaultExecValidation(c, 0)) s.T().Logf("successfully %s with %v", method, args) } @@ -174,7 +174,7 @@ func (s *IntegrationTestSuite) execUnjail( defer cancel() s.T().Logf("Executing gaiad slashing unjail %s with options: %v", c.id, opt) - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, slashingtypes.ModuleName, @@ -183,10 +183,10 @@ func (s *IntegrationTestSuite) execUnjail( } for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + auraCommand = append(auraCommand, fmt.Sprintf("--%s=%v", flag, value)) } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, 0, s.defaultExecValidation(c, 0)) + s.executeAuraTxCommand(ctx, c, auraCommand, 0, s.defaultExecValidation(c, 0)) s.T().Logf("successfully unjail with options %v", opt) } @@ -213,7 +213,7 @@ func (s *IntegrationTestSuite) execFeeGrant(c *chain, valIdx int, granter, grant gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.executeAuraTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) } func (s *IntegrationTestSuite) execFeeGrantRevoke(c *chain, valIdx int, granter, grantee string, opt ...flagOption) { @@ -225,7 +225,7 @@ func (s *IntegrationTestSuite) execFeeGrantRevoke(c *chain, valIdx int, granter, s.T().Logf("revoking %s fee grant from %s on chain %s", grantee, granter, c.id) - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, feegrant.ModuleName, @@ -235,10 +235,10 @@ func (s *IntegrationTestSuite) execFeeGrantRevoke(c *chain, valIdx int, granter, "-y", } for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + auraCommand = append(auraCommand, fmt.Sprintf("--%s=%v", flag, value)) } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, s.defaultExecValidation(c, valIdx)) } func (s *IntegrationTestSuite) execBankSend( @@ -261,7 +261,7 @@ func (s *IntegrationTestSuite) execBankSend( s.T().Logf("sending %s tokens from %s to %s on chain %s", amt, from, to, c.id) - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, banktypes.ModuleName, @@ -272,10 +272,10 @@ func (s *IntegrationTestSuite) execBankSend( "-y", } for flag, value := range opts { - gaiaCommand = append(gaiaCommand, fmt.Sprintf("--%s=%v", flag, value)) + auraCommand = append(auraCommand, fmt.Sprintf("--%s=%v", flag, value)) } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) } type txBankSend struct { @@ -312,7 +312,7 @@ func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, paye ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, distributiontypes.ModuleName, @@ -325,7 +325,7 @@ func (s *IntegrationTestSuite) execWithdrawAllRewards(c *chain, valIdx int, paye "-y", } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, s.expectErrExecValidation(c, valIdx, expectErr)) } func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valIdx int, from, amt, fees string) { @@ -334,7 +334,7 @@ func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valId s.T().Logf("Executing gaiad tx distribution fund-community-pool on chain %s", c.id) - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, distributiontypes.ModuleName, @@ -348,7 +348,7 @@ func (s *IntegrationTestSuite) execDistributionFundCommunityPool(c *chain, valId "-y", } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, s.defaultExecValidation(c, valIdx)) s.T().Logf("Successfully funded community pool") } @@ -356,7 +356,7 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, govtypes.ModuleName, @@ -372,10 +372,10 @@ func (s *IntegrationTestSuite) runGovExec(c *chain, valIdx int, submitterAddr, g "-y", } - gaiaCommand = concatFlags(gaiaCommand, proposalFlags, generalFlags) + auraCommand = concatFlags(auraCommand, proposalFlags, generalFlags) - s.T().Logf("Executing gaiad tx gov %s on chain %s", govCommand, c.id) - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.T().Logf("Executing aurad tx gov %s on chain %s", govCommand, c.id) + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, s.defaultExecValidation(c, valIdx)) s.T().Logf("Successfully executed %s", govCommand) } @@ -383,7 +383,7 @@ func (s *IntegrationTestSuite) executeGKeysAddCommand(c *chain, valIdx int, name ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, keysCommand, "add", @@ -394,7 +394,7 @@ func (s *IntegrationTestSuite) executeGKeysAddCommand(c *chain, valIdx int, name } var addrRecord AddressResponse - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { // Gaiad keys add by default returns payload to stdErr if err := json.Unmarshal(stdErr, &addrRecord); err != nil { return false @@ -408,7 +408,7 @@ func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, keysCommand, "list", @@ -417,7 +417,7 @@ func (s *IntegrationTestSuite) executeKeysList(c *chain, valIdx int, home string "--output=json", } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func([]byte, []byte) bool { + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, func([]byte, []byte) bool { return true }) } @@ -426,9 +426,9 @@ func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, val ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - s.T().Logf("Executing gaiad tx staking delegate %s", c.id) + s.T().Logf("Executing aurad tx staking delegate %s", c.id) - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, stakingtypes.ModuleName, @@ -445,7 +445,7 @@ func (s *IntegrationTestSuite) executeDelegate(c *chain, valIdx int, amount, val "-y", } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, s.defaultExecValidation(c, valIdx)) s.T().Logf("%s successfully delegated %s to %s", delegatorAddr, amount, valOperAddress) } @@ -455,9 +455,9 @@ func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, o ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - s.T().Logf("Executing gaiad tx staking redelegate %s", c.id) + s.T().Logf("Executing aurad tx staking redelegate %s", c.id) - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, stakingtypes.ModuleName, @@ -475,7 +475,7 @@ func (s *IntegrationTestSuite) executeRedelegate(c *chain, valIdx int, amount, o "-y", } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, s.defaultExecValidation(c, valIdx)) s.T().Logf("%s successfully redelegated %s from %s to %s", delegatorAddr, amount, originalValOperAddress, newValOperAddress) } @@ -490,8 +490,8 @@ func (s *IntegrationTestSuite) getLatestBlockHeight(c *chain, valIdx int) int { } var currentHeight int - gaiaCommand := []string{auradBinary, "status"} - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { + auraCommand := []string{auradBinary, "status"} + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, func(stdOut []byte, stdErr []byte) bool { var ( err error block syncInfo @@ -529,7 +529,7 @@ func (s *IntegrationTestSuite) execSetWithdrawAddress( defer cancel() s.T().Logf("Setting distribution withdrawal address on chain %s for %s to %s", c.id, delegatorAddress, newWithdrawalAddress) - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, distributiontypes.ModuleName, @@ -544,7 +544,7 @@ func (s *IntegrationTestSuite) execSetWithdrawAddress( "-y", } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, s.defaultExecValidation(c, valIdx)) s.T().Logf("Successfully set new distribution withdrawal address for %s to %s", delegatorAddress, newWithdrawalAddress) } @@ -559,7 +559,7 @@ func (s *IntegrationTestSuite) execWithdrawReward( defer cancel() s.T().Logf("Withdrawing distribution rewards on chain %s for delegator %s from %s validator", c.id, delegatorAddress, validatorAddress) - gaiaCommand := []string{ + auraCommand := []string{ auradBinary, txCommand, distributiontypes.ModuleName, @@ -576,11 +576,11 @@ func (s *IntegrationTestSuite) execWithdrawReward( "-y", } - s.executeGaiaTxCommand(ctx, c, gaiaCommand, valIdx, s.defaultExecValidation(c, valIdx)) + s.executeAuraTxCommand(ctx, c, auraCommand, valIdx, s.defaultExecValidation(c, valIdx)) s.T().Logf("Successfully withdrew distribution rewards for delegator %s from validator %s", delegatorAddress, validatorAddress) } -func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chain, gaiaCommand []string, valIdx int, validation func([]byte, []byte) bool) { +func (s *IntegrationTestSuite) executeAuraTxCommand(ctx context.Context, c *chain, auraCommand []string, valIdx int, validation func([]byte, []byte) bool) { if validation == nil { validation = s.defaultExecValidation(s.chainA, 0) } @@ -594,7 +594,7 @@ func (s *IntegrationTestSuite) executeGaiaTxCommand(ctx context.Context, c *chai AttachStderr: true, Container: s.valResources[c.id][valIdx].Container.ID, User: "nonroot", - Cmd: gaiaCommand, + Cmd: auraCommand, }) s.Require().NoError(err) diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index a2a3f1e6..cce5da5c 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -100,7 +100,7 @@ func (s *IntegrationTestSuite) SetupSuite() { } func (s *IntegrationTestSuite) TearDownSuite() { - if str := os.Getenv("GAIA_E2E_SKIP_CLEANUP"); len(str) > 0 { + if str := os.Getenv("AURA_E2E_SKIP_CLEANUP"); len(str) > 0 { skipCleanup, err := strconv.ParseBool(str) s.Require().NoError(err) @@ -271,7 +271,7 @@ func (s *IntegrationTestSuite) initValidatorConfigs(c *chain) { customAppTemplate := ` ############################################################################### -### Custom Gaia Configuration ### +### Custom Aura Configuration ### ############################################################################### # bypass-min-fee-msg-types defines custom message types the operator may set that # will bypass minimum fee checks during CheckTx. @@ -287,7 +287,7 @@ bypass-min-fee-msg-types = ["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRe // runValidators runs the validators in the chain func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { - s.T().Logf("starting Gaia %s validator containers...", c.id) + s.T().Logf("starting Aurad %s validator containers...", c.id) s.T().Logf("Number validators = %d", len(c.validators)) @@ -329,7 +329,7 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { s.Require().NoError(err) s.valResources[c.id][i] = resource - s.T().Logf("started Gaia %s validator container: %s", c.id, resource.Container.ID) + s.T().Logf("started Aurad %s validator container: %s", c.id, resource.Container.ID) } rpcClient, err := rpchttp.New("tcp://localhost:26657", "/websocket") @@ -341,8 +341,6 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { defer cancel() status, err := rpcClient.Status(ctx) - s.T().Logf("Status:-----%v", status) - s.T().Logf("Error:-----%v", err) if err != nil { return false } @@ -356,7 +354,7 @@ func (s *IntegrationTestSuite) runValidators(c *chain, portOffset int) { }, 5*time.Minute, time.Second, - "Gaia node failed to produce blocks", + "Aura node failed to produce blocks", ) } diff --git a/tests/e2e/e2e_staking_test.go b/tests/e2e/e2e_staking_test.go index 88078275..33dfadca 100644 --- a/tests/e2e/e2e_staking_test.go +++ b/tests/e2e/e2e_staking_test.go @@ -8,6 +8,9 @@ import ( ) func (s *IntegrationTestSuite) testStaking() { + if len(s.chainA.validators) < 2 { + return + } chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) validatorA := s.chainA.validators[0] From 10d959fd4c93f0f44f3fbbebeb46510e34017b9f Mon Sep 17 00:00:00 2001 From: tiennv1997 Date: Tue, 17 Jan 2023 14:09:29 +0700 Subject: [PATCH 12/12] Increase init validators --- tests/e2e/e2e_exec_test.go | 2 +- tests/e2e/e2e_setup_test.go | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/e2e/e2e_exec_test.go b/tests/e2e/e2e_exec_test.go index 213ed472..b552fdbf 100644 --- a/tests/e2e/e2e_exec_test.go +++ b/tests/e2e/e2e_exec_test.go @@ -593,7 +593,7 @@ func (s *IntegrationTestSuite) executeAuraTxCommand(ctx context.Context, c *chai AttachStdout: true, AttachStderr: true, Container: s.valResources[c.id][valIdx].Container.ID, - User: "nonroot", + User: "root", Cmd: auraCommand, }) s.Require().NoError(err) diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index cce5da5c..5a429d1c 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -32,13 +32,15 @@ import ( ) const ( - auradBinary = "/usr/bin/aurad" - txCommand = "tx" - keysCommand = "keys" - auraHomePath = "/root/.aura" - uauraDenom = "uaura" - minGasPrice = "0.00001" - gas = 200000 + auradBinary = "/usr/bin/aurad" + txCommand = "tx" + keysCommand = "keys" + auraHomePath = "/root/.aura" + uauraDenom = "uaura" + minGasPrice = "0.00001" + gas = 200000 + numberInitValidators = 2 + numberInitAccounts = 4 ) var ( @@ -127,8 +129,8 @@ func (s *IntegrationTestSuite) TearDownSuite() { } func (s *IntegrationTestSuite) initNodes(c *chain) { - s.Require().NoError(c.createAndInitValidators(1)) - s.Require().NoError(c.addAccountFromMnemonic(4)) + s.Require().NoError(c.createAndInitValidators(numberInitValidators)) + s.Require().NoError(c.addAccountFromMnemonic(numberInitAccounts)) // Initialize a genesis file for the first validator val0ConfigDir := c.validators[0].configDir()