From 80b15c73c58eb9d14ef05569be024efc280ef499 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:26:13 -0500 Subject: [PATCH 01/17] delete old generated app --- app/abci.go | 144 -- app/abci_test.go | 365 ----- app/app.go | 596 ------- app/encoding.go | 16 - app/export.go | 185 --- app/genesis.go | 20 - app/params/encoding.go | 31 - app/params/proto.go | 22 - app/prefix.go | 25 - app/types.go | 40 - cmd/celestia-appd/cmd/app.go | 3 - cmd/celestia-appd/cmd/genaccounts.go | 191 --- cmd/celestia-appd/cmd/root.go | 265 ---- cmd/celestia-appd/main.go | 14 - internal/tools/tools.go | 10 - x/payment/client/builder.go | 186 --- x/payment/client/builder_test.go | 141 -- x/payment/client/cli/payformessage.go | 82 - x/payment/client/cli/query.go | 30 - x/payment/client/cli/tx.go | 26 - x/payment/client/rest/rest.go | 25 - x/payment/genesis.go | 17 - x/payment/handler.go | 31 - x/payment/keeper/grpc_query.go | 7 - x/payment/keeper/keeper.go | 58 - x/payment/keeper/msg_server.go | 27 - x/payment/keeper/query.go | 29 - x/payment/module.go | 166 -- x/payment/types/codec.go | 24 - x/payment/types/errors.go | 12 - x/payment/types/genesis.go | 15 - x/payment/types/genesis.pb.go | 266 ---- x/payment/types/keys.go | 22 - x/payment/types/payformessage.go | 356 ----- x/payment/types/payformessage_test.go | 336 ---- x/payment/types/query.go | 1 - x/payment/types/query.pb.go | 86 - x/payment/types/tx.pb.go | 2093 ------------------------- x/payment/types/tx.pb.gw.go | 166 -- x/payment/types/types.go | 1 - 40 files changed, 6130 deletions(-) delete mode 100644 app/abci.go delete mode 100644 app/abci_test.go delete mode 100644 app/app.go delete mode 100644 app/encoding.go delete mode 100644 app/export.go delete mode 100644 app/genesis.go delete mode 100644 app/params/encoding.go delete mode 100644 app/params/proto.go delete mode 100644 app/prefix.go delete mode 100644 app/types.go delete mode 100644 cmd/celestia-appd/cmd/app.go delete mode 100644 cmd/celestia-appd/cmd/genaccounts.go delete mode 100644 cmd/celestia-appd/cmd/root.go delete mode 100644 cmd/celestia-appd/main.go delete mode 100644 internal/tools/tools.go delete mode 100644 x/payment/client/builder.go delete mode 100644 x/payment/client/builder_test.go delete mode 100644 x/payment/client/cli/payformessage.go delete mode 100644 x/payment/client/cli/query.go delete mode 100644 x/payment/client/cli/tx.go delete mode 100644 x/payment/client/rest/rest.go delete mode 100644 x/payment/genesis.go delete mode 100644 x/payment/handler.go delete mode 100644 x/payment/keeper/grpc_query.go delete mode 100644 x/payment/keeper/keeper.go delete mode 100644 x/payment/keeper/msg_server.go delete mode 100644 x/payment/keeper/query.go delete mode 100644 x/payment/module.go delete mode 100644 x/payment/types/codec.go delete mode 100644 x/payment/types/errors.go delete mode 100644 x/payment/types/genesis.go delete mode 100644 x/payment/types/genesis.pb.go delete mode 100644 x/payment/types/keys.go delete mode 100644 x/payment/types/payformessage.go delete mode 100644 x/payment/types/payformessage_test.go delete mode 100644 x/payment/types/query.go delete mode 100644 x/payment/types/query.pb.go delete mode 100644 x/payment/types/tx.pb.go delete mode 100644 x/payment/types/tx.pb.gw.go delete mode 100644 x/payment/types/types.go diff --git a/app/abci.go b/app/abci.go deleted file mode 100644 index f32c8d8e8c..0000000000 --- a/app/abci.go +++ /dev/null @@ -1,144 +0,0 @@ -package app - -import ( - "bytes" - "errors" - "fmt" - "sort" - - "github.com/celestiaorg/celestia-app/x/payment/types" - abci "github.com/celestiaorg/celestia-core/abci/types" - core "github.com/celestiaorg/celestia-core/proto/tendermint/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// This file should contain all of the altered ABCI methods - -// PreprocessTxs fullfills the celestia-core version of the ACBI interface, by -// performing basic validation for the incoming txs, and by cleanly separating -// share messages from transactions -func (app *App) PreprocessTxs(txs abci.RequestPreprocessTxs) abci.ResponsePreprocessTxs { - squareSize := app.SquareSize() - shareCounter := uint64(0) - var shareMsgs []*core.Message - var processedTxs [][]byte - for _, rawTx := range txs.Txs { - // decode the Tx - tx, err := app.txConfig.TxDecoder()(rawTx) - if err != nil { - continue - } - - // don't process the tx if the transaction doesn't contain a - // PayForMessage sdk.Msg - if !hasWirePayForMessage(tx) { - processedTxs = append(processedTxs, rawTx) - continue - } - - // only support transactions that contain a single sdk.Msg - if len(tx.GetMsgs()) != 1 { - continue - } - - msg := tx.GetMsgs()[0] - - // run basic validation on the transaction - err = tx.ValidateBasic() - if err != nil { - continue - } - - // process the message - coreMsg, signedTx, err := app.processMsg(msg) - if err != nil { - continue - } - - // increment the share counter by the number of shares taken by the message - sharesTaken := uint64(len(coreMsg.Data) / types.ShareSize) - shareCounter += sharesTaken - - // if there are too many shares stop processing and return the transactions - if shareCounter > squareSize*squareSize { - break - } - - // encode the processed tx - rawProcessedTx, err := app.appCodec.MarshalBinaryBare(signedTx) - if err != nil { - continue - } - - // add the message and tx to the output - shareMsgs = append(shareMsgs, &coreMsg) - processedTxs = append(processedTxs, rawProcessedTx) - } - - // sort messages lexigraphically - sort.Slice(shareMsgs, func(i, j int) bool { - return bytes.Compare(shareMsgs[i].NamespaceId, shareMsgs[j].NamespaceId) < 0 - }) - - return abci.ResponsePreprocessTxs{ - Txs: processedTxs, - Messages: &core.Messages{MessagesList: shareMsgs}, - } -} - -func hasWirePayForMessage(tx sdk.Tx) bool { - for _, msg := range tx.GetMsgs() { - if msg.Type() == types.TypeMsgPayforMessage { - return true - } - } - return false -} - -// processMsgs will perform the processing required by PreProcessTxs for a set -// of sdk.Msg's from a single sdk.Tx -func (app *App) processMsg(msg sdk.Msg) (core.Message, *types.TxSignedTransactionDataPayForMessage, error) { - squareSize := app.SquareSize() - // reject all msgs in tx if a single included msg is not correct type - wireMsg, ok := msg.(*types.MsgWirePayForMessage) - if !ok { - return core.Message{}, - nil, - errors.New("transaction contained a message type other than types.MsgWirePayForMessage") - } - - // make sure that a ShareCommitAndSignature of the correct size is - // included in the message - var shareCommit types.ShareCommitAndSignature - for _, commit := range wireMsg.MessageShareCommitment { - if commit.K == squareSize { - shareCommit = commit - } - } - // K == 0 means there was no share commit with the desired current square size - if shareCommit.K == 0 { - return core.Message{}, - nil, - fmt.Errorf("No share commit for correct square size. Current square size: %d", squareSize) - } - - // add the message to the list of core message to be returned to ll-core - coreMsg := core.Message{ - NamespaceId: wireMsg.GetMessageNameSpaceId(), - Data: wireMsg.GetMessage(), - } - - // wrap the signed transaction data - sTxData, err := wireMsg.SignedTransactionDataPayForMessage(squareSize) - if err != nil { - return core.Message{}, nil, err - } - - signedData := &types.TxSignedTransactionDataPayForMessage{ - Message: sTxData, - Signature: shareCommit.Signature, - PublicKey: wireMsg.PublicKey, - } - - return coreMsg, signedData, nil -} diff --git a/app/abci_test.go b/app/abci_test.go deleted file mode 100644 index 3682af4629..0000000000 --- a/app/abci_test.go +++ /dev/null @@ -1,365 +0,0 @@ -package app - -import ( - "bytes" - "encoding/json" - "fmt" - "os" - "testing" - - "github.com/celestiaorg/celestia-app/x/payment/types" - abci "github.com/celestiaorg/celestia-core/abci/types" - "github.com/celestiaorg/celestia-core/libs/log" - core "github.com/celestiaorg/celestia-core/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/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" - "github.com/cosmos/cosmos-sdk/simapp" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx/signing" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/spf13/cast" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - dbm "github.com/tendermint/tm-db" -) - -const testingKeyAcc = "test" - -// Get flags every time the simulator is run -func init() { - simapp.GetSimulatorFlags() -} - -func TestProcessMsg(t *testing.T) { - kb := keyring.NewInMemory() - info, _, err := kb.NewMnemonic(testingKeyAcc, keyring.English, "", hd.Secp256k1) - if err != nil { - t.Error(err) - } - ns := []byte{1, 1, 1, 1, 1, 1, 1, 1} - message := bytes.Repeat([]byte{1}, 256) - - // create a signed MsgWirePayFroMessage - msg := generateSignedWirePayForMessage(t, types.SquareSize, ns, message, kb) - - testApp := setupApp(t, info.GetPubKey()) - - tests := []struct { - name string - args sdk.Msg - want core.Message - }{ - { - name: "basic", - args: msg, - want: core.Message{NamespaceId: msg.MessageNameSpaceId, Data: msg.Message}, - }, - } - for _, tt := range tests { - result, _, err := testApp.processMsg(tt.args) - if err != nil { - t.Error(err) - } - assert.Equal(t, tt.want, result, tt.name) - } -} - -func TestPreprocessTxs(t *testing.T) { - kb := keyring.NewInMemory() - info, _, err := kb.NewMnemonic(testingKeyAcc, keyring.English, "", hd.Secp256k1) - if err != nil { - t.Error(err) - } - - testApp := setupApp(t, info.GetPubKey()) - - type test struct { - input abci.RequestPreprocessTxs - expectedMessages []*core.Message - expectedTxs int - } - - firstNS := []byte{2, 2, 2, 2, 2, 2, 2, 2} - firstMessage := bytes.Repeat([]byte{2}, 512) - firstRawTx := generateRawTx(t, testApp.txConfig, firstNS, firstMessage, kb) - - secondNS := []byte{1, 1, 1, 1, 1, 1, 1, 1} - secondMessage := []byte{2} - secondRawTx := generateRawTx(t, testApp.txConfig, secondNS, secondMessage, kb) - - thirdNS := []byte{3, 3, 3, 3, 3, 3, 3, 3} - thirdMessage := []byte{} - thirdRawTx := generateRawTx(t, testApp.txConfig, thirdNS, thirdMessage, kb) - - tests := []test{ - { - input: abci.RequestPreprocessTxs{ - Txs: [][]byte{firstRawTx, secondRawTx, thirdRawTx}, - }, - expectedMessages: []*core.Message{ - { - NamespaceId: secondNS, // the second message should be first - Data: append([]byte{2}, bytes.Repeat([]byte{0}, 255)...), // check that the message is padded - }, - { - NamespaceId: firstNS, - Data: firstMessage, - }, - { - NamespaceId: thirdNS, - Data: nil, - }, - }, - expectedTxs: 3, - }, - } - - for _, tt := range tests { - res := testApp.PreprocessTxs(tt.input) - assert.Equal(t, tt.expectedMessages, res.Messages.MessagesList) - assert.Equal(t, tt.expectedTxs, len(res.Txs)) - } -} - -func setupApp(t *testing.T, pub cryptotypes.PubKey) *App { - // var cache sdk.MultiStorePersistentCache - // EmptyAppOptions is a stub implementing AppOptions - emptyOpts := emptyAppOptions{} - var anteOpt = func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(nil) } - db := dbm.NewMemDB() - logger := log.NewTMLogger(log.NewSyncWriter(os.Stderr)) - - skipUpgradeHeights := make(map[int64]bool) - - testApp := New( - "test-app", logger, db, nil, true, skipUpgradeHeights, - cast.ToString(emptyOpts.Get(flags.FlagHome)), - cast.ToUint(emptyOpts.Get(server.FlagInvCheckPeriod)), - MakeEncodingConfig(), - emptyOpts, - anteOpt, - ) - - for acc := range maccPerms { - require.Equal(t, !allowedReceivingModAcc[acc], testApp.BankKeeper.BlockedAddr(testApp.AccountKeeper.GetModuleAddress(acc)), - "ensure that blocked addresses are properly set in bank keeper") - } - - genesisState := NewDefaultGenesisState() - - genesisState, err := addGenesisAccount(sdk.AccAddress(pub.Address().Bytes()), genesisState, testApp.appCodec) - if err != nil { - t.Error(err) - } - - stateBytes, err := json.MarshalIndent(genesisState, "", " ") - require.NoError(t, err) - - // Initialize the chain - testApp.InitChain( - abci.RequestInitChain{ - Validators: []abci.ValidatorUpdate{}, - AppStateBytes: stateBytes, - }, - ) - - return testApp -} - -type emptyAppOptions struct{} - -// Get implements AppOptions -func (ao emptyAppOptions) Get(o string) interface{} { - return nil -} - -// addGenesisAccount mimics the cli addGenesisAccount command, providing an -// account with an allocation of to "token" and "stake" tokens in the genesis -// state -func addGenesisAccount(addr sdk.AccAddress, appState map[string]json.RawMessage, cdc codec.Marshaler) (map[string]json.RawMessage, error) { - // create concrete account type based on input parameters - var genAccount authtypes.GenesisAccount - - coins := sdk.Coins{ - sdk.NewCoin("token", sdk.NewInt(1000000)), - sdk.NewCoin("stake", sdk.NewInt(1000000)), - } - - balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} - baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) - - genAccount = baseAccount - - if err := genAccount.Validate(); err != nil { - return appState, fmt.Errorf("failed to validate new genesis account: %w", err) - } - - authGenState := authtypes.GetGenesisStateFromAppState(cdc, appState) - - accs, err := authtypes.UnpackAccounts(authGenState.Accounts) - if err != nil { - return appState, fmt.Errorf("failed to get accounts from any: %w", err) - } - - if accs.Contains(addr) { - return appState, fmt.Errorf("cannot add account at existing address %s", addr) - } - - // Add the new account to the set of genesis accounts and sanitize the - // accounts afterwards. - accs = append(accs, genAccount) - accs = authtypes.SanitizeGenesisAccounts(accs) - - genAccs, err := authtypes.PackAccounts(accs) - if err != nil { - return appState, fmt.Errorf("failed to convert accounts into any's: %w", err) - } - authGenState.Accounts = genAccs - - authGenStateBz, err := cdc.MarshalJSON(&authGenState) - if err != nil { - return appState, 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 appState, fmt.Errorf("failed to marshal bank genesis state: %w", err) - } - - appState[banktypes.ModuleName] = bankGenStateBz - return appState, nil -} - -func generateRawTx(t *testing.T, txConfig client.TxConfig, ns, message []byte, ring keyring.Keyring) (rawTx []byte) { - // create a msg - msg := generateSignedWirePayForMessage(t, types.SquareSize, ns, message, ring) - - info, err := ring.Key(testingKeyAcc) - if err != nil { - t.Error(err) - } - - // this is returning a tx.wrapper - builder := txConfig.NewTxBuilder() - err = builder.SetMsgs(msg) - if err != nil { - t.Error(err) - } - - coin := sdk.Coin{ - Denom: "token", - Amount: sdk.NewInt(1000), - } - - builder.SetFeeAmount(sdk.NewCoins(coin)) - builder.SetGasLimit(10000) - builder.SetTimeoutHeight(99) - - signingData := authsigning.SignerData{ - ChainID: "test-chain", - AccountNumber: 0, - Sequence: 0, - } - - // Important set the Signature to nil BEFORE actually signing - sigData := signing.SingleSignatureData{ - SignMode: signing.SignMode_SIGN_MODE_DIRECT, - Signature: nil, - } - - sig := signing.SignatureV2{ - PubKey: info.GetPubKey(), - Data: &sigData, - Sequence: 0, - } - - // set the empty signature - err = builder.SetSignatures(sig) - if err != nil { - if err != nil { - t.Error(err) - } - } - - // Generate the bytes to be signed. - bytesToSign, err := txConfig. - SignModeHandler(). - GetSignBytes( - signing.SignMode_SIGN_MODE_DIRECT, - signingData, - builder.GetTx(), - ) - if err != nil { - t.Error(err) - } - - // Sign those bytes - sigBytes, _, err := ring.Sign(testingKeyAcc, bytesToSign) - if err != nil { - t.Error(err) - } - - // Construct the SignatureV2 struct - sigData = signing.SingleSignatureData{ - SignMode: signing.SignMode_SIGN_MODE_DIRECT, - Signature: sigBytes, - } - - sigV2 := signing.SignatureV2{ - PubKey: info.GetPubKey(), - Data: &sigData, - Sequence: 0, - } - - // set the actual signature - err = builder.SetSignatures(sigV2) - if err != nil { - if err != nil { - t.Error(err) - } - } - - // finish the tx - tx := builder.GetTx() - - // encode the tx - rawTx, err = txConfig.TxEncoder()(tx) - if err != nil { - t.Error(err) - } - - return rawTx -} - -func generateSignedWirePayForMessage(t *testing.T, k uint64, ns, message []byte, ring keyring.Keyring) *types.MsgWirePayForMessage { - info, err := ring.Key(testingKeyAcc) - if err != nil { - t.Error(err) - } - - msg, err := types.NewMsgWirePayForMessage(ns, message, info.GetPubKey().Bytes(), &types.TransactionFee{}, k) - if err != nil { - t.Error(err) - } - - err = msg.SignShareCommitments(testingKeyAcc, ring) - if err != nil { - t.Error(err) - } - - return msg -} diff --git a/app/app.go b/app/app.go deleted file mode 100644 index ad07672b82..0000000000 --- a/app/app.go +++ /dev/null @@ -1,596 +0,0 @@ -package app - -import ( - "io" - "math/big" - "os" - "path/filepath" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/pelletier/go-toml" - "github.com/spf13/cast" - - abci "github.com/celestiaorg/celestia-core/abci/types" - "github.com/celestiaorg/celestia-core/libs/log" - tmos "github.com/celestiaorg/celestia-core/libs/os" - dbm "github.com/tendermint/tm-db" - - appparams "github.com/celestiaorg/celestia-app/app/params" - "github.com/celestiaorg/celestia-app/x/payment" - paymentkeeper "github.com/celestiaorg/celestia-app/x/payment/keeper" - paymenttypes "github.com/celestiaorg/celestia-app/x/payment/types" - tmjson "github.com/celestiaorg/celestia-core/libs/json" - tmproto "github.com/celestiaorg/celestia-core/proto/tendermint/types" - rpchttp "github.com/celestiaorg/celestia-core/rpc/client/http" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/server/api" - "github.com/cosmos/cosmos-sdk/server/config" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/cosmos/cosmos-sdk/x/auth/ante" - authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" - authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/auth/vesting" - "github.com/cosmos/cosmos-sdk/x/bank" - bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/capability" - capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" - capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - 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" - 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" - evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - transfer "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer" - ibctransferkeeper "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/keeper" - ibctransfertypes "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types" - ibc "github.com/cosmos/cosmos-sdk/x/ibc/core" - porttypes "github.com/cosmos/cosmos-sdk/x/ibc/core/05-port/types" - ibchost "github.com/cosmos/cosmos-sdk/x/ibc/core/24-host" - ibckeeper "github.com/cosmos/cosmos-sdk/x/ibc/core/keeper" - "github.com/cosmos/cosmos-sdk/x/mint" - mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" - minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/cosmos/cosmos-sdk/x/params" - paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/cosmos/cosmos-sdk/x/slashing" - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" - stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - // this line is used by starport scaffolding # stargate/app/moduleImport -) - -var ( - // DefaultNodeHome default home directories for the application daemon - DefaultNodeHome = func(appName string) string { - return os.ExpandEnv("$HOME/.payment") - } - - // ModuleBasics defines the module BasicManager is in charge of setting up basic, - // non-dependant module elements, such as codec registration - // and genesis verification. - ModuleBasics = module.NewBasicManager( - auth.AppModuleBasic{}, - genutil.AppModuleBasic{}, - bank.AppModuleBasic{}, - capability.AppModuleBasic{}, - staking.AppModuleBasic{}, - mint.AppModuleBasic{}, - distr.AppModuleBasic{}, - // gov.NewAppModuleBasic( - // paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, upgradeclient.CancelProposalHandler, - // ), - params.AppModuleBasic{}, - crisis.AppModuleBasic{}, - slashing.AppModuleBasic{}, - ibc.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - evidence.AppModuleBasic{}, - transfer.AppModuleBasic{}, - vesting.AppModuleBasic{}, - payment.AppModuleBasic{}, - // this line is used by starport scaffolding # stargate/app/moduleBasic - ) - - // module account permissions - maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - // govtypes.ModuleName: {authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - } - - // module accounts that are allowed to receive tokens - allowedReceivingModAcc = map[string]bool{ - distrtypes.ModuleName: true, - } -) - -var ( - _ CosmosApp = (*App)(nil) - _ servertypes.Application = (*App)(nil) -) - -// App extends an ABCI application, but with most of its parameters exported. -// They are exported for convenience in creating helper functions, as object -// capabilities aren't needed for testing. -type App struct { - *baseapp.BaseApp - - appName string - squareSize uint64 - - cdc *codec.LegacyAmino - appCodec codec.Marshaler - txConfig client.TxConfig - interfaceRegistry types.InterfaceRegistry - - invCheckPeriod uint - - // keys to access the substores - keys map[string]*sdk.KVStoreKey - tkeys map[string]*sdk.TransientStoreKey - memKeys map[string]*sdk.MemoryStoreKey - - // keepers - AccountKeeper authkeeper.AccountKeeper - BankKeeper bankkeeper.Keeper - CapabilityKeeper *capabilitykeeper.Keeper - StakingKeeper stakingkeeper.Keeper - SlashingKeeper slashingkeeper.Keeper - MintKeeper mintkeeper.Keeper - DistrKeeper distrkeeper.Keeper - // GovKeeper govkeeper.Keeper - CrisisKeeper crisiskeeper.Keeper - UpgradeKeeper upgradekeeper.Keeper - ParamsKeeper paramskeeper.Keeper - IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - EvidenceKeeper evidencekeeper.Keeper - TransferKeeper ibctransferkeeper.Keeper - - // make scoped keepers public for test purposes - ScopedIBCKeeper capabilitykeeper.ScopedKeeper - ScopedTransferKeeper capabilitykeeper.ScopedKeeper - - paymentKeeper paymentkeeper.Keeper - // this line is used by starport scaffolding # stargate/app/keeperDeclaration - - // the module manager - mm *module.Manager -} - -// New returns a reference to an initialized Gaia. -// NewSimApp returns a reference to an initialized SimApp. -func New( - appName string, logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, skipUpgradeHeights map[int64]bool, - homePath string, invCheckPeriod uint, encodingConfig appparams.EncodingConfig, - appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp), -) *App { - - appCodec := encodingConfig.Marshaler - cdc := encodingConfig.Amino - interfaceRegistry := encodingConfig.InterfaceRegistry - txConfig := encodingConfig.TxConfig - - bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) - bApp.SetCommitMultiStoreTracer(traceStore) - bApp.SetAppVersion(version.Version) - bApp.SetInterfaceRegistry(interfaceRegistry) - - keys := sdk.NewKVStoreKeys( - authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, - minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, - evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, - paymenttypes.StoreKey, - // this line is used by starport scaffolding # stargate/app/storeKey - ) - tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) - memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) - - app := &App{ - BaseApp: bApp, - appName: appName, - // todo(evan): don't hardcode square size - squareSize: paymenttypes.SquareSize, - cdc: cdc, - appCodec: appCodec, - txConfig: txConfig, - interfaceRegistry: interfaceRegistry, - invCheckPeriod: invCheckPeriod, - keys: keys, - tkeys: tkeys, - memKeys: memKeys, - } - - app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) - - // set the BaseApp's parameter store - bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable())) - - // add capability keeper and ScopeToModule for ibc module - app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) - - // grant capabilities for the ibc and ibc-transfer modules - scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) - scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) - - // add keepers - app.AccountKeeper = authkeeper.NewAccountKeeper( - appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, - ) - app.BankKeeper = bankkeeper.NewBaseKeeper( - appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.BlockedAddrs(), - ) - stakingKeeper := stakingkeeper.NewKeeper( - appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName), - ) - app.MintKeeper = mintkeeper.NewKeeper( - appCodec, keys[minttypes.StoreKey], app.GetSubspace(minttypes.ModuleName), &stakingKeeper, - app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, - ) - app.DistrKeeper = distrkeeper.NewKeeper( - appCodec, keys[distrtypes.StoreKey], app.GetSubspace(distrtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, authtypes.FeeCollectorName, app.ModuleAccountAddrs(), - ) - app.SlashingKeeper = slashingkeeper.NewKeeper( - appCodec, keys[slashingtypes.StoreKey], &stakingKeeper, app.GetSubspace(slashingtypes.ModuleName), - ) - app.CrisisKeeper = crisiskeeper.NewKeeper( - app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, - ) - app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath) - - // register the staking hooks - // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks - app.StakingKeeper = *stakingKeeper.SetHooks( - stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), - ) - - // ... other modules keepers - - // Create IBC Keeper - ibcClientSubspace := paramstypes.NewSubspace(appCodec, cdc, keys[ibchost.StoreKey], keys[ibchost.StoreKey], "ibc") - app.IBCKeeper = ibckeeper.NewKeeper( - appCodec, keys[ibchost.StoreKey], ibcClientSubspace, app.StakingKeeper, scopedIBCKeeper, - ) - - // // register the proposal types - // govRouter := govtypes.NewRouter() - // govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). - // AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - // AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - // AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - // AddRoute(ibchost.RouterKey, ibcclient.NewClientUpdateProposalHandler(app.IBCKeeper.ClientKeeper)) - // app.GovKeeper = govkeeper.NewKeeper( - // appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - // &stakingKeeper, govRouter, - // ) - - // Create Transfer Keepers - app.TransferKeeper = ibctransferkeeper.NewKeeper( - appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), - app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, - app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, - ) - transferModule := transfer.NewAppModule(app.TransferKeeper) - - // Create static IBC router, add transfer route, then set and seal it - ibcRouter := porttypes.NewRouter() - ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule) - app.IBCKeeper.SetRouter(ibcRouter) - - // Create evidence Keeper for to register the IBC light client misbehaviour evidence route - evidenceKeeper := evidencekeeper.NewKeeper( - appCodec, keys[evidencetypes.StoreKey], &app.StakingKeeper, app.SlashingKeeper, - ) - // If evidence needs to be handled for the app, set routes in router here and seal - app.EvidenceKeeper = *evidenceKeeper - - app.paymentKeeper = *paymentkeeper.NewKeeper( - appCodec, - app.BankKeeper, - keys[paymenttypes.StoreKey], - keys[paymenttypes.MemStoreKey], - sdk.NewIntFromBigInt(big.NewInt(1000)), - ) - - // this line is used by starport scaffolding # stargate/app/keeperDefinition - - /**** Module Options ****/ - - // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment - // we prefer to be more strict in what arguments the modules expect. - var skipGenesisInvariants = cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) - - // NOTE: Any module instantiated in the module manager that is later modified - // must be passed by reference here. - - app.mm = module.NewManager( - genutil.NewAppModule( - app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, - encodingConfig.TxConfig, - ), - auth.NewAppModule(appCodec, app.AccountKeeper, nil), - vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), - bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), - capability.NewAppModule(appCodec, *app.CapabilityKeeper), - crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), - // 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), - staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - upgrade.NewAppModule(app.UpgradeKeeper), - evidence.NewAppModule(app.EvidenceKeeper), - ibc.NewAppModule(app.IBCKeeper), - params.NewAppModule(app.ParamsKeeper), - transferModule, - payment.NewAppModule(appCodec, app.paymentKeeper), - // this line is used by starport scaffolding # stargate/app/appModule - ) - - // During begin block slashing happens after distr.BeginBlocker so that - // there is nothing left over in the validator fee pool, so as to keep the - // CanWithdrawInvariant invariant. - // NOTE: staking module is required if HistoricalEntries param > 0 - app.mm.SetOrderBeginBlockers( - upgradetypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, - evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, - ) - - app.mm.SetOrderEndBlockers(crisistypes.ModuleName, stakingtypes.ModuleName) - - // NOTE: The genutils module must occur after staking so that pools are - // properly initialized with tokens from genesis accounts. - // NOTE: Capability module must occur first so that it can initialize any capabilities - // so that other modules that want to create or claim capabilities afterwards in InitChain - // can do so safely. - app.mm.SetOrderInitGenesis( - capabilitytypes.ModuleName, - authtypes.ModuleName, - banktypes.ModuleName, - distrtypes.ModuleName, - stakingtypes.ModuleName, - slashingtypes.ModuleName, - // govtypes.ModuleName, - minttypes.ModuleName, - crisistypes.ModuleName, - ibchost.ModuleName, - genutiltypes.ModuleName, - evidencetypes.ModuleName, - ibctransfertypes.ModuleName, - // this line is used by starport scaffolding # stargate/app/initGenesis - ) - - app.mm.RegisterInvariants(&app.CrisisKeeper) - app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) - app.mm.RegisterServices(module.NewConfigurator(app.MsgServiceRouter(), app.GRPCQueryRouter())) - - // initialize stores - app.MountKVStores(keys) - app.MountTransientStores(tkeys) - app.MountMemoryStores(memKeys) - - // initialize BaseApp - app.SetInitChainer(app.InitChainer) - app.SetBeginBlocker(app.BeginBlocker) - app.SetAnteHandler( - ante.NewAnteHandler( - app.AccountKeeper, app.BankKeeper, ante.DefaultSigVerificationGasConsumer, - encodingConfig.TxConfig.SignModeHandler(), - ), - ) - app.SetEndBlocker(app.EndBlocker) - - if loadLatest { - if err := app.LoadLatestVersion(); err != nil { - tmos.Exit(err.Error()) - } - - // Initialize and seal the capability keeper so all persistent capabilities - // are loaded in-memory and prevent any further modules from creating scoped - // sub-keepers. - // This must be done during creation of baseapp rather than in InitChain so - // that in-memory capabilities get regenerated on app restart. - // Note that since this reads from the store, we can only perform it when - // `loadLatest` is set to true. - ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{}) - app.CapabilityKeeper.InitializeAndSeal(ctx) - } - - app.ScopedIBCKeeper = scopedIBCKeeper - app.ScopedTransferKeeper = scopedTransferKeeper - - return app -} - -// Name returns the name of the App -func (app *App) Name() string { return app.BaseApp.Name() } - -// BeginBlocker application updates every begin block -func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) -} - -// EndBlocker application updates every end block -func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { - return app.mm.EndBlock(ctx, req) -} - -// InitChainer application update at chain initialization -func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { - var genesisState GenesisState - if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { - panic(err) - } - return app.mm.InitGenesis(ctx, app.appCodec, genesisState) -} - -// LoadHeight loads a particular height -func (app *App) LoadHeight(height int64) error { - return app.LoadVersion(height) -} - -// ModuleAccountAddrs returns all the app's module account addresses. -func (app *App) ModuleAccountAddrs() map[string]bool { - modAccAddrs := make(map[string]bool) - for acc := range maccPerms { - modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true - } - - return modAccAddrs -} - -// BlockedAddrs returns all the app's module account addresses that are not -// allowed to receive external tokens. -func (app *App) BlockedAddrs() map[string]bool { - blockedAddrs := make(map[string]bool) - for acc := range maccPerms { - blockedAddrs[authtypes.NewModuleAddress(acc).String()] = !allowedReceivingModAcc[acc] - } - - return blockedAddrs -} - -// LegacyAmino returns SimApp's amino codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *App) LegacyAmino() *codec.LegacyAmino { - return app.cdc -} - -// AppCodec returns Gaia's app codec. -// -// NOTE: This is solely to be used for testing purposes as it may be desirable -// for modules to register their own custom testing types. -func (app *App) AppCodec() codec.Marshaler { - return app.appCodec -} - -// InterfaceRegistry returns Gaia's InterfaceRegistry -func (app *App) InterfaceRegistry() types.InterfaceRegistry { - return app.interfaceRegistry -} - -// GetKey returns the KVStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetKey(storeKey string) *sdk.KVStoreKey { - return app.keys[storeKey] -} - -// GetTKey returns the TransientStoreKey for the provided store key. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetTKey(storeKey string) *sdk.TransientStoreKey { - return app.tkeys[storeKey] -} - -// GetMemKey returns the MemStoreKey for the provided mem key. -// -// NOTE: This is solely used for testing purposes. -func (app *App) GetMemKey(storeKey string) *sdk.MemoryStoreKey { - return app.memKeys[storeKey] -} - -// GetSubspace returns a param subspace for a given module name. -// -// NOTE: This is solely to be used for testing purposes. -func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) - return subspace -} - -// RegisterAPIRoutes registers all application module routes with the provided -// API server. -func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { - clientCtx := apiSvr.ClientCtx - rpc.RegisterRoutes(clientCtx, apiSvr.Router) - // Register legacy tx routes. - authrest.RegisterTxRoutes(clientCtx, apiSvr.Router) - // Register new tx routes from grpc-gateway. - authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) - - // Register legacy and grpc-gateway routes for all modules. - ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router) - ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) -} - -// RegisterTxService implements the Application.RegisterTxService method. -func (app *App) RegisterTxService(clientCtx client.Context) { - // TODO remove this workaround after https://github.com/cosmos/cosmos-sdk/pull/7840 has merged. - // -- right now, clientCtx does not have a Client set. this workaround fixes that. - config, err := toml.LoadFile(filepath.Join(DefaultNodeHome(""), "config/config.toml")) - if err != nil { - panic(err) - } - client, err := rpchttp.New(config.Get("rpc.laddr").(string), "/websocket") - if err != nil { - panic(err) - } - clientCtx = clientCtx.WithClient(client) - // -- end of the workaround. - authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) -} - -// TODO(evan): fill in to actually register the service -func (app *App) RegisterTendermintService(clientCtx client.Context) {} - -// SquareSize returns the current square size. Currently, the square size is -// hardcoded. todo(evan): don't hardcode the square size -func (app *App) SquareSize() uint64 { - return app.squareSize -} - -// GetMaccPerms returns a copy of the module account permissions -func GetMaccPerms() map[string][]string { - dupMaccPerms := make(map[string][]string) - for k, v := range maccPerms { - dupMaccPerms[k] = v - } - return dupMaccPerms -} - -// initParamsKeeper init params keeper and its subspaces -func initParamsKeeper(appCodec codec.BinaryMarshaler, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper { - paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) - - paramsKeeper.Subspace(authtypes.ModuleName) - paramsKeeper.Subspace(banktypes.ModuleName) - paramsKeeper.Subspace(stakingtypes.ModuleName) - paramsKeeper.Subspace(minttypes.ModuleName) - paramsKeeper.Subspace(distrtypes.ModuleName) - paramsKeeper.Subspace(slashingtypes.ModuleName) - // paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) - paramsKeeper.Subspace(crisistypes.ModuleName) - paramsKeeper.Subspace(ibctransfertypes.ModuleName) - // this line is used by starport scaffolding # stargate/app/paramSubspace - - return paramsKeeper -} diff --git a/app/encoding.go b/app/encoding.go deleted file mode 100644 index 0c6fff710e..0000000000 --- a/app/encoding.go +++ /dev/null @@ -1,16 +0,0 @@ -package app - -import ( - "github.com/celestiaorg/celestia-app/app/params" - "github.com/cosmos/cosmos-sdk/std" -) - -// MakeEncodingConfig creates an EncodingConfig for testing -func MakeEncodingConfig() params.EncodingConfig { - encodingConfig := params.MakeEncodingConfig() - std.RegisterLegacyAminoCodec(encodingConfig.Amino) - std.RegisterInterfaces(encodingConfig.InterfaceRegistry) - ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) - ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) - return encodingConfig -} diff --git a/app/export.go b/app/export.go deleted file mode 100644 index e958b53af7..0000000000 --- a/app/export.go +++ /dev/null @@ -1,185 +0,0 @@ -package app - -import ( - "encoding/json" - "log" - - tmproto "github.com/celestiaorg/celestia-core/proto/tendermint/types" - - servertypes "github.com/cosmos/cosmos-sdk/server/types" - sdk "github.com/cosmos/cosmos-sdk/types" - slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/cosmos/cosmos-sdk/x/staking" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -// ExportAppStateAndValidators exports the state of the application for a genesis -// file. -func (app *App) ExportAppStateAndValidators( - forZeroHeight bool, jailAllowedAddrs []string, -) (servertypes.ExportedApp, error) { - - // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) - - // We export at last height + 1, because that's the height at which - // Tendermint will start InitChain. - height := app.LastBlockHeight() + 1 - if forZeroHeight { - height = 0 - app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) - } - - genState := app.mm.ExportGenesis(ctx, app.appCodec) - appState, err := json.MarshalIndent(genState, "", " ") - if err != nil { - return servertypes.ExportedApp{}, err - } - - validators, err := staking.WriteValidators(ctx, app.StakingKeeper) - if err != nil { - return servertypes.ExportedApp{}, err - } - return servertypes.ExportedApp{ - AppState: appState, - Validators: validators, - Height: height, - ConsensusParams: app.BaseApp.GetConsensusParams(ctx), - }, nil -} - -// prepare for fresh start at zero height -// NOTE zero height genesis is a temporary feature which will be deprecated -// in favour of export at a block height -func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { - applyAllowedAddrs := false - - // check if there is a allowed address list - if len(jailAllowedAddrs) > 0 { - applyAllowedAddrs = true - } - - allowedAddrsMap := make(map[string]bool) - - for _, addr := range jailAllowedAddrs { - _, err := sdk.ValAddressFromBech32(addr) - if err != nil { - log.Fatal(err) - } - allowedAddrsMap[addr] = true - } - - /* Just to be safe, assert the invariants on current state. */ - app.CrisisKeeper.AssertInvariants(ctx) - - /* Handle fee distribution state. */ - - // withdraw all validator commission - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, err := app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) - if err != nil { - panic(err) - } - return false - }) - - // withdraw all delegator rewards - dels := app.StakingKeeper.GetAllDelegations(ctx) - for _, delegation := range dels { - _, err := app.DistrKeeper.WithdrawDelegationRewards(ctx, delegation.GetDelegatorAddr(), delegation.GetValidatorAddr()) - if err != nil { - panic(err) - } - } - - // clear validator slash events - app.DistrKeeper.DeleteAllValidatorSlashEvents(ctx) - - // clear validator historical rewards - app.DistrKeeper.DeleteAllValidatorHistoricalRewards(ctx) - - // set context height to zero - height := ctx.BlockHeight() - ctx = ctx.WithBlockHeight(0) - - // reinitialize all validators - app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.DistrKeeper.GetFeePool(ctx) - feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.DistrKeeper.SetFeePool(ctx, feePool) - - app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) - return false - }) - - // reinitialize all delegations - for _, del := range dels { - app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) - app.DistrKeeper.Hooks().AfterDelegationModified(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) - } - - // reset context height - ctx = ctx.WithBlockHeight(height) - - /* Handle staking state. */ - - // iterate through redelegations, reset creation height - app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { - for i := range red.Entries { - red.Entries[i].CreationHeight = 0 - } - app.StakingKeeper.SetRedelegation(ctx, red) - return false - }) - - // iterate through unbonding delegations, reset creation height - app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { - for i := range ubd.Entries { - ubd.Entries[i].CreationHeight = 0 - } - app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) - return false - }) - - // Iterate through validators by power descending, reset bond heights, and - // update bond intra-tx counters. - store := ctx.KVStore(app.keys[stakingtypes.StoreKey]) - iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) - counter := int16(0) - - for ; iter.Valid(); iter.Next() { - addr := sdk.ValAddress(iter.Key()[1:]) - validator, found := app.StakingKeeper.GetValidator(ctx, addr) - if !found { - panic("expected validator, not found") - } - - validator.UnbondingHeight = 0 - if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { - validator.Jailed = true - } - - app.StakingKeeper.SetValidator(ctx, validator) - counter++ - } - - iter.Close() - - if _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx); err != nil { - panic(err) - } - - /* Handle slashing state. */ - - // reset start height on signing infos - app.SlashingKeeper.IterateValidatorSigningInfos( - ctx, - func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { - info.StartHeight = 0 - app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) - return false - }, - ) -} diff --git a/app/genesis.go b/app/genesis.go deleted file mode 100644 index 340cd801a8..0000000000 --- a/app/genesis.go +++ /dev/null @@ -1,20 +0,0 @@ -package app - -import ( - "encoding/json" -) - -// The genesis state of the blockchain is represented here as a map of raw json -// messages key'd by a identifier string. -// The identifier is used to determine which module genesis information belongs -// to so it may be appropriately routed during init chain. -// Within this application default genesis information is retrieved from -// the ModuleBasicManager which populates json from each BasicModule -// object provided to it during init. -type GenesisState map[string]json.RawMessage - -// NewDefaultGenesisState generates the default state for the application. -func NewDefaultGenesisState() GenesisState { - encCfg := MakeEncodingConfig() - return ModuleBasics.DefaultGenesis(encCfg.Marshaler) -} diff --git a/app/params/encoding.go b/app/params/encoding.go deleted file mode 100644 index 801f609621..0000000000 --- a/app/params/encoding.go +++ /dev/null @@ -1,31 +0,0 @@ -package params - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -// EncodingConfig specifies the concrete encoding types to use for a given app. -// This is provided for compatibility between protobuf and amino implementations. -type EncodingConfig struct { - InterfaceRegistry types.InterfaceRegistry - Marshaler codec.Marshaler - TxConfig client.TxConfig - Amino *codec.LegacyAmino -} - -// RegisterAccountInterface registers the authtypes.AccountI interface to the -// interface registery in the provided encoding config -func RegisterAccountInterface(conf EncodingConfig) EncodingConfig { - conf.InterfaceRegistry.RegisterInterface( - "cosmos.auth.v1beta1.BaseAccount", - (*authtypes.AccountI)(nil), - ) - conf.InterfaceRegistry.RegisterImplementations( - (*authtypes.AccountI)(nil), - &authtypes.BaseAccount{}, - ) - return conf -} diff --git a/app/params/proto.go b/app/params/proto.go deleted file mode 100644 index 84ff35a399..0000000000 --- a/app/params/proto.go +++ /dev/null @@ -1,22 +0,0 @@ -package params - -import ( - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/x/auth/tx" -) - -// MakeEncodingConfig creates an EncodingConfig for an amino based test configuration. -func MakeEncodingConfig() EncodingConfig { - amino := codec.NewLegacyAmino() - interfaceRegistry := types.NewInterfaceRegistry() - marshaler := codec.NewProtoCodec(interfaceRegistry) - txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes) - - return EncodingConfig{ - InterfaceRegistry: interfaceRegistry, - Marshaler: marshaler, - TxConfig: txCfg, - Amino: amino, - } -} diff --git a/app/prefix.go b/app/prefix.go deleted file mode 100644 index ec83c9cb8f..0000000000 --- a/app/prefix.go +++ /dev/null @@ -1,25 +0,0 @@ -package app - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const ( - AccountAddressPrefix = "cosmos" -) - -var ( - AccountPubKeyPrefix = AccountAddressPrefix + "pub" - ValidatorAddressPrefix = AccountAddressPrefix + "valoper" - ValidatorPubKeyPrefix = AccountAddressPrefix + "valoperpub" - ConsNodeAddressPrefix = AccountAddressPrefix + "valcons" - ConsNodePubKeyPrefix = AccountAddressPrefix + "valconspub" -) - -func SetConfig() { - config := sdk.GetConfig() - config.SetBech32PrefixForAccount(AccountAddressPrefix, AccountPubKeyPrefix) - config.SetBech32PrefixForValidator(ValidatorAddressPrefix, ValidatorPubKeyPrefix) - config.SetBech32PrefixForConsensusNode(ConsNodeAddressPrefix, ConsNodePubKeyPrefix) - config.Seal() -} diff --git a/app/types.go b/app/types.go deleted file mode 100644 index f34e78eb24..0000000000 --- a/app/types.go +++ /dev/null @@ -1,40 +0,0 @@ -package app - -import ( - abci "github.com/celestiaorg/celestia-core/abci/types" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/server/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// App implements the common methods for a Cosmos SDK-based application -// specific blockchain. -type CosmosApp interface { - // The assigned name of the app. - Name() string - - // The application types codec. - // NOTE: This shoult be sealed before being returned. - LegacyAmino() *codec.LegacyAmino - - // Application updates every begin block. - BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock - - // Application updates every end block. - EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock - - // Application update at chain (i.e app) initialization. - InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain - - // Loads the app at a given height. - LoadHeight(height int64) error - - // Exports the state of the application for a genesis file. - ExportAppStateAndValidators( - forZeroHeight bool, jailAllowedAddrs []string, - ) (types.ExportedApp, error) - - // All the registered module account addreses. - ModuleAccountAddrs() map[string]bool -} diff --git a/cmd/celestia-appd/cmd/app.go b/cmd/celestia-appd/cmd/app.go deleted file mode 100644 index deee77d8c0..0000000000 --- a/cmd/celestia-appd/cmd/app.go +++ /dev/null @@ -1,3 +0,0 @@ -package cmd - -const appName = "payment" diff --git a/cmd/celestia-appd/cmd/genaccounts.go b/cmd/celestia-appd/cmd/genaccounts.go deleted file mode 100644 index db0e017ea4..0000000000 --- a/cmd/celestia-appd/cmd/genaccounts.go +++ /dev/null @@ -1,191 +0,0 @@ -package cmd - -import ( - "bufio" - "encoding/json" - "errors" - "fmt" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/server" - 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" - "github.com/cosmos/cosmos-sdk/x/genutil" - genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" -) - -const ( - flagVestingStart = "vesting-start-time" - flagVestingEnd = "vesting-end-time" - flagVestingAmt = "vesting-amount" -) - -// AddGenesisAccountCmd returns add-genesis-account cobra Command. -func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { - cmd := &cobra.Command{ - Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", - Short: "Add a genesis account to genesis.json", - Long: `Add a genesis account to genesis.json. The provided account must specify -the account address or key name and a list of initial coins. If a key name is given, -the address will be looked up in the local Keybase. The list of initial tokens must -contain valid denominations. Accounts may optionally be supplied with vesting parameters. -`, - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - depCdc := clientCtx.JSONMarshaler - cdc := depCdc.(codec.Marshaler) - - serverCtx := server.GetServerContextFromCmd(cmd) - config := serverCtx.Config - - config.SetRoot(clientCtx.HomeDir) - - addr, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - inBuf := bufio.NewReader(cmd.InOrStdin()) - keyringBackend, err := cmd.Flags().GetString(flags.FlagKeyringBackend) - if err != nil { - return err - } - - // attempt to lookup address from Keybase if no address was provided - kb, err := keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf) - if err != nil { - return err - } - - info, err := kb.Key(args[0]) - if err != nil { - return fmt.Errorf("failed to get address from Keybase: %w", err) - } - - addr = info.GetAddress() - } - - coins, err := sdk.ParseCoinsNormalized(args[1]) - if err != nil { - return fmt.Errorf("failed to parse coins: %w", err) - } - - vestingStart, err := cmd.Flags().GetInt64(flagVestingStart) - if err != nil { - return err - } - vestingEnd, err := cmd.Flags().GetInt64(flagVestingEnd) - if err != nil { - return err - } - vestingAmtStr, err := cmd.Flags().GetString(flagVestingAmt) - if err != nil { - return err - } - - vestingAmt, err := sdk.ParseCoinsNormalized(vestingAmtStr) - if err != nil { - return fmt.Errorf("failed to parse vesting amount: %w", err) - } - - // create concrete account type based on input parameters - var genAccount authtypes.GenesisAccount - - balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} - baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) - - if !vestingAmt.IsZero() { - baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) - - if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || - baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { - return errors.New("vesting amount cannot be greater than total amount") - } - - switch { - case vestingStart != 0 && vestingEnd != 0: - genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) - - case vestingEnd != 0: - genAccount = authvesting.NewDelayedVestingAccountRaw(baseVestingAccount) - - default: - return errors.New("invalid vesting parameters; must supply start and end time or end time") - } - } else { - genAccount = baseAccount - } - - if err := genAccount.Validate(); err != nil { - return fmt.Errorf("failed to validate new genesis account: %w", err) - } - - 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) - } - - if accs.Contains(addr) { - return fmt.Errorf("cannot add account at existing address %s", addr) - } - - // Add the new account to the set of genesis accounts and sanitize the - // accounts afterwards. - accs = append(accs, genAccount) - 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(depCdc, 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 - - 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) - }, - } - - cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") - cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") - cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") - cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/cmd/celestia-appd/cmd/root.go b/cmd/celestia-appd/cmd/root.go deleted file mode 100644 index de9dc50266..0000000000 --- a/cmd/celestia-appd/cmd/root.go +++ /dev/null @@ -1,265 +0,0 @@ -package cmd - -import ( - "context" - "io" - "os" - "path/filepath" - - "github.com/celestiaorg/celestia-app/app/params" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/snapshots" - "github.com/rs/zerolog" - - tmcfg "github.com/celestiaorg/celestia-core/config" - tmcli "github.com/celestiaorg/celestia-core/libs/cli" - "github.com/celestiaorg/celestia-core/libs/log" - "github.com/spf13/cast" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - dbm "github.com/tendermint/tm-db" - - "github.com/celestiaorg/celestia-app/app" - "github.com/cosmos/cosmos-sdk/baseapp" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/debug" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/keys" - "github.com/cosmos/cosmos-sdk/client/rpc" - "github.com/cosmos/cosmos-sdk/server" - servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/store" - sdk "github.com/cosmos/cosmos-sdk/types" - authclient "github.com/cosmos/cosmos-sdk/x/auth/client" - authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - "github.com/cosmos/cosmos-sdk/x/auth/types" - vestingcli "github.com/cosmos/cosmos-sdk/x/auth/vesting/client/cli" - banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/cosmos/cosmos-sdk/x/crisis" - genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" -) - -var ChainID string - -// NewRootCmd creates a new root command for simd. It is called once in the -// main function. -func NewRootCmd() (*cobra.Command, params.EncodingConfig) { - encodingConfig := app.MakeEncodingConfig() - initClientCtx := client.Context{}. - WithJSONMarshaler(encodingConfig.Marshaler). - WithInterfaceRegistry(encodingConfig.InterfaceRegistry). - WithTxConfig(encodingConfig.TxConfig). - WithLegacyAmino(encodingConfig.Amino). - WithInput(os.Stdin). - WithAccountRetriever(types.AccountRetriever{}). - WithBroadcastMode(flags.BroadcastBlock). - WithHomeDir(app.DefaultNodeHome(appName)) - - rootCmd := &cobra.Command{ - Use: appName, - Short: "Stargate CosmosHub App", - PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { - return err - } - - return server.InterceptConfigsPreRunHandler(cmd) - }, - } - - initRootCmd(rootCmd, encodingConfig) - overwriteFlagDefaults(rootCmd, map[string]string{ - flags.FlagChainID: ChainID, - flags.FlagKeyringBackend: "test", - }) - - return rootCmd, encodingConfig -} - -// Execute executes the root command. -func Execute(rootCmd *cobra.Command) error { - app.SetConfig() - - // Create and set a client.Context on the command's Context. During the pre-run - // of the root command, a default initialized client.Context is provided to - // seed child command execution with values such as AccountRetriver, Keyring, - // and a Tendermint RPC. This requires the use of a pointer reference when - // getting and setting the client.Context. Ideally, we utilize - // https://github.com/spf13/cobra/pull/1118. - ctx := context.Background() - ctx = context.WithValue(ctx, client.ClientContextKey, &client.Context{}) - ctx = context.WithValue(ctx, server.ServerContextKey, server.NewDefaultContext()) - - rootCmd.PersistentFlags().String(flags.FlagLogLevel, zerolog.InfoLevel.String(), "The logging level (trace|debug|info|warn|error|fatal|panic)") - rootCmd.PersistentFlags().String(flags.FlagLogFormat, tmcfg.LogFormatPlain, "The logging format (json|plain)") - - executor := tmcli.PrepareBaseCmd(rootCmd, "", app.DefaultNodeHome(appName)) - return executor.ExecuteContext(ctx) -} - -func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { - authclient.Codec = encodingConfig.Marshaler - - rootCmd.AddCommand( - genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome(appName)), - genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome(appName)), - genutilcli.MigrateGenesisCmd(), - genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome(appName)), - genutilcli.ValidateGenesisCmd(app.ModuleBasics), - AddGenesisAccountCmd(app.DefaultNodeHome(appName)), - tmcli.NewCompletionCmd(rootCmd, true), - debug.Cmd(), - ) - - server.AddCommands(rootCmd, app.DefaultNodeHome(appName), newApp, createSimappAndExport, addModuleInitFlags) - - // add keybase, auxiliary RPC, query, and tx child commands - rootCmd.AddCommand( - rpc.StatusCommand(), - queryCommand(), - txCommand(), - keys.Commands(app.DefaultNodeHome(appName)), - ) -} - -func addModuleInitFlags(startCmd *cobra.Command) { - crisis.AddModuleInitFlags(startCmd) -} - -func queryCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "query", - Aliases: []string{"q"}, - Short: "Querying subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetAccountCmd(), - rpc.ValidatorCommand(), - rpc.BlockCommand(), - authcmd.QueryTxsByEventsCmd(), - authcmd.QueryTxCmd(), - ) - - app.ModuleBasics.AddQueryCommands(cmd) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - - return cmd -} - -func txCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "tx", - Short: "Transactions subcommands", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - authcmd.GetSignCommand(), - authcmd.GetSignBatchCommand(), - authcmd.GetMultiSignCommand(), - authcmd.GetValidateSignaturesCommand(), - flags.LineBreak, - authcmd.GetBroadcastCommand(), - authcmd.GetEncodeCommand(), - authcmd.GetDecodeCommand(), - flags.LineBreak, - vestingcli.GetTxCmd(), - ) - - app.ModuleBasics.AddTxCommands(cmd) - cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") - - return cmd -} - -func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { - var cache sdk.MultiStorePersistentCache - - if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { - cache = store.NewCommitKVStoreCacheManager() - } - - skipUpgradeHeights := make(map[int64]bool) - for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { - skipUpgradeHeights[int64(h)] = true - } - - pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) - if err != nil { - panic(err) - } - - snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots") - snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir) - if err != nil { - panic(err) - } - snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) - if err != nil { - panic(err) - } - - return app.New( - appName, logger, db, traceStore, true, skipUpgradeHeights, - cast.ToString(appOpts.Get(flags.FlagHome)), - cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), - app.MakeEncodingConfig(), // Ideally, we would reuse the one created by NewRootCmd. - appOpts, - baseapp.SetPruning(pruningOpts), - baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), - baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))), - baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), - baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))), - baseapp.SetInterBlockCache(cache), - baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), - baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), - baseapp.SetSnapshotStore(snapshotStore), - baseapp.SetSnapshotInterval(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval))), - baseapp.SetSnapshotKeepRecent(cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))), - ) -} - -func createSimappAndExport( - logger log.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, - appOpts servertypes.AppOptions) (servertypes.ExportedApp, error) { - - encCfg := app.MakeEncodingConfig() // Ideally, we would reuse the one created by NewRootCmd. - encCfg.Marshaler = codec.NewProtoCodec(encCfg.InterfaceRegistry) - var a *app.App - if height != -1 { - a = app.New(appName, logger, db, traceStore, false, map[int64]bool{}, "", uint(1), encCfg, appOpts) - - if err := a.LoadHeight(height); err != nil { - return servertypes.ExportedApp{}, err - } - } else { - a = app.New(appName, logger, db, traceStore, true, map[int64]bool{}, "", uint(1), encCfg, appOpts) - } - - return a.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) -} - -func overwriteFlagDefaults(c *cobra.Command, defaults map[string]string) { - set := func(s *pflag.FlagSet, key, val string) { - if f := s.Lookup(key); f != nil { - f.DefValue = val - err := f.Value.Set(val) - if err != nil { - panic(err) - } - } - } - for key, val := range defaults { - set(c.Flags(), key, val) - set(c.PersistentFlags(), key, val) - } - for _, c := range c.Commands() { - overwriteFlagDefaults(c, defaults) - } -} diff --git a/cmd/celestia-appd/main.go b/cmd/celestia-appd/main.go deleted file mode 100644 index 56f327d100..0000000000 --- a/cmd/celestia-appd/main.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "os" - - "github.com/celestiaorg/celestia-app/cmd/celestia-appd/cmd" -) - -func main() { - rootCmd, _ := cmd.NewRootCmd() - if err := cmd.Execute(rootCmd); err != nil { - os.Exit(1) - } -} diff --git a/internal/tools/tools.go b/internal/tools/tools.go deleted file mode 100644 index bc9435e5ee..0000000000 --- a/internal/tools/tools.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build tools - -package tools - -import ( - _ "github.com/golang/protobuf/protoc-gen-go" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway" - _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger" - _ "github.com/regen-network/cosmos-proto/protoc-gen-gocosmos" -) diff --git a/x/payment/client/builder.go b/x/payment/client/builder.go deleted file mode 100644 index 919dcd362e..0000000000 --- a/x/payment/client/builder.go +++ /dev/null @@ -1,186 +0,0 @@ -package client - -import ( - "context" - - "github.com/celestiaorg/celestia-app/app/params" - sdkclient "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - sdktypes "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" - "github.com/cosmos/cosmos-sdk/types/tx/signing" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "google.golang.org/grpc" -) - -// KeyringSigner uses a keyring to sign and build celestia-app transactions -type KeyringSigner struct { - keyring.Keyring - keyringAccName string - accountNumber uint64 - sequence uint64 - chainID string - encCfg params.EncodingConfig -} - -// NewKeyringSigner returns a new KeyringSigner using the provided keyring -func NewKeyringSigner(ring keyring.Keyring, name string, chainID string) *KeyringSigner { - return &KeyringSigner{ - Keyring: ring, - keyringAccName: name, - chainID: chainID, - encCfg: params.RegisterAccountInterface(params.MakeEncodingConfig()), - } -} - -// QueryAccountNumber queries the applicaiton to find the latest account number and -// sequence, updating the respective internal fields. The internal account number must -// be set by this method or by manually calling k.SetAccountNumber in order for any built -// transactions to be valide -func (k *KeyringSigner) QueryAccountNumber(ctx context.Context, conn *grpc.ClientConn) error { - info, err := k.Key(k.keyringAccName) - if err != nil { - return err - } - - accNum, seqNumb, err := QueryAccount(ctx, conn, k.encCfg, info.GetAddress().String()) - if err != nil { - return err - } - k.accountNumber = accNum - k.sequence = seqNumb - return nil -} - -// NewTxBuilder returns the default sdk Tx builder using the celestia-app encoding config -func (k KeyringSigner) NewTxBuilder() sdkclient.TxBuilder { - return k.encCfg.TxConfig.NewTxBuilder() -} - -// BuildSignedTx creates and signs a sdk.Tx that contains the provided message. The interal -// account number must be set by calling k.QueryAccountNumber or by manually setting it via -// k.SetAccountNumber for the built transactions to be valid. -func (k KeyringSigner) BuildSignedTx(builder sdkclient.TxBuilder, msg sdktypes.Msg) (authsigning.Tx, error) { - // set the msg - err := builder.SetMsgs(msg) - if err != nil { - return nil, err - } - - // lookup account info - keyInfo, err := k.Key(k.keyringAccName) - if err != nil { - return nil, err - } - - // we must first set an empty signature in order generate - // the correct sign bytes - sigV2 := signing.SignatureV2{ - PubKey: keyInfo.GetPubKey(), - Data: &signing.SingleSignatureData{ - SignMode: signing.SignMode_SIGN_MODE_DIRECT, - Signature: nil, - }, - Sequence: k.sequence, - } - - // set the empty signature - err = builder.SetSignatures(sigV2) - if err != nil { - return nil, err - } - - // Generate the bytes to be signed. - bytesToSign, err := k.encCfg.TxConfig.SignModeHandler().GetSignBytes( - signing.SignMode_SIGN_MODE_DIRECT, - authsigning.SignerData{ - ChainID: k.chainID, - AccountNumber: k.accountNumber, - Sequence: k.sequence, - }, - builder.GetTx(), - ) - if err != nil { - return nil, err - } - - // Sign those bytes using the keyring. we are ignoring the returned public key - sigBytes, _, err := k.SignByAddress(keyInfo.GetAddress(), bytesToSign) - if err != nil { - return nil, err - } - - // Construct the SignatureV2 struct, this time including a real signature - sigV2 = signing.SignatureV2{ - PubKey: keyInfo.GetPubKey(), - Data: &signing.SingleSignatureData{ - SignMode: signing.SignMode_SIGN_MODE_DIRECT, - Signature: sigBytes, - }, - Sequence: k.sequence, - } - - // set the final signature - err = builder.SetSignatures(sigV2) - if err != nil { - return nil, err - } - - // return the signed transaction - return builder.GetTx(), nil -} - -// SetAccountNumber manually sets the underlying account number -func (k *KeyringSigner) SetAccountNumber(n uint64) { - k.accountNumber = n -} - -// SetSequence manually sets the underlying sequence number -func (k *KeyringSigner) SetSequence(n uint64) { - k.sequence = n -} - -// SetKeyringAccName manually sets the underlying keyring account name -func (k *KeyringSigner) SetKeyringAccName(name string) { - k.keyringAccName = name -} - -// EncodeTx uses the keyring signer's encoding config to encode the provided sdk transaction -func (k KeyringSigner) EncodeTx(tx sdktypes.Tx) ([]byte, error) { - return k.encCfg.TxConfig.TxEncoder()(tx) -} - -// BroadcastTx uses the provided grpc connection to broadcast a signed and encoded transaction -func BroadcastTx(ctx context.Context, conn *grpc.ClientConn, mode tx.BroadcastMode, txBytes []byte) (*tx.BroadcastTxResponse, error) { - txClient := tx.NewServiceClient(conn) - - return txClient.BroadcastTx( - ctx, - &tx.BroadcastTxRequest{ - Mode: mode, - TxBytes: txBytes, - }, - ) -} - -// QueryAccount fetches the account number and sequence number from the celestia-app node. -func QueryAccount(ctx context.Context, conn *grpc.ClientConn, encCfg params.EncodingConfig, address string) (accNum uint64, seqNum uint64, err error) { - qclient := authtypes.NewQueryClient(conn) - resp, err := qclient.Account( - ctx, - &authtypes.QueryAccountRequest{Address: address}, - ) - if err != nil { - return accNum, seqNum, err - } - - var acc authtypes.AccountI - err = encCfg.Marshaler.UnpackAny(resp.Account, &acc) - if err != nil { - return accNum, seqNum, err - } - - accNum, seqNum = acc.GetAccountNumber(), acc.GetSequence() - return -} diff --git a/x/payment/client/builder_test.go b/x/payment/client/builder_test.go deleted file mode 100644 index 75392f76f0..0000000000 --- a/x/payment/client/builder_test.go +++ /dev/null @@ -1,141 +0,0 @@ -package client - -import ( - "context" - "fmt" - "testing" - - "github.com/celestiaorg/celestia-app/x/payment/types" - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - sdktypes "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" - authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - "github.com/stretchr/testify/require" - "google.golang.org/grpc" -) - -func TestBuildSignedPayForMessage(t *testing.T) { - testRing := generateKeyring(t) - - info, err := testRing.Key(testAccName) - require.NoError(t, err) - - k := NewKeyringSigner(testRing, testAccName, "chain-id") - require.NoError(t, err) - - namespace := []byte{1, 1, 1, 1, 1, 1, 1, 1} - message := []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0} - - msg, err := types.NewMsgWirePayForMessage( - namespace, - message, - info.GetPubKey().Bytes(), - &types.TransactionFee{}, - 4, 16, 32, - ) - require.NoError(t, err) - - signedTx, err := k.BuildSignedTx(k.NewTxBuilder(), msg) - require.NoError(t, err) - - sigs, err := signedTx.GetSignaturesV2() - require.NoError(t, err) - - signerData := authsigning.SignerData{ - ChainID: k.chainID, - AccountNumber: k.accountNumber, - Sequence: k.sequence, - } - - err = authsigning.VerifySignature(info.GetPubKey(), signerData, sigs[0].Data, k.encCfg.TxConfig.SignModeHandler(), signedTx) - require.NoError(t, err) -} - -func TestBroadcastPayForMessage(t *testing.T) { - testRing := generateKeyring(t) - info, err := testRing.Key(testAccName) - require.NoError(t, err) - t.Skip(fmt.Sprintf("no local connection to app and no funds in wallet %s", info.GetAddress())) - - k := NewKeyringSigner(testRing, testAccName, "test") - - RPCAddress := "127.0.0.1:9090" - - rpcClient, err := grpc.Dial(RPCAddress, grpc.WithInsecure()) - require.NoError(t, err) - err = k.QueryAccountNumber(context.TODO(), rpcClient) - require.NoError(t, err) - - builder := k.NewTxBuilder() - - builder.SetGasLimit(100000) - - coin := sdktypes.Coin{ - Denom: "token", - Amount: sdktypes.NewInt(10), - } - builder.SetFeeAmount(sdktypes.NewCoins(coin)) - - namespace := []byte{1, 1, 1, 1, 1, 1, 1, 1} - message := []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0} - - msg, err := types.NewMsgWirePayForMessage( - namespace, - message, - info.GetPubKey().Bytes(), - &types.TransactionFee{}, - 4, 16, 32, - ) - require.NoError(t, err) - - signedTx, err := k.BuildSignedTx(builder, msg) - require.NoError(t, err) - - encodedTx, err := k.EncodeTx(signedTx) - require.NoError(t, err) - - resp, err := BroadcastTx(context.TODO(), rpcClient, tx.BroadcastMode_BROADCAST_MODE_BLOCK, encodedTx) - require.NoError(t, err) - - require.Equal(t, "", resp.TxResponse.Data) -} - -func TestQueryAccountNumber(t *testing.T) { - t.Skip("no local connection to app and no funds in wallet") - testRing := generateKeyring(t) - - k := NewKeyringSigner(testRing, testAccName, "test") - - RPCAddress := "127.0.0.1:9090" - - rpcClient, err := grpc.Dial(RPCAddress, grpc.WithInsecure()) - require.NoError(t, err) - err = k.QueryAccountNumber(context.TODO(), rpcClient) - require.NoError(t, err) -} - -func generateKeyring(t *testing.T, accts ...string) keyring.Keyring { - t.Helper() - kb := keyring.NewInMemory() - - for _, acc := range accts { - _, _, err := kb.NewMnemonic(acc, keyring.English, "", hd.Secp256k1) - if err != nil { - t.Error(err) - } - } - - _, err := kb.NewAccount(testAccName, testMnemo, "1234", "", hd.Secp256k1) - if err != nil { - panic(err) - } - - return kb -} - -const ( - // nolint:lll - testMnemo = `ramp soldier connect gadget domain mutual staff unusual first midnight iron good deputy wage vehicle mutual spike unlock rocket delay hundred script tumble choose` - testAccName = "test-account" -) diff --git a/x/payment/client/cli/payformessage.go b/x/payment/client/cli/payformessage.go deleted file mode 100644 index 6d0084268d..0000000000 --- a/x/payment/client/cli/payformessage.go +++ /dev/null @@ -1,82 +0,0 @@ -package cli - -import ( - "encoding/hex" - "errors" - "fmt" - - "github.com/celestiaorg/celestia-app/x/payment/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/spf13/cobra" -) - -// CmdCreatePayForMessage returns a cobra command that uses the key ring backend -// and locally running node to create and broadcast a new WirePayForMessage -// transaction. -func CmdCreatePayForMessage() *cobra.Command { - cmd := &cobra.Command{ - Use: "payForMessage [hexNamespace] [hexMessage]", - Short: "Creates a new WirePayForMessage", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - // get the account name - accName := clientCtx.GetFromName() - if accName == "" { - return errors.New("no account name provided, please use the --from flag") - } - - // get info on the key - keyInfo, err := clientCtx.Keyring.Key(accName) - if err != nil { - return err - } - - // decode the namespace - namespace, err := hex.DecodeString(args[0]) - if err != nil { - return fmt.Errorf("failure to decode hex namespace: %w", err) - } - - // decode the message - message, err := hex.DecodeString(args[1]) - if err != nil { - return fmt.Errorf("failure to decode hex message: %w", err) - } - - // create the PayForMessage - pfmMsg, err := types.NewMsgWirePayForMessage( - namespace, - message, - keyInfo.GetPubKey().Bytes(), - &types.TransactionFee{}, // transaction fee is not yet used - types.SquareSize, - ) - if err != nil { - return err - } - - // sign the PayForMessage's ShareCommitments - err = pfmMsg.SignShareCommitments(accName, clientCtx.Keyring) - if err != nil { - return err - } - - // run message checks - if err = pfmMsg.ValidateBasic(); err != nil { - return err - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), pfmMsg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/payment/client/cli/query.go b/x/payment/client/cli/query.go deleted file mode 100644 index 153a50ba85..0000000000 --- a/x/payment/client/cli/query.go +++ /dev/null @@ -1,30 +0,0 @@ -package cli - -import ( - "fmt" - // "strings" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/celestiaorg/celestia-app/x/payment/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(queryRoute string) *cobra.Command { - // Group payment queries under a subcommand - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - // this line is used by starport scaffolding # 1 - - return cmd -} diff --git a/x/payment/client/cli/tx.go b/x/payment/client/cli/tx.go deleted file mode 100644 index bc4a47612a..0000000000 --- a/x/payment/client/cli/tx.go +++ /dev/null @@ -1,26 +0,0 @@ -package cli - -import ( - "fmt" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/celestiaorg/celestia-app/x/payment/types" -) - -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(CmdCreatePayForMessage()) - - return cmd -} diff --git a/x/payment/client/rest/rest.go b/x/payment/client/rest/rest.go deleted file mode 100644 index 0c3efd6085..0000000000 --- a/x/payment/client/rest/rest.go +++ /dev/null @@ -1,25 +0,0 @@ -package rest - -import ( - "github.com/gorilla/mux" - - "github.com/cosmos/cosmos-sdk/client" - // this line is used by starport scaffolding # 1 -) - -const ( - MethodGet = "GET" -) - -// RegisterRoutes registers payment-related REST handlers to a router -func RegisterRoutes(clientCtx client.Context, r *mux.Router) { - // this line is used by starport scaffolding # 2 -} - -// func registerQueryRoutes(clientCtx client.Context, r *mux.Router) { -// // this line is used by starport scaffolding # 3 -// } - -// func registerTxHandlers(clientCtx client.Context, r *mux.Router) { -// // this line is used by starport scaffolding # 4 -// } diff --git a/x/payment/genesis.go b/x/payment/genesis.go deleted file mode 100644 index 6cd7058e11..0000000000 --- a/x/payment/genesis.go +++ /dev/null @@ -1,17 +0,0 @@ -package payment - -import ( - "github.com/celestiaorg/celestia-app/x/payment/keeper" - "github.com/celestiaorg/celestia-app/x/payment/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// InitGenesis initializes the capability module's state from a provided genesis -// state. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { -} - -// ExportGenesis returns the capability module's exported genesis. -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - return types.DefaultGenesis() -} diff --git a/x/payment/handler.go b/x/payment/handler.go deleted file mode 100644 index 1eb8a89185..0000000000 --- a/x/payment/handler.go +++ /dev/null @@ -1,31 +0,0 @@ -package payment - -import ( - "fmt" - - "github.com/celestiaorg/celestia-app/x/payment/keeper" - "github.com/celestiaorg/celestia-app/x/payment/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// NewHandler ... -func NewHandler(k keeper.Keeper) sdk.Handler { - msgServer := keeper.NewMsgServerImpl(k) - - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - - switch msg := msg.(type) { - case *types.MsgWirePayForMessage: - res, err := msgServer.PayForMessage(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.SignedTransactionDataPayForMessage: - res, err := msgServer.SignedTransactionDataPayForMessage(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/payment/keeper/grpc_query.go b/x/payment/keeper/grpc_query.go deleted file mode 100644 index f5e93a4906..0000000000 --- a/x/payment/keeper/grpc_query.go +++ /dev/null @@ -1,7 +0,0 @@ -package keeper - -import ( - "github.com/celestiaorg/celestia-app/x/payment/types" -) - -var _ types.QueryServer = Keeper{} diff --git a/x/payment/keeper/keeper.go b/x/payment/keeper/keeper.go deleted file mode 100644 index d8dc246fe8..0000000000 --- a/x/payment/keeper/keeper.go +++ /dev/null @@ -1,58 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - "github.com/celestiaorg/celestia-core/libs/log" - - "github.com/celestiaorg/celestia-app/x/payment/types" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// todo(evan): move these somewhere else -const ( - TokenDenomination = "token" -) - -// Keeper handles all the state changes for the celestia-app module. -type Keeper struct { - cdc codec.Marshaler - storeKey sdk.StoreKey - memKey sdk.StoreKey - bank BankKeeper - baseFee sdk.Int -} - -func NewKeeper(cdc codec.Marshaler, bank BankKeeper, storeKey, memKey sdk.StoreKey, baseFee sdk.Int) *Keeper { - return &Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - bank: bank, - baseFee: baseFee, - } -} - -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) -} - -// PayForMessage moves a user's coins to the module address and burns them. -func (k Keeper) PayForMessage(goCtx context.Context, msg *types.MsgWirePayForMessage) (*types.MsgPayForMessageResponse, error) { - // don't pay for fees for the first version - return &types.MsgPayForMessageResponse{}, nil -} - -// SignedTransactionDataPayForMessage moves a user's coins to the module address and burns them. -func (k Keeper) SignedTransactionDataPayForMessage(goCtx context.Context, msg *types.SignedTransactionDataPayForMessage) (*types.SignedTransactionDataPayForMessageResponse, error) { - // don't pay for fees for the first version - return &types.SignedTransactionDataPayForMessageResponse{}, nil -} - -// BankKeeper restricts the funtionality of the bank keeper used in the payment keeper -type BankKeeper interface { - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error -} diff --git a/x/payment/keeper/msg_server.go b/x/payment/keeper/msg_server.go deleted file mode 100644 index 21af97001e..0000000000 --- a/x/payment/keeper/msg_server.go +++ /dev/null @@ -1,27 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/celestiaorg/celestia-app/x/payment/types" -) - -var _ types.MsgServer = msgServer{} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // PayForMessage allows the user to post data to made be available. - PayForMessage(context.Context, *types.MsgWirePayForMessage) (*types.MsgPayForMessageResponse, error) - // PayForMessage allows the user to post data to made be available. - SignedTransactionDataPayForMessage(context.Context, *types.SignedTransactionDataPayForMessage) (*types.SignedTransactionDataPayForMessageResponse, error) -} - -type msgServer struct { - Keeper -} - -// NewMsgServerImpl returns an implementation of the bank MsgServer interface -// for the provided Keeper. -func NewMsgServerImpl(keeper Keeper) MsgServer { - return &msgServer{Keeper: keeper} -} diff --git a/x/payment/keeper/query.go b/x/payment/keeper/query.go deleted file mode 100644 index 218910a19c..0000000000 --- a/x/payment/keeper/query.go +++ /dev/null @@ -1,29 +0,0 @@ -package keeper - -import ( - // this line is used by starport scaffolding # 1 - - "github.com/celestiaorg/celestia-app/x/payment/types" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - - abci "github.com/celestiaorg/celestia-core/abci/types" -) - -func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) { - var ( - res []byte - err error - ) - - switch path[0] { - // this line is used by starport scaffolding # 2 - default: - err = sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknown %s query endpoint: %s", types.ModuleName, path[0]) - } - - return res, err - } -} diff --git a/x/payment/module.go b/x/payment/module.go deleted file mode 100644 index 34934f2650..0000000000 --- a/x/payment/module.go +++ /dev/null @@ -1,166 +0,0 @@ -package payment - -import ( - "encoding/json" - "fmt" - - // this line is used by starport scaffolding # 1 - - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - abci "github.com/celestiaorg/celestia-core/abci/types" - - "github.com/celestiaorg/celestia-app/x/payment/client/cli" - "github.com/celestiaorg/celestia-app/x/payment/client/rest" - "github.com/celestiaorg/celestia-app/x/payment/keeper" - "github.com/celestiaorg/celestia-app/x/payment/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" -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} -) - -// ---------------------------------------------------------------------------- -// AppModuleBasic -// ---------------------------------------------------------------------------- - -// AppModuleBasic implements the AppModuleBasic interface for the capability module. -type AppModuleBasic struct { - cdc codec.Marshaler -} - -func NewAppModuleBasic(cdc codec.Marshaler) AppModuleBasic { - return AppModuleBasic{cdc: cdc} -} - -// Name returns the capability module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -// RegisterInterfaces registers the module's interface types -func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { - types.RegisterInterfaces(reg) -} - -// DefaultGenesis returns the capability module's default genesis state. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesis()) -} - -// ValidateGenesis performs genesis state validation for the capability module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, config client.TxEncodingConfig, bz json.RawMessage) error { - var genState types.GenesisState - if err := cdc.UnmarshalJSON(bz, &genState); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) - } - return genState.Validate() -} - -// RegisterRESTRoutes registers the capability module's REST service handlers. -func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { - rest.RegisterRoutes(clientCtx, rtr) -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - // this line is used by starport scaffolding # 2 -} - -// GetTxCmd returns the capability module's root tx command. -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() -} - -// GetQueryCmd returns the capability module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(types.StoreKey) -} - -// ---------------------------------------------------------------------------- -// AppModule -// ---------------------------------------------------------------------------- - -// AppModule implements the AppModule interface for the capability module. -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper -} - -func NewAppModule(cdc codec.Marshaler, keeper keeper.Keeper) AppModule { - return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: keeper, - } -} - -// Name returns the capability module's name. -func (am AppModule) Name() string { - return am.AppModuleBasic.Name() -} - -// Route returns the capability module's message routing key. -func (am AppModule) Route() sdk.Route { - return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) -} - -// QuerierRoute returns the capability module's query routing key. -func (AppModule) QuerierRoute() string { return types.QuerierRoute } - -// LegacyQuerierHandler returns the capability module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return keeper.NewQuerier(am.keeper, legacyQuerierCdc) -} - -// RegisterServices registers a GRPC query service to respond to the -// module-specific GRPC queries. -func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) -} - -// RegisterInvariants registers the capability module's invariants. -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// InitGenesis performs the capability module's genesis initialization It returns -// no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, gs json.RawMessage) []abci.ValidatorUpdate { - var genState types.GenesisState - // Initialize global index to index in genesis state - cdc.MustUnmarshalJSON(gs, &genState) - - InitGenesis(ctx, am.keeper, genState) - - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json.RawMessage { - genState := ExportGenesis(ctx, am.keeper) - return cdc.MustMarshalJSON(genState) -} - -// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} - -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} -} diff --git a/x/payment/types/codec.go b/x/payment/types/codec.go deleted file mode 100644 index 69026bbb35..0000000000 --- a/x/payment/types/codec.go +++ /dev/null @@ -1,24 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - // this line is used by starport scaffolding # 1 -) - -func RegisterCodec(cdc *codec.LegacyAmino) { - // this line is used by starport scaffolding # 2 - cdc.RegisterConcrete(&MsgWirePayForMessage{}, "payment/WirePayForMessage", nil) -} - -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - registry.RegisterImplementations((*sdk.Msg)(nil), - &MsgWirePayForMessage{}, - ) -} - -var ( - amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewAminoCodec(amino) -) diff --git a/x/payment/types/errors.go b/x/payment/types/errors.go deleted file mode 100644 index eff60122be..0000000000 --- a/x/payment/types/errors.go +++ /dev/null @@ -1,12 +0,0 @@ -package types - -// DONTCOVER - -import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// x/payment module sentinel errors -var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") -) diff --git a/x/payment/types/genesis.go b/x/payment/types/genesis.go deleted file mode 100644 index 094d1119cc..0000000000 --- a/x/payment/types/genesis.go +++ /dev/null @@ -1,15 +0,0 @@ -package types - -// DefaultIndex is the default capability global index -const DefaultIndex uint64 = 1 - -// DefaultGenesis returns the default Capability genesis state -func DefaultGenesis() *GenesisState { - return &GenesisState{} -} - -// Validate performs basic genesis state validation returning an error upon any -// failure. -func (gs GenesisState) Validate() error { - return nil -} diff --git a/x/payment/types/genesis.pb.go b/x/payment/types/genesis.pb.go deleted file mode 100644 index 8de604ba0b..0000000000 --- a/x/payment/types/genesis.pb.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: payment/genesis.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - 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 - -// GenesisState defines the capability module's genesis state. -type GenesisState struct { -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_ded92bd505296f58, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func init() { - proto.RegisterType((*GenesisState)(nil), "payment.GenesisState") -} - -func init() { proto.RegisterFile("payment/genesis.proto", fileDescriptor_ded92bd505296f58) } - -var fileDescriptor_ded92bd505296f58 = []byte{ - // 135 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0x48, 0xac, 0xcc, - 0x4d, 0xcd, 0x2b, 0xd1, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0x62, 0x87, 0x0a, 0x2b, 0xf1, 0x71, 0xf1, 0xb8, 0x43, 0x64, 0x82, 0x4b, 0x12, 0x4b, - 0x52, 0x9d, 0x7c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, - 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x38, 0x3d, - 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x39, 0x35, 0x27, 0xb5, 0xb8, 0x24, - 0x33, 0x31, 0xbf, 0x28, 0x1d, 0xce, 0xd6, 0x4d, 0x2c, 0x28, 0xd0, 0xaf, 0xd0, 0x87, 0xd9, 0x57, - 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xb6, 0xce, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x12, - 0x51, 0x3e, 0xf3, 0x87, 0x00, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/payment/types/keys.go b/x/payment/types/keys.go deleted file mode 100644 index 754de4cd74..0000000000 --- a/x/payment/types/keys.go +++ /dev/null @@ -1,22 +0,0 @@ -package types - -const ( - // ModuleName defines the module name - ModuleName = "payment" - - // StoreKey defines the primary module store key - StoreKey = ModuleName - - // RouterKey is the message route for slashing - RouterKey = ModuleName - - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName - - // MemStoreKey defines the in-memory store key - MemStoreKey = "mem_capability" -) - -func KeyPrefix(p string) []byte { - return []byte(p) -} diff --git a/x/payment/types/payformessage.go b/x/payment/types/payformessage.go deleted file mode 100644 index e1ffb4875a..0000000000 --- a/x/payment/types/payformessage.go +++ /dev/null @@ -1,356 +0,0 @@ -package types - -import ( - "bytes" - "crypto/sha256" - "errors" - fmt "fmt" - - "github.com/celestiaorg/celestia-core/crypto/merkle" - "github.com/celestiaorg/celestia-core/pkg/consts" - "github.com/celestiaorg/nmt" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const ( - TypeMsgPayforMessage = "payformessage" - TypeSignedTransactionDataPayForMessage = "signedtransactiondatapayformessage" - ShareSize = consts.ShareSize - SquareSize = consts.MaxSquareSize - NamespaceIDSize = consts.NamespaceSize -) - -var _ sdk.Msg = &MsgWirePayForMessage{} - -// NewMsgWirePayForMessage creates a new MsgWirePayForMessage by using the -// namespace and message to generate share commitments for the provided square sizes -// Note that the share commitments generated still need to be signed using the Sign -// method -func NewMsgWirePayForMessage(namespace, message, pubK []byte, fee *TransactionFee, sizes ...uint64) (*MsgWirePayForMessage, error) { - message = PadMessage(message) - out := &MsgWirePayForMessage{ - Fee: fee, - Nonce: 0, - MessageNameSpaceId: namespace, - MessageSize: uint64(len(message)), - Message: message, - MessageShareCommitment: make([]ShareCommitAndSignature, len(sizes)), - PublicKey: pubK, - } - - // generate the share commitments - for i, size := range sizes { - commit, err := CreateCommitment(size, namespace, message) - if err != nil { - return nil, err - } - out.MessageShareCommitment[i] = ShareCommitAndSignature{K: size, ShareCommitment: commit} - } - return out, nil -} - -// SignShareCommitments use the provided Keyring to sign each of the share commits -// generated during the creation of the MsgWirePayForMessage -func (msg *MsgWirePayForMessage) SignShareCommitments(accName string, ring keyring.Keyring) error { - for i, commit := range msg.MessageShareCommitment { - bytesToSign, err := msg.GetCommitmentSignBytes(commit.K) - if err != nil { - return err - } - sig, _, err := ring.Sign(accName, bytesToSign) - if err != nil { - return err - } - msg.MessageShareCommitment[i].Signature = sig - } - return nil -} - -func (msg *MsgWirePayForMessage) Route() string { return RouterKey } - -func (msg *MsgWirePayForMessage) Type() string { return TypeMsgPayforMessage } - -// ValidateBasic checks for valid namespace length, declared message size, share -// commitments, signatures for those share commitments, and fulfills the sdk.Msg -// interface -func (msg *MsgWirePayForMessage) ValidateBasic() error { - pubK := msg.PubKey() - - // ensure that the namespace id is of length == NamespaceIDSize - if len(msg.GetMessageNameSpaceId()) != NamespaceIDSize { - return fmt.Errorf( - "invalid namespace length: got %d wanted %d", - len(msg.GetMessageNameSpaceId()), - NamespaceIDSize, - ) - } - - // ensure that the included message is evenly divisble into shares - if uint64(len(msg.GetMessage()))%ShareSize != 0 { - return fmt.Errorf("Share message must be divisible by %d", ShareSize) - } - - // make sure that the message size matches the actual size of the message - if msg.MessageSize != uint64(len(msg.Message)) { - return fmt.Errorf( - "Declared Message size does not match actual Message size, %d vs %d", - msg.MessageSize, - len(msg.Message), - ) - } - - // ensure that a reserved namespace is not used - if bytes.Compare(msg.GetMessageNameSpaceId(), consts.MaxReservedNamespace) < 1 { - return errors.New("message is not valid: uses a reserved namesapce ID") - } - - for _, commit := range msg.MessageShareCommitment { - // check that each commit is valid - calculatedCommit, err := CreateCommitment(commit.K, msg.GetMessageNameSpaceId(), msg.Message) - if err != nil { - return err - } - - if string(calculatedCommit) != string(commit.ShareCommitment) { - return fmt.Errorf("invalid commit for square size %d", commit.K) - } - - // check that the signatures are valid - bytesToSign, err := msg.GetCommitmentSignBytes(commit.K) - if err != nil { - return err - } - - if !pubK.VerifySignature(bytesToSign, commit.Signature) { - return fmt.Errorf("invalid signature for share commitment to square size %d", commit.K) - } - } - - return nil -} - -// GetSignBytes returns messages bytes that need to be signed in order for the -// message to be valid -func (msg *MsgWirePayForMessage) GetSignBytes() []byte { - out, err := msg.GetCommitmentSignBytes(SquareSize) - if err != nil { - // this panic can only be reached if the nmt cannot push bytes onto the - // tree while creating the commit. This should never happen, as an error - // only occurs when out of order or varying sized namespaces are used, - // and we are using an identical namespace when pushing to the nmt - // https://github.com/celestiaorg/nmt/blob/b22170d6f23796a186c07e87e4ef9856282ffd1a/nmt.go#L250 - panic(err) - } - return out -} - -// GetSigners returns the addresses of the message signers -func (msg *MsgWirePayForMessage) GetSigners() []sdk.AccAddress { - return []sdk.AccAddress{sdk.AccAddress(msg.PubKey().Address().Bytes())} -} - -// PubKey returns the public key of the creator of MsgWirePayForMessage -func (msg *MsgWirePayForMessage) PubKey() *secp256k1.PubKey { - return &secp256k1.PubKey{Key: msg.PublicKey} -} - -// GetCommitmentSignBytes generates the bytes that each need to be signed per share commit -func (msg *MsgWirePayForMessage) GetCommitmentSignBytes(k uint64) ([]byte, error) { - sTxMsg, err := msg.SignedTransactionDataPayForMessage(k) - if err != nil { - return nil, err - } - return sTxMsg.GetSignBytes(), nil -} - -// SignedTransactionDataPayForMessage use the data in the MsgWirePayForMessage -// to create a new SignedTransactionDataPayForMessage -func (msg *MsgWirePayForMessage) SignedTransactionDataPayForMessage(k uint64) (*SignedTransactionDataPayForMessage, error) { - // create the commitment using the padded message - commit, err := CreateCommitment(k, msg.MessageNameSpaceId, msg.Message) - if err != nil { - return nil, err - } - - sTxMsg := SignedTransactionDataPayForMessage{ - Fee: &TransactionFee{ - BaseRateMax: msg.Fee.BaseRateMax, - TipRateMax: msg.Fee.TipRateMax, - }, - Nonce: msg.Nonce, - MessageNamespaceId: msg.MessageNameSpaceId, - MessageSize: msg.MessageSize, - MessageShareCommitment: commit, - } - return &sTxMsg, nil -} - -var _ sdk.Tx = &TxSignedTransactionDataPayForMessage{} - -// GetMsgs fullfills the sdk.Tx interface -func (tx *TxSignedTransactionDataPayForMessage) GetMsgs() []sdk.Msg { - return []sdk.Msg{tx.Message} -} - -// ValidateBasic fullfills the sdk.Tx interface by verifing the signature of the -// underlying signed transaction -func (tx *TxSignedTransactionDataPayForMessage) ValidateBasic() error { - pKey := secp256k1.PubKey{Key: tx.PublicKey} - - if !pKey.VerifySignature(tx.Message.GetSignBytes(), tx.Signature) { - return errors.New("failure to validte SignedTransactionDataPayForMessage") - } - return nil -} - -var _ sdk.Msg = &SignedTransactionDataPayForMessage{} - -// Route fullfills the sdk.Msg interface -func (msg *SignedTransactionDataPayForMessage) Route() string { return RouterKey } - -// Type fullfills the sdk.Msg interface -func (msg *SignedTransactionDataPayForMessage) Type() string { - return TypeSignedTransactionDataPayForMessage -} - -// ValidateBasic fullfills the sdk.Msg interface by performing stateless -// validity checks on the msg that also don't require having the actual message -func (msg *SignedTransactionDataPayForMessage) ValidateBasic() error { - // ensure that the namespace id is of length == NamespaceIDSize - if len(msg.GetMessageNamespaceId()) != NamespaceIDSize { - return fmt.Errorf( - "invalid namespace length: got %d wanted %d", - len(msg.GetMessageNamespaceId()), - NamespaceIDSize, - ) - } - return nil -} - -// GetSignBytes fullfills the sdk.Msg interface by reterning a deterministic set -// of bytes to sign over -func (msg *SignedTransactionDataPayForMessage) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) -} - -// GetSigners fullfills the sdk.Msg interface but does not return anything, as -// SignTransactionDataPayForMessage doesn't have access the public key necessary -// in MsgWirePayForMessage -func (msg *SignedTransactionDataPayForMessage) GetSigners() []sdk.AccAddress { - return []sdk.AccAddress{} -} - -// CreateCommitment generates the commit bytes for a given message, namespace, and -// squaresize using a namespace merkle tree and the rules described at -// https://github.com/celestiaorg/celestia-specs/blob/master/rationale/message_block_layout.md#non-interactive-default-rules -func CreateCommitment(k uint64, namespace, message []byte) ([]byte, error) { - // add padding to the message if necessary - message = PadMessage(message) - - // break message into shares - shares := chunkMessage(message) - - // organize shares for merkle mountain range - heights := PowerOf2MountainRange(uint64(len(shares)), k) - leafSets := make([][][]byte, len(heights)) - cursor := uint64(0) - for i, height := range heights { - leafSets[i] = shares[cursor : cursor+height] - cursor = cursor + height - } - - // create the commits by pushing each leaf set onto an nmt - subTreeRoots := make([][]byte, len(leafSets)) - for i, set := range leafSets { - // create the nmt - tree := nmt.New(sha256.New, nmt.NamespaceIDSize(NamespaceIDSize)) - for _, leaf := range set { - nsLeaf := append(make([]byte, 0), append(namespace, leaf...)...) - err := tree.Push(nsLeaf) - if err != nil { - return nil, err - } - } - // add the root - subTreeRoots[i] = tree.Root().Bytes() - } - return merkle.HashFromByteSlices(subTreeRoots), nil -} - -// chunkMessage breaks the message into ShareSize pieces -func chunkMessage(message []byte) [][]byte { - var shares [][]byte - for i := 0; i < len(message); i += ShareSize { - end := i + ShareSize - if end > len(message) { - end = len(message) - } - shares = append(shares, message[i:end]) - } - return shares -} - -// PadMessage adds padding to the msg if the length of the msg is not divisible -// by the share size specified in celestia-core -func PadMessage(msg []byte) []byte { - // check if the message needs padding - if uint64(len(msg))%ShareSize == 0 { - return msg - } - - shareCount := (len(msg) / ShareSize) + 1 - - padded := make([]byte, shareCount*ShareSize) - copy(padded, msg) - return padded -} - -// PowerOf2MountainRange returns the heights of the subtrees for binary merkle -// mountian range -func PowerOf2MountainRange(l, k uint64) []uint64 { - var output []uint64 - - for l != 0 { - switch { - case l >= k: - output = append(output, k) - l = l - k - case l < k: - p := nextPowerOf2(l) - output = append(output, p) - l = l - p - } - } - - return output -} - -// nextPowerOf2 returns the next lowest power of 2 unless the input is a power -// of two, in which case it returns the input -func nextPowerOf2(v uint64) uint64 { - if v == 1 { - return 1 - } - // keep track of the input - i := v - - // find the next highest power using bit mashing - v-- - v |= v >> 1 - v |= v >> 2 - v |= v >> 4 - v |= v >> 8 - v |= v >> 16 - v |= v >> 32 - v++ - - // check if the input was the next highest power - if i == v { - return v - } - - // return the next lowest power - return v / 2 -} diff --git a/x/payment/types/payformessage_test.go b/x/payment/types/payformessage_test.go deleted file mode 100644 index 6d5cd8466a..0000000000 --- a/x/payment/types/payformessage_test.go +++ /dev/null @@ -1,336 +0,0 @@ -package types - -import ( - "bytes" - "testing" - - "github.com/celestiaorg/celestia-core/pkg/consts" - "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -const ( - testingKeyAcc = "test" -) - -func TestMountainRange(t *testing.T) { - type test struct { - l, k uint64 - expected []uint64 - } - tests := []test{ - { - l: 11, - k: 4, - expected: []uint64{4, 4, 2, 1}, - }, - { - l: 2, - k: 64, - expected: []uint64{2}, - }, - { //should this test throw an error? we - l: 64, - k: 8, - expected: []uint64{8, 8, 8, 8, 8, 8, 8, 8}, - }, - } - for _, tt := range tests { - res := PowerOf2MountainRange(tt.l, tt.k) - assert.Equal(t, tt.expected, res) - } -} - -func TestNextPowerOf2(t *testing.T) { - type test struct { - input uint64 - expected uint64 - } - tests := []test{ - { - input: 2, - expected: 2, - }, - { - input: 11, - expected: 8, - }, - { - input: 511, - expected: 256, - }, - { - input: 1, - expected: 1, - }, - { - input: 0, - expected: 0, - }, - } - for _, tt := range tests { - res := nextPowerOf2(tt.input) - assert.Equal(t, tt.expected, res) - } -} - -// TestCreateCommit only shows if something changed, it doesn't actually show -// the commit is being created correctly todo(evan): fix me. -func TestCreateCommitment(t *testing.T) { - type test struct { - k uint64 - namespace []byte - message []byte - expected []byte - } - tests := []test{ - { - k: 4, - namespace: bytes.Repeat([]byte{0xFF}, 8), - message: bytes.Repeat([]byte{0xFF}, 11*256), - expected: []byte{0x5d, 0x43, 0xd7, 0x40, 0xe5, 0xe6, 0x5e, 0x2a, 0xb9, 0x10, 0x5c, 0xf9, 0x26, 0xf9, 0xf0, 0x1c, 0x3a, 0x11, 0x49, 0x1c, 0x71, 0x21, 0xdf, 0x46, 0xdd, 0x21, 0x94, 0x3f, 0xba, 0xb1, 0xcf, 0xd4}, - }, - } - for _, tt := range tests { - res, err := CreateCommitment(tt.k, tt.namespace, tt.message) - assert.NoError(t, err) - assert.Equal(t, tt.expected, res) - } -} - -// this test only tests for changes, it doesn't actually test that the result is valid. -// todo(evan): fixme -func TestGetCommitmentSignBytes(t *testing.T) { - type test struct { - msg MsgWirePayForMessage - expected []byte - } - tests := []test{ - { - msg: MsgWirePayForMessage{ - MessageSize: 4, - Message: []byte{1, 2, 3, 4}, - MessageNameSpaceId: []byte{1, 2, 3, 4, 1, 2, 3, 4}, - Nonce: 1, - Fee: &TransactionFee{ - BaseRateMax: 10000, - TipRateMax: 1000, - }, - }, - expected: []byte(`{"fee":{"base_rate_max":"10000","tip_rate_max":"1000"},"message_namespace_id":"AQIDBAECAwQ=","message_share_commitment":"byozRVIrw5NF/rU1PPyq6BAo3g2ny3uLTiOFedtgSwo=","message_size":"4","nonce":"1"}`), - }, - } - for _, tt := range tests { - res, err := tt.msg.GetCommitmentSignBytes(SquareSize) - assert.NoError(t, err) - assert.Equal(t, tt.expected, res) - } -} - -func TestPadMessage(t *testing.T) { - type test struct { - input []byte - expected []byte - } - tests := []test{ - { - input: []byte{1}, - expected: append([]byte{1}, bytes.Repeat([]byte{0}, ShareSize-1)...), - }, - { - input: []byte{}, - expected: []byte{}, - }, - { - input: bytes.Repeat([]byte{1}, ShareSize), - expected: bytes.Repeat([]byte{1}, ShareSize), - }, - { - input: bytes.Repeat([]byte{1}, (3*ShareSize)-10), - expected: append(bytes.Repeat([]byte{1}, (3*ShareSize)-10), bytes.Repeat([]byte{0}, 10)...), - }, - } - for _, tt := range tests { - res := PadMessage(tt.input) - assert.Equal(t, tt.expected, res) - } -} - -func TestSignShareCommitments(t *testing.T) { - type test struct { - accName string - msg *MsgWirePayForMessage - } - - kb := generateKeyring(t, "test") - - // create the first PFM for the first test - firstPubKey, err := kb.Key("test") - if err != nil { - t.Error(err) - } - firstNs := []byte{1, 1, 1, 1, 1, 1, 1, 1} - firstMsg := bytes.Repeat([]byte{1}, ShareSize) - firstPFM, err := NewMsgWirePayForMessage( - firstNs, - firstMsg, - firstPubKey.GetPubKey().Bytes(), - &TransactionFee{}, - SquareSize, - ) - if err != nil { - t.Error(err) - } - - tests := []test{ - { - accName: "test", - msg: firstPFM, - }, - } - - for _, tt := range tests { - err := tt.msg.SignShareCommitments(tt.accName, kb) - // there should be no error - assert.NoError(t, err) - // the signature should exist - assert.Equal(t, len(tt.msg.MessageShareCommitment[0].Signature), 64) - } -} - -func generateKeyring(t *testing.T, accts ...string) keyring.Keyring { - kb := keyring.NewInMemory() - - for _, acc := range accts { - _, _, err := kb.NewMnemonic(acc, keyring.English, "", hd.Secp256k1) - if err != nil { - t.Error(err) - } - } - - return kb -} - -func TestMsgWirePayForMessage_ValidateBasic(t *testing.T) { - type test struct { - name string - msg *MsgWirePayForMessage - expectErr bool - errStr string - } - - kr := newKeyring() - - // valid pfm - validMsg := validMsgWirePayForMessage(kr) - - // pfm with bad ns id - badIDMsg := validMsgWirePayForMessage(kr) - badIDMsg.MessageNameSpaceId = []byte{1, 2, 3, 4, 5, 6, 7} - - // pfm that uses reserved ns id - reservedMsg := validMsgWirePayForMessage(kr) - reservedMsg.MessageNameSpaceId = []byte{0, 0, 0, 0, 0, 0, 0, 100} - - // pfm that has a wrong msg size - invalidMsgSizeMsg := validMsgWirePayForMessage(kr) - invalidMsgSizeMsg.Message = bytes.Repeat([]byte{1}, consts.ShareSize-20) - - // pfm that has a wrong msg size - invalidDeclaredMsgSizeMsg := validMsgWirePayForMessage(kr) - invalidDeclaredMsgSizeMsg.MessageSize = 999 - - // pfm with bad sig - badSigMsg := validMsgWirePayForMessage(kr) - badSigMsg.MessageShareCommitment[0].Signature = []byte{1, 2, 3, 4} - - // pfm with bad commitment - badCommitMsg := validMsgWirePayForMessage(kr) - badCommitMsg.MessageShareCommitment[0].ShareCommitment = []byte{1, 2, 3, 4} - - tests := []test{ - { - name: "valid msg", - msg: validMsg, - }, - { - name: "bad ns ID", - msg: badIDMsg, - expectErr: true, - errStr: "invalid namespace length", - }, - { - name: "reserved ns id", - msg: reservedMsg, - expectErr: true, - errStr: "uses a reserved namesapce ID", - }, - { - name: "invalid msg size", - msg: invalidMsgSizeMsg, - expectErr: true, - errStr: "Share message must be divisible", - }, - { - name: "bad declared message size", - msg: invalidDeclaredMsgSizeMsg, - expectErr: true, - errStr: "Declared Message size does not match actual Message size", - }, - { - name: "bad sig", - msg: badSigMsg, - expectErr: true, - errStr: "invalid signature for share commitment", - }, - { - name: "bad commitment", - msg: badCommitMsg, - expectErr: true, - errStr: "invalid commit for square size", - }, - } - - for _, tt := range tests { - err := tt.msg.ValidateBasic() - if tt.expectErr { - require.NotNil(t, err, tt.name) - require.Contains(t, err.Error(), tt.errStr, tt.name) - continue - } - require.NoError(t, err, tt.name) - } -} - -func validMsgWirePayForMessage(keyring keyring.Keyring) *MsgWirePayForMessage { - info, err := keyring.Key(testingKeyAcc) - if err != nil { - panic(err) - } - msg, err := NewMsgWirePayForMessage( - []byte{1, 2, 3, 4, 5, 6, 7, 8}, - bytes.Repeat([]byte{1}, 1000), - info.GetPubKey().Bytes(), - &TransactionFee{}, - 16, 32, 64, - ) - if err != nil { - panic(err) - } - err = msg.SignShareCommitments(testingKeyAcc, keyring) - if err != nil { - panic(err) - } - return msg -} - -func newKeyring() keyring.Keyring { - kb := keyring.NewInMemory() - _, _, err := kb.NewMnemonic(testingKeyAcc, keyring.English, "", hd.Secp256k1) - if err != nil { - panic(err) - } - return kb -} diff --git a/x/payment/types/query.go b/x/payment/types/query.go deleted file mode 100644 index ab1254f4c2..0000000000 --- a/x/payment/types/query.go +++ /dev/null @@ -1 +0,0 @@ -package types diff --git a/x/payment/types/query.pb.go b/x/payment/types/query.pb.go deleted file mode 100644 index 04022eb22e..0000000000 --- a/x/payment/types/query.pb.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: payment/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - math "math" -) - -// 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 - -func init() { proto.RegisterFile("payment/query.proto", fileDescriptor_0d907c42280cbd58) } - -var fileDescriptor_0d907c42280cbd58 = []byte{ - // 187 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0xce, 0xb1, 0x8e, 0x82, 0x40, - 0x10, 0x06, 0x60, 0x28, 0xee, 0x48, 0x28, 0xef, 0x3a, 0x72, 0xd9, 0x07, 0xb8, 0x44, 0x26, 0xc8, - 0x1b, 0xd8, 0x5b, 0xd8, 0xda, 0xcd, 0x92, 0xc9, 0xba, 0x09, 0xec, 0xac, 0xec, 0x60, 0xe4, 0x2d, - 0x7c, 0x2c, 0x4b, 0x4a, 0x4b, 0x03, 0x2f, 0x62, 0x04, 0xb5, 0x9b, 0x4c, 0xbe, 0xff, 0xcf, 0x9f, - 0xfe, 0x7a, 0xec, 0x1b, 0x72, 0x02, 0xc7, 0x8e, 0xda, 0x3e, 0xf7, 0x2d, 0x0b, 0xff, 0x24, 0xaf, - 0x67, 0xf6, 0x67, 0x98, 0x4d, 0x4d, 0x80, 0xde, 0x02, 0x3a, 0xc7, 0x82, 0x62, 0xd9, 0x85, 0x85, - 0x65, 0xff, 0x15, 0x87, 0x86, 0x03, 0x68, 0x0c, 0xb4, 0xe4, 0xe1, 0x54, 0x68, 0x12, 0x2c, 0xc0, - 0xa3, 0xb1, 0x6e, 0xc6, 0x8b, 0x5d, 0x27, 0xe9, 0xd7, 0xee, 0x29, 0x36, 0xdb, 0xeb, 0xa8, 0xe2, - 0x61, 0x54, 0xf1, 0x7d, 0x54, 0xf1, 0x65, 0x52, 0xd1, 0x30, 0xa9, 0xe8, 0x36, 0xa9, 0x68, 0x5f, - 0x1a, 0x2b, 0x87, 0x4e, 0xe7, 0x15, 0x37, 0x50, 0x51, 0x4d, 0x41, 0x2c, 0x72, 0x6b, 0x3e, 0xf7, - 0x0a, 0xbd, 0x87, 0x33, 0xbc, 0x07, 0x4b, 0xef, 0x29, 0xe8, 0xef, 0xb9, 0xbe, 0x7c, 0x04, 0x00, - 0x00, 0xff, 0xff, 0x99, 0xff, 0xee, 0xed, 0xc8, 0x00, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -// QueryServer is the server API for Query service. -type QueryServer interface { -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "payment.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{}, - Metadata: "payment/query.proto", -} diff --git a/x/payment/types/tx.pb.go b/x/payment/types/tx.pb.go deleted file mode 100644 index b2fdf67181..0000000000 --- a/x/payment/types/tx.pb.go +++ /dev/null @@ -1,2093 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: payment/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -// WirePayForMessage describes the format of data that is sent over the wire for -// each PayForMessage -type MsgWirePayForMessage struct { - Fee *TransactionFee `protobuf:"bytes,1,opt,name=fee,proto3" json:"fee,omitempty"` - Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` - MessageNameSpaceId []byte `protobuf:"bytes,3,opt,name=message_name_space_id,json=messageNameSpaceId,proto3" json:"message_name_space_id,omitempty"` - MessageSize uint64 `protobuf:"varint,4,opt,name=message_size,json=messageSize,proto3" json:"message_size,omitempty"` - Message []byte `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` - MessageShareCommitment []ShareCommitAndSignature `protobuf:"bytes,6,rep,name=message_share_commitment,json=messageShareCommitment,proto3" json:"message_share_commitment"` - PublicKey []byte `protobuf:"bytes,7,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` -} - -func (m *MsgWirePayForMessage) Reset() { *m = MsgWirePayForMessage{} } -func (m *MsgWirePayForMessage) String() string { return proto.CompactTextString(m) } -func (*MsgWirePayForMessage) ProtoMessage() {} -func (*MsgWirePayForMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_9897659aff976806, []int{0} -} -func (m *MsgWirePayForMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgWirePayForMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgWirePayForMessage.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 *MsgWirePayForMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWirePayForMessage.Merge(m, src) -} -func (m *MsgWirePayForMessage) XXX_Size() int { - return m.Size() -} -func (m *MsgWirePayForMessage) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWirePayForMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgWirePayForMessage proto.InternalMessageInfo - -func (m *MsgWirePayForMessage) GetFee() *TransactionFee { - if m != nil { - return m.Fee - } - return nil -} - -func (m *MsgWirePayForMessage) GetNonce() uint64 { - if m != nil { - return m.Nonce - } - return 0 -} - -func (m *MsgWirePayForMessage) GetMessageNameSpaceId() []byte { - if m != nil { - return m.MessageNameSpaceId - } - return nil -} - -func (m *MsgWirePayForMessage) GetMessageSize() uint64 { - if m != nil { - return m.MessageSize - } - return 0 -} - -func (m *MsgWirePayForMessage) GetMessage() []byte { - if m != nil { - return m.Message - } - return nil -} - -func (m *MsgWirePayForMessage) GetMessageShareCommitment() []ShareCommitAndSignature { - if m != nil { - return m.MessageShareCommitment - } - return nil -} - -func (m *MsgWirePayForMessage) GetPublicKey() []byte { - if m != nil { - return m.PublicKey - } - return nil -} - -// MsgPayForMessageResponse describes the response returned after the submission of a MsgWirePayForMessage -type MsgPayForMessageResponse struct { -} - -func (m *MsgPayForMessageResponse) Reset() { *m = MsgPayForMessageResponse{} } -func (m *MsgPayForMessageResponse) String() string { return proto.CompactTextString(m) } -func (*MsgPayForMessageResponse) ProtoMessage() {} -func (*MsgPayForMessageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9897659aff976806, []int{1} -} -func (m *MsgPayForMessageResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgPayForMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgPayForMessageResponse.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 *MsgPayForMessageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgPayForMessageResponse.Merge(m, src) -} -func (m *MsgPayForMessageResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgPayForMessageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgPayForMessageResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgPayForMessageResponse proto.InternalMessageInfo - -// ShareCommitAndSignature defines the -type ShareCommitAndSignature struct { - K uint64 `protobuf:"varint,1,opt,name=k,proto3" json:"k,omitempty"` - ShareCommitment []byte `protobuf:"bytes,2,opt,name=share_commitment,json=shareCommitment,proto3" json:"share_commitment,omitempty"` - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (m *ShareCommitAndSignature) Reset() { *m = ShareCommitAndSignature{} } -func (m *ShareCommitAndSignature) String() string { return proto.CompactTextString(m) } -func (*ShareCommitAndSignature) ProtoMessage() {} -func (*ShareCommitAndSignature) Descriptor() ([]byte, []int) { - return fileDescriptor_9897659aff976806, []int{2} -} -func (m *ShareCommitAndSignature) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ShareCommitAndSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ShareCommitAndSignature.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 *ShareCommitAndSignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_ShareCommitAndSignature.Merge(m, src) -} -func (m *ShareCommitAndSignature) XXX_Size() int { - return m.Size() -} -func (m *ShareCommitAndSignature) XXX_DiscardUnknown() { - xxx_messageInfo_ShareCommitAndSignature.DiscardUnknown(m) -} - -var xxx_messageInfo_ShareCommitAndSignature proto.InternalMessageInfo - -func (m *ShareCommitAndSignature) GetK() uint64 { - if m != nil { - return m.K - } - return 0 -} - -func (m *ShareCommitAndSignature) GetShareCommitment() []byte { - if m != nil { - return m.ShareCommitment - } - return nil -} - -func (m *ShareCommitAndSignature) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -// TxSignedTransactionDataPayForMessage is a wrapper around -// SignedTransactionDataPayForMessage that fullfills the sdk.Tx interface -type TxSignedTransactionDataPayForMessage struct { - Message *SignedTransactionDataPayForMessage `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - PublicKey []byte `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` -} - -func (m *TxSignedTransactionDataPayForMessage) Reset() { *m = TxSignedTransactionDataPayForMessage{} } -func (m *TxSignedTransactionDataPayForMessage) String() string { return proto.CompactTextString(m) } -func (*TxSignedTransactionDataPayForMessage) ProtoMessage() {} -func (*TxSignedTransactionDataPayForMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_9897659aff976806, []int{3} -} -func (m *TxSignedTransactionDataPayForMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TxSignedTransactionDataPayForMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxSignedTransactionDataPayForMessage.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 *TxSignedTransactionDataPayForMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxSignedTransactionDataPayForMessage.Merge(m, src) -} -func (m *TxSignedTransactionDataPayForMessage) XXX_Size() int { - return m.Size() -} -func (m *TxSignedTransactionDataPayForMessage) XXX_DiscardUnknown() { - xxx_messageInfo_TxSignedTransactionDataPayForMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_TxSignedTransactionDataPayForMessage proto.InternalMessageInfo - -func (m *TxSignedTransactionDataPayForMessage) GetMessage() *SignedTransactionDataPayForMessage { - if m != nil { - return m.Message - } - return nil -} - -func (m *TxSignedTransactionDataPayForMessage) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -func (m *TxSignedTransactionDataPayForMessage) GetPublicKey() []byte { - if m != nil { - return m.PublicKey - } - return nil -} - -// SignedTransactionsDataPayForMessage is what gets signed by users when -// creating ShareCommitSignatures. Multiple versions are signed and included. -type SignedTransactionDataPayForMessage struct { - Fee *TransactionFee `protobuf:"bytes,1,opt,name=fee,proto3" json:"fee,omitempty"` - Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` - MessageNamespaceId []byte `protobuf:"bytes,3,opt,name=message_namespace_id,json=messageNamespaceId,proto3" json:"message_namespace_id,omitempty"` - MessageSize uint64 `protobuf:"varint,4,opt,name=message_size,json=messageSize,proto3" json:"message_size,omitempty"` - MessageShareCommitment []byte `protobuf:"bytes,5,opt,name=message_share_commitment,json=messageShareCommitment,proto3" json:"message_share_commitment,omitempty"` -} - -func (m *SignedTransactionDataPayForMessage) Reset() { *m = SignedTransactionDataPayForMessage{} } -func (m *SignedTransactionDataPayForMessage) String() string { return proto.CompactTextString(m) } -func (*SignedTransactionDataPayForMessage) ProtoMessage() {} -func (*SignedTransactionDataPayForMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_9897659aff976806, []int{4} -} -func (m *SignedTransactionDataPayForMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignedTransactionDataPayForMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignedTransactionDataPayForMessage.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 *SignedTransactionDataPayForMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedTransactionDataPayForMessage.Merge(m, src) -} -func (m *SignedTransactionDataPayForMessage) XXX_Size() int { - return m.Size() -} -func (m *SignedTransactionDataPayForMessage) XXX_DiscardUnknown() { - xxx_messageInfo_SignedTransactionDataPayForMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedTransactionDataPayForMessage proto.InternalMessageInfo - -func (m *SignedTransactionDataPayForMessage) GetFee() *TransactionFee { - if m != nil { - return m.Fee - } - return nil -} - -func (m *SignedTransactionDataPayForMessage) GetNonce() uint64 { - if m != nil { - return m.Nonce - } - return 0 -} - -func (m *SignedTransactionDataPayForMessage) GetMessageNamespaceId() []byte { - if m != nil { - return m.MessageNamespaceId - } - return nil -} - -func (m *SignedTransactionDataPayForMessage) GetMessageSize() uint64 { - if m != nil { - return m.MessageSize - } - return 0 -} - -func (m *SignedTransactionDataPayForMessage) GetMessageShareCommitment() []byte { - if m != nil { - return m.MessageShareCommitment - } - return nil -} - -// SignedTransactionDataPayForMessageResponse describes the response returned after the submission of a SignedTransactionDataPayForMessage -type SignedTransactionDataPayForMessageResponse struct { -} - -func (m *SignedTransactionDataPayForMessageResponse) Reset() { - *m = SignedTransactionDataPayForMessageResponse{} -} -func (m *SignedTransactionDataPayForMessageResponse) String() string { - return proto.CompactTextString(m) -} -func (*SignedTransactionDataPayForMessageResponse) ProtoMessage() {} -func (*SignedTransactionDataPayForMessageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9897659aff976806, []int{5} -} -func (m *SignedTransactionDataPayForMessageResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SignedTransactionDataPayForMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignedTransactionDataPayForMessageResponse.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 *SignedTransactionDataPayForMessageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedTransactionDataPayForMessageResponse.Merge(m, src) -} -func (m *SignedTransactionDataPayForMessageResponse) XXX_Size() int { - return m.Size() -} -func (m *SignedTransactionDataPayForMessageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SignedTransactionDataPayForMessageResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedTransactionDataPayForMessageResponse proto.InternalMessageInfo - -// TransactionFee contains the base and tip rates. -type TransactionFee struct { - BaseRateMax uint64 `protobuf:"varint,1,opt,name=base_rate_max,json=baseRateMax,proto3" json:"base_rate_max,omitempty"` - TipRateMax uint64 `protobuf:"varint,2,opt,name=tip_rate_max,json=tipRateMax,proto3" json:"tip_rate_max,omitempty"` -} - -func (m *TransactionFee) Reset() { *m = TransactionFee{} } -func (m *TransactionFee) String() string { return proto.CompactTextString(m) } -func (*TransactionFee) ProtoMessage() {} -func (*TransactionFee) Descriptor() ([]byte, []int) { - return fileDescriptor_9897659aff976806, []int{6} -} -func (m *TransactionFee) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TransactionFee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TransactionFee.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 *TransactionFee) XXX_Merge(src proto.Message) { - xxx_messageInfo_TransactionFee.Merge(m, src) -} -func (m *TransactionFee) XXX_Size() int { - return m.Size() -} -func (m *TransactionFee) XXX_DiscardUnknown() { - xxx_messageInfo_TransactionFee.DiscardUnknown(m) -} - -var xxx_messageInfo_TransactionFee proto.InternalMessageInfo - -func (m *TransactionFee) GetBaseRateMax() uint64 { - if m != nil { - return m.BaseRateMax - } - return 0 -} - -func (m *TransactionFee) GetTipRateMax() uint64 { - if m != nil { - return m.TipRateMax - } - return 0 -} - -func init() { - proto.RegisterType((*MsgWirePayForMessage)(nil), "payment.MsgWirePayForMessage") - proto.RegisterType((*MsgPayForMessageResponse)(nil), "payment.MsgPayForMessageResponse") - proto.RegisterType((*ShareCommitAndSignature)(nil), "payment.ShareCommitAndSignature") - proto.RegisterType((*TxSignedTransactionDataPayForMessage)(nil), "payment.TxSignedTransactionDataPayForMessage") - proto.RegisterType((*SignedTransactionDataPayForMessage)(nil), "payment.SignedTransactionDataPayForMessage") - proto.RegisterType((*SignedTransactionDataPayForMessageResponse)(nil), "payment.SignedTransactionDataPayForMessageResponse") - proto.RegisterType((*TransactionFee)(nil), "payment.TransactionFee") -} - -func init() { proto.RegisterFile("payment/tx.proto", fileDescriptor_9897659aff976806) } - -var fileDescriptor_9897659aff976806 = []byte{ - // 601 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xdd, 0x4e, 0x13, 0x41, - 0x14, 0xee, 0xb4, 0x05, 0xc2, 0x69, 0x51, 0x32, 0xa9, 0xb2, 0x69, 0xa0, 0x94, 0x8d, 0x89, 0xc5, - 0x9f, 0xae, 0xc2, 0x8d, 0xb7, 0xa2, 0x92, 0x18, 0x53, 0x63, 0xb6, 0x44, 0x13, 0x6f, 0xd6, 0xe9, - 0xf6, 0xb0, 0x4c, 0x60, 0x77, 0x26, 0x3b, 0x43, 0xd2, 0x72, 0xa7, 0x4f, 0x60, 0xe2, 0x5b, 0xf8, - 0x24, 0x5c, 0x92, 0x78, 0xe3, 0x95, 0x31, 0xe0, 0x23, 0xf8, 0x00, 0x66, 0xff, 0x69, 0x05, 0x24, - 0xf1, 0x6e, 0xe6, 0xfc, 0x7c, 0xe7, 0x9b, 0x6f, 0xbe, 0x1c, 0x58, 0x94, 0x6c, 0xec, 0x63, 0xa0, - 0x2d, 0x3d, 0xea, 0xca, 0x50, 0x68, 0x41, 0xe7, 0xd2, 0x48, 0xb3, 0xe1, 0x09, 0x4f, 0xc4, 0x31, - 0x2b, 0x3a, 0x25, 0xe9, 0xe6, 0xb2, 0x27, 0x84, 0x77, 0x80, 0x16, 0x93, 0xdc, 0x62, 0x41, 0x20, - 0x34, 0xd3, 0x5c, 0x04, 0x2a, 0xc9, 0x9a, 0xc7, 0x65, 0x68, 0xf4, 0x94, 0xf7, 0x8e, 0x87, 0xf8, - 0x86, 0x8d, 0xb7, 0x45, 0xd8, 0x43, 0xa5, 0x98, 0x87, 0x74, 0x1d, 0x2a, 0xbb, 0x88, 0x06, 0x69, - 0x93, 0x4e, 0x6d, 0x63, 0xa9, 0x9b, 0xce, 0xe8, 0xee, 0x84, 0x2c, 0x50, 0xcc, 0x8d, 0x20, 0xb6, - 0x11, 0xed, 0xa8, 0x86, 0x36, 0x60, 0x26, 0x10, 0x81, 0x8b, 0x46, 0xb9, 0x4d, 0x3a, 0x55, 0x3b, - 0xb9, 0xd0, 0xc7, 0x70, 0xcb, 0x4f, 0xb0, 0x9c, 0x80, 0xf9, 0xe8, 0x28, 0xc9, 0x5c, 0x74, 0xf8, - 0xd0, 0xa8, 0xb4, 0x49, 0xa7, 0x6e, 0xd3, 0x34, 0xf9, 0x9a, 0xf9, 0xd8, 0x8f, 0x52, 0x2f, 0x87, - 0x74, 0x0d, 0xea, 0x59, 0x8b, 0xe2, 0x47, 0x68, 0x54, 0x63, 0xbc, 0x5a, 0x1a, 0xeb, 0xf3, 0x23, - 0xa4, 0x06, 0xcc, 0xa5, 0x57, 0x63, 0x26, 0xc6, 0xc9, 0xae, 0xf4, 0x03, 0x18, 0x79, 0xf3, 0x1e, - 0x0b, 0xd1, 0x71, 0x85, 0xef, 0x73, 0x1d, 0xb1, 0x36, 0x66, 0xdb, 0x95, 0x4e, 0x6d, 0xa3, 0x9d, - 0xbf, 0xa2, 0x1f, 0x15, 0x3c, 0x8b, 0xf3, 0x4f, 0x83, 0x61, 0x9f, 0x7b, 0x01, 0xd3, 0x87, 0x21, - 0x6e, 0x55, 0x8f, 0x7f, 0xac, 0x96, 0xec, 0xdb, 0xd9, 0xc0, 0xa2, 0x2a, 0xea, 0xa2, 0x2b, 0x00, - 0xf2, 0x70, 0x70, 0xc0, 0x5d, 0x67, 0x1f, 0xc7, 0xc6, 0x5c, 0x3c, 0x7e, 0x3e, 0x89, 0xbc, 0xc2, - 0xb1, 0xd9, 0x04, 0xa3, 0xa7, 0xbc, 0x09, 0x15, 0x6d, 0x54, 0x52, 0x04, 0x0a, 0x4d, 0x09, 0x4b, - 0x97, 0xcc, 0xa4, 0x75, 0x20, 0xfb, 0xb1, 0xcc, 0x55, 0x9b, 0xec, 0xd3, 0x75, 0x58, 0xfc, 0x8b, - 0x7d, 0x39, 0x9e, 0x74, 0x53, 0x4d, 0xd1, 0x59, 0x86, 0x79, 0x95, 0xa1, 0xa4, 0xa2, 0x16, 0x01, - 0xf3, 0x2b, 0x81, 0x3b, 0x3b, 0xa3, 0x68, 0x0c, 0x0e, 0xcf, 0x7d, 0xda, 0x73, 0xa6, 0xd9, 0xe4, - 0x47, 0xbf, 0x28, 0x14, 0x4d, 0x3e, 0xfb, 0x7e, 0x21, 0xd3, 0x3f, 0xbb, 0x0b, 0xf9, 0x27, 0xd8, - 0x94, 0xa7, 0xd8, 0x4c, 0x49, 0x57, 0x99, 0x96, 0xee, 0x37, 0x01, 0xf3, 0x1a, 0x54, 0xff, 0xdb, - 0x93, 0x8f, 0xa0, 0x71, 0xde, 0x93, 0x57, 0x58, 0x52, 0x5d, 0xdf, 0x92, 0x4f, 0xae, 0x30, 0x5e, - 0xe2, 0xd1, 0x4b, 0x0c, 0x65, 0x3e, 0x80, 0x7b, 0xd7, 0x90, 0x38, 0xf3, 0xd0, 0x5b, 0xb8, 0x31, - 0xf9, 0x52, 0x6a, 0xc2, 0xc2, 0x80, 0x29, 0x74, 0x42, 0xa6, 0xd1, 0xf1, 0xd9, 0x28, 0xb5, 0x51, - 0x2d, 0x0a, 0xda, 0x4c, 0x63, 0x8f, 0x8d, 0x68, 0x1b, 0xea, 0x9a, 0xcb, 0xa2, 0x24, 0xd1, 0x03, - 0x34, 0x97, 0x69, 0xc5, 0xc6, 0x47, 0x02, 0x95, 0x9e, 0xf2, 0xe8, 0x11, 0x2c, 0x4c, 0xca, 0xbd, - 0x92, 0x2b, 0x7c, 0xd1, 0x86, 0x68, 0xae, 0x9d, 0x4f, 0x5f, 0x4c, 0xf9, 0xee, 0xa7, 0x6f, 0xbf, - 0xbe, 0x94, 0xd7, 0xe8, 0xaa, 0xe5, 0xe2, 0x01, 0x2a, 0xcd, 0x99, 0x95, 0xad, 0x2f, 0xc9, 0xc6, - 0xbb, 0x22, 0x4c, 0x85, 0xd9, 0xea, 0x1d, 0x9f, 0xb6, 0xc8, 0xc9, 0x69, 0x8b, 0xfc, 0x3c, 0x6d, - 0x91, 0xcf, 0x67, 0xad, 0xd2, 0xc9, 0x59, 0xab, 0xf4, 0xfd, 0xac, 0x55, 0x7a, 0xbf, 0xe9, 0x71, - 0xbd, 0x77, 0x38, 0xe8, 0xba, 0xc2, 0xcf, 0x41, 0x44, 0xe8, 0xe5, 0xe7, 0x87, 0x4c, 0x4a, 0x6b, - 0x94, 0xc3, 0xea, 0xb1, 0x44, 0x35, 0x98, 0x8d, 0x97, 0xdb, 0xe6, 0x9f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xf4, 0x42, 0xa9, 0x21, 0x2d, 0x05, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // PayForMessage allows the user to post data to made be available. - PayForMessage(ctx context.Context, in *MsgWirePayForMessage, opts ...grpc.CallOption) (*MsgPayForMessageResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) PayForMessage(ctx context.Context, in *MsgWirePayForMessage, opts ...grpc.CallOption) (*MsgPayForMessageResponse, error) { - out := new(MsgPayForMessageResponse) - err := c.cc.Invoke(ctx, "/payment.Msg/PayForMessage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // PayForMessage allows the user to post data to made be available. - PayForMessage(context.Context, *MsgWirePayForMessage) (*MsgPayForMessageResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) PayForMessage(ctx context.Context, req *MsgWirePayForMessage) (*MsgPayForMessageResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PayForMessage not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_PayForMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgWirePayForMessage) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).PayForMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/payment.Msg/PayForMessage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).PayForMessage(ctx, req.(*MsgWirePayForMessage)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "payment.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "PayForMessage", - Handler: _Msg_PayForMessage_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "payment/tx.proto", -} - -func (m *MsgWirePayForMessage) 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 *MsgWirePayForMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgWirePayForMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PublicKey) > 0 { - i -= len(m.PublicKey) - copy(dAtA[i:], m.PublicKey) - i = encodeVarintTx(dAtA, i, uint64(len(m.PublicKey))) - i-- - dAtA[i] = 0x3a - } - if len(m.MessageShareCommitment) > 0 { - for iNdEx := len(m.MessageShareCommitment) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.MessageShareCommitment[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintTx(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0x2a - } - if m.MessageSize != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MessageSize)) - i-- - dAtA[i] = 0x20 - } - if len(m.MessageNameSpaceId) > 0 { - i -= len(m.MessageNameSpaceId) - copy(dAtA[i:], m.MessageNameSpaceId) - i = encodeVarintTx(dAtA, i, uint64(len(m.MessageNameSpaceId))) - i-- - dAtA[i] = 0x1a - } - if m.Nonce != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Nonce)) - i-- - dAtA[i] = 0x10 - } - if m.Fee != nil { - { - size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgPayForMessageResponse) 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 *MsgPayForMessageResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgPayForMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *ShareCommitAndSignature) 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 *ShareCommitAndSignature) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ShareCommitAndSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x1a - } - if len(m.ShareCommitment) > 0 { - i -= len(m.ShareCommitment) - copy(dAtA[i:], m.ShareCommitment) - i = encodeVarintTx(dAtA, i, uint64(len(m.ShareCommitment))) - i-- - dAtA[i] = 0x12 - } - if m.K != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.K)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *TxSignedTransactionDataPayForMessage) 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 *TxSignedTransactionDataPayForMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxSignedTransactionDataPayForMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PublicKey) > 0 { - i -= len(m.PublicKey) - copy(dAtA[i:], m.PublicKey) - i = encodeVarintTx(dAtA, i, uint64(len(m.PublicKey))) - i-- - dAtA[i] = 0x1a - } - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x12 - } - if m.Message != nil { - { - size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SignedTransactionDataPayForMessage) 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 *SignedTransactionDataPayForMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignedTransactionDataPayForMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.MessageShareCommitment) > 0 { - i -= len(m.MessageShareCommitment) - copy(dAtA[i:], m.MessageShareCommitment) - i = encodeVarintTx(dAtA, i, uint64(len(m.MessageShareCommitment))) - i-- - dAtA[i] = 0x2a - } - if m.MessageSize != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.MessageSize)) - i-- - dAtA[i] = 0x20 - } - if len(m.MessageNamespaceId) > 0 { - i -= len(m.MessageNamespaceId) - copy(dAtA[i:], m.MessageNamespaceId) - i = encodeVarintTx(dAtA, i, uint64(len(m.MessageNamespaceId))) - i-- - dAtA[i] = 0x1a - } - if m.Nonce != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Nonce)) - i-- - dAtA[i] = 0x10 - } - if m.Fee != nil { - { - size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SignedTransactionDataPayForMessageResponse) 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 *SignedTransactionDataPayForMessageResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignedTransactionDataPayForMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *TransactionFee) 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 *TransactionFee) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TransactionFee) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TipRateMax != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.TipRateMax)) - i-- - dAtA[i] = 0x10 - } - if m.BaseRateMax != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.BaseRateMax)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgWirePayForMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Fee != nil { - l = m.Fee.Size() - n += 1 + l + sovTx(uint64(l)) - } - if m.Nonce != 0 { - n += 1 + sovTx(uint64(m.Nonce)) - } - l = len(m.MessageNameSpaceId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.MessageSize != 0 { - n += 1 + sovTx(uint64(m.MessageSize)) - } - l = len(m.Message) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.MessageShareCommitment) > 0 { - for _, e := range m.MessageShareCommitment { - l = e.Size() - n += 1 + l + sovTx(uint64(l)) - } - } - l = len(m.PublicKey) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgPayForMessageResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *ShareCommitAndSignature) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.K != 0 { - n += 1 + sovTx(uint64(m.K)) - } - l = len(m.ShareCommitment) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *TxSignedTransactionDataPayForMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Message != nil { - l = m.Message.Size() - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.PublicKey) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *SignedTransactionDataPayForMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Fee != nil { - l = m.Fee.Size() - n += 1 + l + sovTx(uint64(l)) - } - if m.Nonce != 0 { - n += 1 + sovTx(uint64(m.Nonce)) - } - l = len(m.MessageNamespaceId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.MessageSize != 0 { - n += 1 + sovTx(uint64(m.MessageSize)) - } - l = len(m.MessageShareCommitment) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *SignedTransactionDataPayForMessageResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *TransactionFee) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BaseRateMax != 0 { - n += 1 + sovTx(uint64(m.BaseRateMax)) - } - if m.TipRateMax != 0 { - n += 1 + sovTx(uint64(m.TipRateMax)) - } - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgWirePayForMessage) 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 ErrIntOverflowTx - } - 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: MsgWirePayForMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWirePayForMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Fee == nil { - m.Fee = &TransactionFee{} - } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) - } - m.Nonce = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Nonce |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageNameSpaceId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MessageNameSpaceId = append(m.MessageNameSpaceId[:0], dAtA[iNdEx:postIndex]...) - if m.MessageNameSpaceId == nil { - m.MessageNameSpaceId = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageSize", wireType) - } - m.MessageSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MessageSize |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Message = append(m.Message[:0], dAtA[iNdEx:postIndex]...) - if m.Message == nil { - m.Message = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageShareCommitment", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MessageShareCommitment = append(m.MessageShareCommitment, ShareCommitAndSignature{}) - if err := m.MessageShareCommitment[len(m.MessageShareCommitment)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if m.PublicKey == nil { - m.PublicKey = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgPayForMessageResponse) 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 ErrIntOverflowTx - } - 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: MsgPayForMessageResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgPayForMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ShareCommitAndSignature) 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 ErrIntOverflowTx - } - 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: ShareCommitAndSignature: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ShareCommitAndSignature: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field K", wireType) - } - m.K = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.K |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShareCommitment", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ShareCommitment = append(m.ShareCommitment[:0], dAtA[iNdEx:postIndex]...) - if m.ShareCommitment == nil { - m.ShareCommitment = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TxSignedTransactionDataPayForMessage) 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 ErrIntOverflowTx - } - 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: TxSignedTransactionDataPayForMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TxSignedTransactionDataPayForMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Message == nil { - m.Message = &SignedTransactionDataPayForMessage{} - } - if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) - if m.PublicKey == nil { - m.PublicKey = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignedTransactionDataPayForMessage) 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 ErrIntOverflowTx - } - 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: SignedTransactionDataPayForMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignedTransactionDataPayForMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Fee == nil { - m.Fee = &TransactionFee{} - } - if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) - } - m.Nonce = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Nonce |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageNamespaceId", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MessageNamespaceId = append(m.MessageNamespaceId[:0], dAtA[iNdEx:postIndex]...) - if m.MessageNamespaceId == nil { - m.MessageNamespaceId = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageSize", wireType) - } - m.MessageSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MessageSize |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MessageShareCommitment", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.MessageShareCommitment = append(m.MessageShareCommitment[:0], dAtA[iNdEx:postIndex]...) - if m.MessageShareCommitment == nil { - m.MessageShareCommitment = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SignedTransactionDataPayForMessageResponse) 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 ErrIntOverflowTx - } - 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: SignedTransactionDataPayForMessageResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignedTransactionDataPayForMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TransactionFee) 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 ErrIntOverflowTx - } - 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: TransactionFee: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TransactionFee: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseRateMax", wireType) - } - m.BaseRateMax = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BaseRateMax |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TipRateMax", wireType) - } - m.TipRateMax = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TipRateMax |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/payment/types/tx.pb.gw.go b/x/payment/types/tx.pb.gw.go deleted file mode 100644 index cdf96fdfff..0000000000 --- a/x/payment/types/tx.pb.gw.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: payment/tx.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -var ( - filter_Msg_PayForMessage_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_PayForMessage_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgWirePayForMessage - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_PayForMessage_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.PayForMessage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_PayForMessage_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgWirePayForMessage - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_PayForMessage_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.PayForMessage(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("GET", pattern_Msg_PayForMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_PayForMessage_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_PayForMessage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("GET", pattern_Msg_PayForMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_PayForMessage_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_PayForMessage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_PayForMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"celestia", "payment", "payformessage"}, "", runtime.AssumeColonVerbOpt(true))) -) - -var ( - forward_Msg_PayForMessage_0 = runtime.ForwardResponseMessage -) diff --git a/x/payment/types/types.go b/x/payment/types/types.go deleted file mode 100644 index ab1254f4c2..0000000000 --- a/x/payment/types/types.go +++ /dev/null @@ -1 +0,0 @@ -package types From 95e3396f8c166d87ef17ce1aa77489da915f0fb2 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:33:41 -0500 Subject: [PATCH 02/17] update proto to use tendermint instead of celestia-core --- third_party/proto/tendermint/abci/types.proto | 2 +- .../proto/tendermint/crypto/keys.proto | 2 +- .../proto/tendermint/crypto/proof.proto | 2 +- .../proto/tendermint/libs/bits/types.proto | 2 +- .../proto/tendermint/types/evidence.proto | 2 +- .../proto/tendermint/types/params.proto | 2 +- .../proto/tendermint/types/types.proto | 2 +- .../proto/tendermint/types/validator.proto | 2 +- .../proto/tendermint/version/types.proto | 2 +- x/payment/types/genesis.pb.go | 263 +++ x/payment/types/query.pb.go | 86 + x/payment/types/tx.pb.go | 2072 +++++++++++++++++ x/payment/types/tx.pb.gw.go | 166 ++ 13 files changed, 2596 insertions(+), 9 deletions(-) create mode 100644 x/payment/types/genesis.pb.go create mode 100644 x/payment/types/query.pb.go create mode 100644 x/payment/types/tx.pb.go create mode 100644 x/payment/types/tx.pb.gw.go diff --git a/third_party/proto/tendermint/abci/types.proto b/third_party/proto/tendermint/abci/types.proto index 23ac852c9f..a56000236d 100644 --- a/third_party/proto/tendermint/abci/types.proto +++ b/third_party/proto/tendermint/abci/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.abci; -option go_package = "github.com/celestiaorg/celestia-core/abci/types"; +option go_package = "github.com/tendermint/tendermint/abci/types"; // For more information on gogo.proto, see: // https://github.com/gogo/protobuf/blob/master/extensions.md diff --git a/third_party/proto/tendermint/crypto/keys.proto b/third_party/proto/tendermint/crypto/keys.proto index 1fd4e2b2e3..16fd7adf3e 100644 --- a/third_party/proto/tendermint/crypto/keys.proto +++ b/third_party/proto/tendermint/crypto/keys.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.crypto; -option go_package = "github.com/celestiaorg/celestia-core/proto/tendermint/crypto"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/tendermint/crypto/proof.proto b/third_party/proto/tendermint/crypto/proof.proto index 9d8b803dcb..975df76853 100644 --- a/third_party/proto/tendermint/crypto/proof.proto +++ b/third_party/proto/tendermint/crypto/proof.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.crypto; -option go_package = "github.com/celestiaorg/celestia-core/proto/tendermint/crypto"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; import "gogoproto/gogo.proto"; diff --git a/third_party/proto/tendermint/libs/bits/types.proto b/third_party/proto/tendermint/libs/bits/types.proto index 0a0a46fc76..3111d113a5 100644 --- a/third_party/proto/tendermint/libs/bits/types.proto +++ b/third_party/proto/tendermint/libs/bits/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.libs.bits; -option go_package = "github.com/celestiaorg/celestia-core/proto/tendermint/libs/bits"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/libs/bits"; message BitArray { int64 bits = 1; diff --git a/third_party/proto/tendermint/types/evidence.proto b/third_party/proto/tendermint/types/evidence.proto index e230c1ddc6..a6f099bbf4 100644 --- a/third_party/proto/tendermint/types/evidence.proto +++ b/third_party/proto/tendermint/types/evidence.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/celestiaorg/celestia-core/proto/tendermint/types"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "tendermint/types/types.proto"; diff --git a/third_party/proto/tendermint/types/params.proto b/third_party/proto/tendermint/types/params.proto index e7c4d7555c..0de7d846fb 100644 --- a/third_party/proto/tendermint/types/params.proto +++ b/third_party/proto/tendermint/types/params.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/celestiaorg/celestia-core/proto/tendermint/types"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; diff --git a/third_party/proto/tendermint/types/types.proto b/third_party/proto/tendermint/types/types.proto index 949b8c482f..5534fbfbc8 100644 --- a/third_party/proto/tendermint/types/types.proto +++ b/third_party/proto/tendermint/types/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/celestiaorg/celestia-core/proto/tendermint/types"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; diff --git a/third_party/proto/tendermint/types/validator.proto b/third_party/proto/tendermint/types/validator.proto index 2296041747..49860b96d6 100644 --- a/third_party/proto/tendermint/types/validator.proto +++ b/third_party/proto/tendermint/types/validator.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.types; -option go_package = "github.com/celestiaorg/celestia-core/proto/tendermint/types"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "tendermint/crypto/keys.proto"; diff --git a/third_party/proto/tendermint/version/types.proto b/third_party/proto/tendermint/version/types.proto index 8498d633d0..6061868bd4 100644 --- a/third_party/proto/tendermint/version/types.proto +++ b/third_party/proto/tendermint/version/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package tendermint.version; -option go_package = "github.com/celestiaorg/celestia-core/proto/tendermint/version"; +option go_package = "github.com/tendermint/tendermint/proto/tendermint/version"; import "gogoproto/gogo.proto"; diff --git a/x/payment/types/genesis.pb.go b/x/payment/types/genesis.pb.go new file mode 100644 index 0000000000..3b25078113 --- /dev/null +++ b/x/payment/types/genesis.pb.go @@ -0,0 +1,263 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: payment/genesis.proto + +package types + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + 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 + +// GenesisState defines the capability module's genesis state. +type GenesisState struct { +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_ded92bd505296f58, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func init() { + proto.RegisterType((*GenesisState)(nil), "payment.GenesisState") +} + +func init() { proto.RegisterFile("payment/genesis.proto", fileDescriptor_ded92bd505296f58) } + +var fileDescriptor_ded92bd505296f58 = []byte{ + // 135 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2d, 0x48, 0xac, 0xcc, + 0x4d, 0xcd, 0x2b, 0xd1, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, + 0xc9, 0x17, 0x62, 0x87, 0x0a, 0x2b, 0xf1, 0x71, 0xf1, 0xb8, 0x43, 0x64, 0x82, 0x4b, 0x12, 0x4b, + 0x52, 0x9d, 0x7c, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, + 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x38, 0x3d, + 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x3f, 0x39, 0x35, 0x27, 0xb5, 0xb8, 0x24, + 0x33, 0x31, 0xbf, 0x28, 0x1d, 0xce, 0xd6, 0x4d, 0x2c, 0x28, 0xd0, 0xaf, 0xd0, 0x87, 0xd9, 0x57, + 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xb6, 0xce, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x12, + 0x51, 0x3e, 0xf3, 0x87, 0x00, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/payment/types/query.pb.go b/x/payment/types/query.pb.go new file mode 100644 index 0000000000..04022eb22e --- /dev/null +++ b/x/payment/types/query.pb.go @@ -0,0 +1,86 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: payment/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/query" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + math "math" +) + +// 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 + +func init() { proto.RegisterFile("payment/query.proto", fileDescriptor_0d907c42280cbd58) } + +var fileDescriptor_0d907c42280cbd58 = []byte{ + // 187 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x3c, 0xce, 0xb1, 0x8e, 0x82, 0x40, + 0x10, 0x06, 0x60, 0x28, 0xee, 0x48, 0x28, 0xef, 0x3a, 0x72, 0xd9, 0x07, 0xb8, 0x44, 0x26, 0xc8, + 0x1b, 0xd8, 0x5b, 0xd8, 0xda, 0xcd, 0x92, 0xc9, 0xba, 0x09, 0xec, 0xac, 0xec, 0x60, 0xe4, 0x2d, + 0x7c, 0x2c, 0x4b, 0x4a, 0x4b, 0x03, 0x2f, 0x62, 0x04, 0xb5, 0x9b, 0x4c, 0xbe, 0xff, 0xcf, 0x9f, + 0xfe, 0x7a, 0xec, 0x1b, 0x72, 0x02, 0xc7, 0x8e, 0xda, 0x3e, 0xf7, 0x2d, 0x0b, 0xff, 0x24, 0xaf, + 0x67, 0xf6, 0x67, 0x98, 0x4d, 0x4d, 0x80, 0xde, 0x02, 0x3a, 0xc7, 0x82, 0x62, 0xd9, 0x85, 0x85, + 0x65, 0xff, 0x15, 0x87, 0x86, 0x03, 0x68, 0x0c, 0xb4, 0xe4, 0xe1, 0x54, 0x68, 0x12, 0x2c, 0xc0, + 0xa3, 0xb1, 0x6e, 0xc6, 0x8b, 0x5d, 0x27, 0xe9, 0xd7, 0xee, 0x29, 0x36, 0xdb, 0xeb, 0xa8, 0xe2, + 0x61, 0x54, 0xf1, 0x7d, 0x54, 0xf1, 0x65, 0x52, 0xd1, 0x30, 0xa9, 0xe8, 0x36, 0xa9, 0x68, 0x5f, + 0x1a, 0x2b, 0x87, 0x4e, 0xe7, 0x15, 0x37, 0x50, 0x51, 0x4d, 0x41, 0x2c, 0x72, 0x6b, 0x3e, 0xf7, + 0x0a, 0xbd, 0x87, 0x33, 0xbc, 0x07, 0x4b, 0xef, 0x29, 0xe8, 0xef, 0xb9, 0xbe, 0x7c, 0x04, 0x00, + 0x00, 0xff, 0xff, 0x99, 0xff, 0xee, 0xed, 0xc8, 0x00, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +// QueryServer is the server API for Query service. +type QueryServer interface { +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "payment.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{}, + Metadata: "payment/query.proto", +} diff --git a/x/payment/types/tx.pb.go b/x/payment/types/tx.pb.go new file mode 100644 index 0000000000..dd6fba6374 --- /dev/null +++ b/x/payment/types/tx.pb.go @@ -0,0 +1,2072 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: payment/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// WirePayForMessage describes the format of data that is sent over the wire for +// each PayForMessage +type MsgWirePayForMessage struct { + Fee *TransactionFee `protobuf:"bytes,1,opt,name=fee,proto3" json:"fee,omitempty"` + Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + MessageNameSpaceId []byte `protobuf:"bytes,3,opt,name=message_name_space_id,json=messageNameSpaceId,proto3" json:"message_name_space_id,omitempty"` + MessageSize uint64 `protobuf:"varint,4,opt,name=message_size,json=messageSize,proto3" json:"message_size,omitempty"` + Message []byte `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` + MessageShareCommitment []ShareCommitAndSignature `protobuf:"bytes,6,rep,name=message_share_commitment,json=messageShareCommitment,proto3" json:"message_share_commitment"` + PublicKey []byte `protobuf:"bytes,7,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +} + +func (m *MsgWirePayForMessage) Reset() { *m = MsgWirePayForMessage{} } +func (m *MsgWirePayForMessage) String() string { return proto.CompactTextString(m) } +func (*MsgWirePayForMessage) ProtoMessage() {} +func (*MsgWirePayForMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_9897659aff976806, []int{0} +} +func (m *MsgWirePayForMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWirePayForMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWirePayForMessage.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 *MsgWirePayForMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWirePayForMessage.Merge(m, src) +} +func (m *MsgWirePayForMessage) XXX_Size() int { + return m.Size() +} +func (m *MsgWirePayForMessage) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWirePayForMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWirePayForMessage proto.InternalMessageInfo + +func (m *MsgWirePayForMessage) GetFee() *TransactionFee { + if m != nil { + return m.Fee + } + return nil +} + +func (m *MsgWirePayForMessage) GetNonce() uint64 { + if m != nil { + return m.Nonce + } + return 0 +} + +func (m *MsgWirePayForMessage) GetMessageNameSpaceId() []byte { + if m != nil { + return m.MessageNameSpaceId + } + return nil +} + +func (m *MsgWirePayForMessage) GetMessageSize() uint64 { + if m != nil { + return m.MessageSize + } + return 0 +} + +func (m *MsgWirePayForMessage) GetMessage() []byte { + if m != nil { + return m.Message + } + return nil +} + +func (m *MsgWirePayForMessage) GetMessageShareCommitment() []ShareCommitAndSignature { + if m != nil { + return m.MessageShareCommitment + } + return nil +} + +func (m *MsgWirePayForMessage) GetPublicKey() []byte { + if m != nil { + return m.PublicKey + } + return nil +} + +// MsgPayForMessageResponse describes the response returned after the submission of a MsgWirePayForMessage +type MsgPayForMessageResponse struct { +} + +func (m *MsgPayForMessageResponse) Reset() { *m = MsgPayForMessageResponse{} } +func (m *MsgPayForMessageResponse) String() string { return proto.CompactTextString(m) } +func (*MsgPayForMessageResponse) ProtoMessage() {} +func (*MsgPayForMessageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9897659aff976806, []int{1} +} +func (m *MsgPayForMessageResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgPayForMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgPayForMessageResponse.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 *MsgPayForMessageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPayForMessageResponse.Merge(m, src) +} +func (m *MsgPayForMessageResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgPayForMessageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPayForMessageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgPayForMessageResponse proto.InternalMessageInfo + +// ShareCommitAndSignature defines the +type ShareCommitAndSignature struct { + K uint64 `protobuf:"varint,1,opt,name=k,proto3" json:"k,omitempty"` + ShareCommitment []byte `protobuf:"bytes,2,opt,name=share_commitment,json=shareCommitment,proto3" json:"share_commitment,omitempty"` + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *ShareCommitAndSignature) Reset() { *m = ShareCommitAndSignature{} } +func (m *ShareCommitAndSignature) String() string { return proto.CompactTextString(m) } +func (*ShareCommitAndSignature) ProtoMessage() {} +func (*ShareCommitAndSignature) Descriptor() ([]byte, []int) { + return fileDescriptor_9897659aff976806, []int{2} +} +func (m *ShareCommitAndSignature) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ShareCommitAndSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ShareCommitAndSignature.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 *ShareCommitAndSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_ShareCommitAndSignature.Merge(m, src) +} +func (m *ShareCommitAndSignature) XXX_Size() int { + return m.Size() +} +func (m *ShareCommitAndSignature) XXX_DiscardUnknown() { + xxx_messageInfo_ShareCommitAndSignature.DiscardUnknown(m) +} + +var xxx_messageInfo_ShareCommitAndSignature proto.InternalMessageInfo + +func (m *ShareCommitAndSignature) GetK() uint64 { + if m != nil { + return m.K + } + return 0 +} + +func (m *ShareCommitAndSignature) GetShareCommitment() []byte { + if m != nil { + return m.ShareCommitment + } + return nil +} + +func (m *ShareCommitAndSignature) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +// TxSignedTransactionDataPayForMessage is a wrapper around +// SignedTransactionDataPayForMessage that fullfills the sdk.Tx interface +type TxSignedTransactionDataPayForMessage struct { + Message *SignedTransactionDataPayForMessage `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + PublicKey []byte `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` +} + +func (m *TxSignedTransactionDataPayForMessage) Reset() { *m = TxSignedTransactionDataPayForMessage{} } +func (m *TxSignedTransactionDataPayForMessage) String() string { return proto.CompactTextString(m) } +func (*TxSignedTransactionDataPayForMessage) ProtoMessage() {} +func (*TxSignedTransactionDataPayForMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_9897659aff976806, []int{3} +} +func (m *TxSignedTransactionDataPayForMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxSignedTransactionDataPayForMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxSignedTransactionDataPayForMessage.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 *TxSignedTransactionDataPayForMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxSignedTransactionDataPayForMessage.Merge(m, src) +} +func (m *TxSignedTransactionDataPayForMessage) XXX_Size() int { + return m.Size() +} +func (m *TxSignedTransactionDataPayForMessage) XXX_DiscardUnknown() { + xxx_messageInfo_TxSignedTransactionDataPayForMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_TxSignedTransactionDataPayForMessage proto.InternalMessageInfo + +func (m *TxSignedTransactionDataPayForMessage) GetMessage() *SignedTransactionDataPayForMessage { + if m != nil { + return m.Message + } + return nil +} + +func (m *TxSignedTransactionDataPayForMessage) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +func (m *TxSignedTransactionDataPayForMessage) GetPublicKey() []byte { + if m != nil { + return m.PublicKey + } + return nil +} + +// SignedTransactionsDataPayForMessage is what gets signed by users when +// creating ShareCommitSignatures. Multiple versions are signed and included. +type SignedTransactionDataPayForMessage struct { + Fee *TransactionFee `protobuf:"bytes,1,opt,name=fee,proto3" json:"fee,omitempty"` + Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"` + MessageNamespaceId []byte `protobuf:"bytes,3,opt,name=message_namespace_id,json=messageNamespaceId,proto3" json:"message_namespace_id,omitempty"` + MessageSize uint64 `protobuf:"varint,4,opt,name=message_size,json=messageSize,proto3" json:"message_size,omitempty"` + MessageShareCommitment []byte `protobuf:"bytes,5,opt,name=message_share_commitment,json=messageShareCommitment,proto3" json:"message_share_commitment,omitempty"` +} + +func (m *SignedTransactionDataPayForMessage) Reset() { *m = SignedTransactionDataPayForMessage{} } +func (m *SignedTransactionDataPayForMessage) String() string { return proto.CompactTextString(m) } +func (*SignedTransactionDataPayForMessage) ProtoMessage() {} +func (*SignedTransactionDataPayForMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_9897659aff976806, []int{4} +} +func (m *SignedTransactionDataPayForMessage) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignedTransactionDataPayForMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignedTransactionDataPayForMessage.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 *SignedTransactionDataPayForMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedTransactionDataPayForMessage.Merge(m, src) +} +func (m *SignedTransactionDataPayForMessage) XXX_Size() int { + return m.Size() +} +func (m *SignedTransactionDataPayForMessage) XXX_DiscardUnknown() { + xxx_messageInfo_SignedTransactionDataPayForMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_SignedTransactionDataPayForMessage proto.InternalMessageInfo + +func (m *SignedTransactionDataPayForMessage) GetFee() *TransactionFee { + if m != nil { + return m.Fee + } + return nil +} + +func (m *SignedTransactionDataPayForMessage) GetNonce() uint64 { + if m != nil { + return m.Nonce + } + return 0 +} + +func (m *SignedTransactionDataPayForMessage) GetMessageNamespaceId() []byte { + if m != nil { + return m.MessageNamespaceId + } + return nil +} + +func (m *SignedTransactionDataPayForMessage) GetMessageSize() uint64 { + if m != nil { + return m.MessageSize + } + return 0 +} + +func (m *SignedTransactionDataPayForMessage) GetMessageShareCommitment() []byte { + if m != nil { + return m.MessageShareCommitment + } + return nil +} + +// SignedTransactionDataPayForMessageResponse describes the response returned after the submission of a SignedTransactionDataPayForMessage +type SignedTransactionDataPayForMessageResponse struct { +} + +func (m *SignedTransactionDataPayForMessageResponse) Reset() { + *m = SignedTransactionDataPayForMessageResponse{} +} +func (m *SignedTransactionDataPayForMessageResponse) String() string { + return proto.CompactTextString(m) +} +func (*SignedTransactionDataPayForMessageResponse) ProtoMessage() {} +func (*SignedTransactionDataPayForMessageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9897659aff976806, []int{5} +} +func (m *SignedTransactionDataPayForMessageResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignedTransactionDataPayForMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignedTransactionDataPayForMessageResponse.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 *SignedTransactionDataPayForMessageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignedTransactionDataPayForMessageResponse.Merge(m, src) +} +func (m *SignedTransactionDataPayForMessageResponse) XXX_Size() int { + return m.Size() +} +func (m *SignedTransactionDataPayForMessageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SignedTransactionDataPayForMessageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_SignedTransactionDataPayForMessageResponse proto.InternalMessageInfo + +// TransactionFee contains the base and tip rates. +type TransactionFee struct { + BaseRateMax uint64 `protobuf:"varint,1,opt,name=base_rate_max,json=baseRateMax,proto3" json:"base_rate_max,omitempty"` + TipRateMax uint64 `protobuf:"varint,2,opt,name=tip_rate_max,json=tipRateMax,proto3" json:"tip_rate_max,omitempty"` +} + +func (m *TransactionFee) Reset() { *m = TransactionFee{} } +func (m *TransactionFee) String() string { return proto.CompactTextString(m) } +func (*TransactionFee) ProtoMessage() {} +func (*TransactionFee) Descriptor() ([]byte, []int) { + return fileDescriptor_9897659aff976806, []int{6} +} +func (m *TransactionFee) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TransactionFee) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TransactionFee.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 *TransactionFee) XXX_Merge(src proto.Message) { + xxx_messageInfo_TransactionFee.Merge(m, src) +} +func (m *TransactionFee) XXX_Size() int { + return m.Size() +} +func (m *TransactionFee) XXX_DiscardUnknown() { + xxx_messageInfo_TransactionFee.DiscardUnknown(m) +} + +var xxx_messageInfo_TransactionFee proto.InternalMessageInfo + +func (m *TransactionFee) GetBaseRateMax() uint64 { + if m != nil { + return m.BaseRateMax + } + return 0 +} + +func (m *TransactionFee) GetTipRateMax() uint64 { + if m != nil { + return m.TipRateMax + } + return 0 +} + +func init() { + proto.RegisterType((*MsgWirePayForMessage)(nil), "payment.MsgWirePayForMessage") + proto.RegisterType((*MsgPayForMessageResponse)(nil), "payment.MsgPayForMessageResponse") + proto.RegisterType((*ShareCommitAndSignature)(nil), "payment.ShareCommitAndSignature") + proto.RegisterType((*TxSignedTransactionDataPayForMessage)(nil), "payment.TxSignedTransactionDataPayForMessage") + proto.RegisterType((*SignedTransactionDataPayForMessage)(nil), "payment.SignedTransactionDataPayForMessage") + proto.RegisterType((*SignedTransactionDataPayForMessageResponse)(nil), "payment.SignedTransactionDataPayForMessageResponse") + proto.RegisterType((*TransactionFee)(nil), "payment.TransactionFee") +} + +func init() { proto.RegisterFile("payment/tx.proto", fileDescriptor_9897659aff976806) } + +var fileDescriptor_9897659aff976806 = []byte{ + // 601 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xdd, 0x4e, 0x13, 0x41, + 0x14, 0xee, 0xb4, 0x05, 0xc2, 0x69, 0x51, 0x32, 0xa9, 0xb2, 0x69, 0xa0, 0x94, 0x8d, 0x89, 0xc5, + 0x9f, 0xae, 0xc2, 0x8d, 0xb7, 0xa2, 0x92, 0x18, 0x53, 0x63, 0xb6, 0x44, 0x13, 0x6f, 0xd6, 0xe9, + 0xf6, 0xb0, 0x4c, 0x60, 0x77, 0x26, 0x3b, 0x43, 0xd2, 0x72, 0xa7, 0x4f, 0x60, 0xe2, 0x5b, 0xf8, + 0x24, 0x5c, 0x92, 0x78, 0xe3, 0x95, 0x31, 0xe0, 0x23, 0xf8, 0x00, 0x66, 0xff, 0x69, 0x05, 0x24, + 0xf1, 0x6e, 0xe6, 0xfc, 0x7c, 0xe7, 0x9b, 0x6f, 0xbe, 0x1c, 0x58, 0x94, 0x6c, 0xec, 0x63, 0xa0, + 0x2d, 0x3d, 0xea, 0xca, 0x50, 0x68, 0x41, 0xe7, 0xd2, 0x48, 0xb3, 0xe1, 0x09, 0x4f, 0xc4, 0x31, + 0x2b, 0x3a, 0x25, 0xe9, 0xe6, 0xb2, 0x27, 0x84, 0x77, 0x80, 0x16, 0x93, 0xdc, 0x62, 0x41, 0x20, + 0x34, 0xd3, 0x5c, 0x04, 0x2a, 0xc9, 0x9a, 0xc7, 0x65, 0x68, 0xf4, 0x94, 0xf7, 0x8e, 0x87, 0xf8, + 0x86, 0x8d, 0xb7, 0x45, 0xd8, 0x43, 0xa5, 0x98, 0x87, 0x74, 0x1d, 0x2a, 0xbb, 0x88, 0x06, 0x69, + 0x93, 0x4e, 0x6d, 0x63, 0xa9, 0x9b, 0xce, 0xe8, 0xee, 0x84, 0x2c, 0x50, 0xcc, 0x8d, 0x20, 0xb6, + 0x11, 0xed, 0xa8, 0x86, 0x36, 0x60, 0x26, 0x10, 0x81, 0x8b, 0x46, 0xb9, 0x4d, 0x3a, 0x55, 0x3b, + 0xb9, 0xd0, 0xc7, 0x70, 0xcb, 0x4f, 0xb0, 0x9c, 0x80, 0xf9, 0xe8, 0x28, 0xc9, 0x5c, 0x74, 0xf8, + 0xd0, 0xa8, 0xb4, 0x49, 0xa7, 0x6e, 0xd3, 0x34, 0xf9, 0x9a, 0xf9, 0xd8, 0x8f, 0x52, 0x2f, 0x87, + 0x74, 0x0d, 0xea, 0x59, 0x8b, 0xe2, 0x47, 0x68, 0x54, 0x63, 0xbc, 0x5a, 0x1a, 0xeb, 0xf3, 0x23, + 0xa4, 0x06, 0xcc, 0xa5, 0x57, 0x63, 0x26, 0xc6, 0xc9, 0xae, 0xf4, 0x03, 0x18, 0x79, 0xf3, 0x1e, + 0x0b, 0xd1, 0x71, 0x85, 0xef, 0x73, 0x1d, 0xb1, 0x36, 0x66, 0xdb, 0x95, 0x4e, 0x6d, 0xa3, 0x9d, + 0xbf, 0xa2, 0x1f, 0x15, 0x3c, 0x8b, 0xf3, 0x4f, 0x83, 0x61, 0x9f, 0x7b, 0x01, 0xd3, 0x87, 0x21, + 0x6e, 0x55, 0x8f, 0x7f, 0xac, 0x96, 0xec, 0xdb, 0xd9, 0xc0, 0xa2, 0x2a, 0xea, 0xa2, 0x2b, 0x00, + 0xf2, 0x70, 0x70, 0xc0, 0x5d, 0x67, 0x1f, 0xc7, 0xc6, 0x5c, 0x3c, 0x7e, 0x3e, 0x89, 0xbc, 0xc2, + 0xb1, 0xd9, 0x04, 0xa3, 0xa7, 0xbc, 0x09, 0x15, 0x6d, 0x54, 0x52, 0x04, 0x0a, 0x4d, 0x09, 0x4b, + 0x97, 0xcc, 0xa4, 0x75, 0x20, 0xfb, 0xb1, 0xcc, 0x55, 0x9b, 0xec, 0xd3, 0x75, 0x58, 0xfc, 0x8b, + 0x7d, 0x39, 0x9e, 0x74, 0x53, 0x4d, 0xd1, 0x59, 0x86, 0x79, 0x95, 0xa1, 0xa4, 0xa2, 0x16, 0x01, + 0xf3, 0x2b, 0x81, 0x3b, 0x3b, 0xa3, 0x68, 0x0c, 0x0e, 0xcf, 0x7d, 0xda, 0x73, 0xa6, 0xd9, 0xe4, + 0x47, 0xbf, 0x28, 0x14, 0x4d, 0x3e, 0xfb, 0x7e, 0x21, 0xd3, 0x3f, 0xbb, 0x0b, 0xf9, 0x27, 0xd8, + 0x94, 0xa7, 0xd8, 0x4c, 0x49, 0x57, 0x99, 0x96, 0xee, 0x37, 0x01, 0xf3, 0x1a, 0x54, 0xff, 0xdb, + 0x93, 0x8f, 0xa0, 0x71, 0xde, 0x93, 0x57, 0x58, 0x52, 0x5d, 0xdf, 0x92, 0x4f, 0xae, 0x30, 0x5e, + 0xe2, 0xd1, 0x4b, 0x0c, 0x65, 0x3e, 0x80, 0x7b, 0xd7, 0x90, 0x38, 0xf3, 0xd0, 0x5b, 0xb8, 0x31, + 0xf9, 0x52, 0x6a, 0xc2, 0xc2, 0x80, 0x29, 0x74, 0x42, 0xa6, 0xd1, 0xf1, 0xd9, 0x28, 0xb5, 0x51, + 0x2d, 0x0a, 0xda, 0x4c, 0x63, 0x8f, 0x8d, 0x68, 0x1b, 0xea, 0x9a, 0xcb, 0xa2, 0x24, 0xd1, 0x03, + 0x34, 0x97, 0x69, 0xc5, 0xc6, 0x47, 0x02, 0x95, 0x9e, 0xf2, 0xe8, 0x11, 0x2c, 0x4c, 0xca, 0xbd, + 0x92, 0x2b, 0x7c, 0xd1, 0x86, 0x68, 0xae, 0x9d, 0x4f, 0x5f, 0x4c, 0xf9, 0xee, 0xa7, 0x6f, 0xbf, + 0xbe, 0x94, 0xd7, 0xe8, 0xaa, 0xe5, 0xe2, 0x01, 0x2a, 0xcd, 0x99, 0x95, 0xad, 0x2f, 0xc9, 0xc6, + 0xbb, 0x22, 0x4c, 0x85, 0xd9, 0xea, 0x1d, 0x9f, 0xb6, 0xc8, 0xc9, 0x69, 0x8b, 0xfc, 0x3c, 0x6d, + 0x91, 0xcf, 0x67, 0xad, 0xd2, 0xc9, 0x59, 0xab, 0xf4, 0xfd, 0xac, 0x55, 0x7a, 0xbf, 0xe9, 0x71, + 0xbd, 0x77, 0x38, 0xe8, 0xba, 0xc2, 0xcf, 0x41, 0x44, 0xe8, 0xe5, 0xe7, 0x87, 0x4c, 0x4a, 0x6b, + 0x94, 0xc3, 0xea, 0xb1, 0x44, 0x35, 0x98, 0x8d, 0x97, 0xdb, 0xe6, 0x9f, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xf4, 0x42, 0xa9, 0x21, 0x2d, 0x05, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // PayForMessage allows the user to post data to made be available. + PayForMessage(ctx context.Context, in *MsgWirePayForMessage, opts ...grpc.CallOption) (*MsgPayForMessageResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) PayForMessage(ctx context.Context, in *MsgWirePayForMessage, opts ...grpc.CallOption) (*MsgPayForMessageResponse, error) { + out := new(MsgPayForMessageResponse) + err := c.cc.Invoke(ctx, "/payment.Msg/PayForMessage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // PayForMessage allows the user to post data to made be available. + PayForMessage(context.Context, *MsgWirePayForMessage) (*MsgPayForMessageResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) PayForMessage(ctx context.Context, req *MsgWirePayForMessage) (*MsgPayForMessageResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PayForMessage not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_PayForMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWirePayForMessage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).PayForMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/payment.Msg/PayForMessage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).PayForMessage(ctx, req.(*MsgWirePayForMessage)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "payment.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PayForMessage", + Handler: _Msg_PayForMessage_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "payment/tx.proto", +} + +func (m *MsgWirePayForMessage) 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 *MsgWirePayForMessage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWirePayForMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x3a + } + if len(m.MessageShareCommitment) > 0 { + for iNdEx := len(m.MessageShareCommitment) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MessageShareCommitment[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintTx(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x2a + } + if m.MessageSize != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MessageSize)) + i-- + dAtA[i] = 0x20 + } + if len(m.MessageNameSpaceId) > 0 { + i -= len(m.MessageNameSpaceId) + copy(dAtA[i:], m.MessageNameSpaceId) + i = encodeVarintTx(dAtA, i, uint64(len(m.MessageNameSpaceId))) + i-- + dAtA[i] = 0x1a + } + if m.Nonce != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Nonce)) + i-- + dAtA[i] = 0x10 + } + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgPayForMessageResponse) 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 *MsgPayForMessageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgPayForMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ShareCommitAndSignature) 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 *ShareCommitAndSignature) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShareCommitAndSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x1a + } + if len(m.ShareCommitment) > 0 { + i -= len(m.ShareCommitment) + copy(dAtA[i:], m.ShareCommitment) + i = encodeVarintTx(dAtA, i, uint64(len(m.ShareCommitment))) + i-- + dAtA[i] = 0x12 + } + if m.K != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.K)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TxSignedTransactionDataPayForMessage) 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 *TxSignedTransactionDataPayForMessage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TxSignedTransactionDataPayForMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PublicKey) > 0 { + i -= len(m.PublicKey) + copy(dAtA[i:], m.PublicKey) + i = encodeVarintTx(dAtA, i, uint64(len(m.PublicKey))) + i-- + dAtA[i] = 0x1a + } + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x12 + } + if m.Message != nil { + { + size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SignedTransactionDataPayForMessage) 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 *SignedTransactionDataPayForMessage) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SignedTransactionDataPayForMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MessageShareCommitment) > 0 { + i -= len(m.MessageShareCommitment) + copy(dAtA[i:], m.MessageShareCommitment) + i = encodeVarintTx(dAtA, i, uint64(len(m.MessageShareCommitment))) + i-- + dAtA[i] = 0x2a + } + if m.MessageSize != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.MessageSize)) + i-- + dAtA[i] = 0x20 + } + if len(m.MessageNamespaceId) > 0 { + i -= len(m.MessageNamespaceId) + copy(dAtA[i:], m.MessageNamespaceId) + i = encodeVarintTx(dAtA, i, uint64(len(m.MessageNamespaceId))) + i-- + dAtA[i] = 0x1a + } + if m.Nonce != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Nonce)) + i-- + dAtA[i] = 0x10 + } + if m.Fee != nil { + { + size, err := m.Fee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SignedTransactionDataPayForMessageResponse) 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 *SignedTransactionDataPayForMessageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SignedTransactionDataPayForMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *TransactionFee) 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 *TransactionFee) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TransactionFee) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TipRateMax != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TipRateMax)) + i-- + dAtA[i] = 0x10 + } + if m.BaseRateMax != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.BaseRateMax)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgWirePayForMessage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.Nonce != 0 { + n += 1 + sovTx(uint64(m.Nonce)) + } + l = len(m.MessageNameSpaceId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.MessageSize != 0 { + n += 1 + sovTx(uint64(m.MessageSize)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.MessageShareCommitment) > 0 { + for _, e := range m.MessageShareCommitment { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgPayForMessageResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ShareCommitAndSignature) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.K != 0 { + n += 1 + sovTx(uint64(m.K)) + } + l = len(m.ShareCommitment) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *TxSignedTransactionDataPayForMessage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Message != nil { + l = m.Message.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.PublicKey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *SignedTransactionDataPayForMessage) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Fee != nil { + l = m.Fee.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.Nonce != 0 { + n += 1 + sovTx(uint64(m.Nonce)) + } + l = len(m.MessageNamespaceId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.MessageSize != 0 { + n += 1 + sovTx(uint64(m.MessageSize)) + } + l = len(m.MessageShareCommitment) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *SignedTransactionDataPayForMessageResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *TransactionFee) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BaseRateMax != 0 { + n += 1 + sovTx(uint64(m.BaseRateMax)) + } + if m.TipRateMax != 0 { + n += 1 + sovTx(uint64(m.TipRateMax)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgWirePayForMessage) 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 ErrIntOverflowTx + } + 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: MsgWirePayForMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWirePayForMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fee == nil { + m.Fee = &TransactionFee{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + m.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageNameSpaceId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageNameSpaceId = append(m.MessageNameSpaceId[:0], dAtA[iNdEx:postIndex]...) + if m.MessageNameSpaceId == nil { + m.MessageNameSpaceId = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageSize", wireType) + } + m.MessageSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MessageSize |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = append(m.Message[:0], dAtA[iNdEx:postIndex]...) + if m.Message == nil { + m.Message = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageShareCommitment", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageShareCommitment = append(m.MessageShareCommitment, ShareCommitAndSignature{}) + if err := m.MessageShareCommitment[len(m.MessageShareCommitment)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.PublicKey == nil { + m.PublicKey = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgPayForMessageResponse) 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 ErrIntOverflowTx + } + 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: MsgPayForMessageResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgPayForMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ShareCommitAndSignature) 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 ErrIntOverflowTx + } + 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: ShareCommitAndSignature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ShareCommitAndSignature: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field K", wireType) + } + m.K = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.K |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShareCommitment", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ShareCommitment = append(m.ShareCommitment[:0], dAtA[iNdEx:postIndex]...) + if m.ShareCommitment == nil { + m.ShareCommitment = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TxSignedTransactionDataPayForMessage) 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 ErrIntOverflowTx + } + 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: TxSignedTransactionDataPayForMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TxSignedTransactionDataPayForMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Message == nil { + m.Message = &SignedTransactionDataPayForMessage{} + } + if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PublicKey = append(m.PublicKey[:0], dAtA[iNdEx:postIndex]...) + if m.PublicKey == nil { + m.PublicKey = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SignedTransactionDataPayForMessage) 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 ErrIntOverflowTx + } + 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: SignedTransactionDataPayForMessage: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SignedTransactionDataPayForMessage: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fee == nil { + m.Fee = &TransactionFee{} + } + if err := m.Fee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Nonce", wireType) + } + m.Nonce = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Nonce |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageNamespaceId", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageNamespaceId = append(m.MessageNamespaceId[:0], dAtA[iNdEx:postIndex]...) + if m.MessageNamespaceId == nil { + m.MessageNamespaceId = []byte{} + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageSize", wireType) + } + m.MessageSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MessageSize |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MessageShareCommitment", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MessageShareCommitment = append(m.MessageShareCommitment[:0], dAtA[iNdEx:postIndex]...) + if m.MessageShareCommitment == nil { + m.MessageShareCommitment = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SignedTransactionDataPayForMessageResponse) 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 ErrIntOverflowTx + } + 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: SignedTransactionDataPayForMessageResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SignedTransactionDataPayForMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TransactionFee) 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 ErrIntOverflowTx + } + 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: TransactionFee: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TransactionFee: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseRateMax", wireType) + } + m.BaseRateMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.BaseRateMax |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TipRateMax", wireType) + } + m.TipRateMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TipRateMax |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/payment/types/tx.pb.gw.go b/x/payment/types/tx.pb.gw.go new file mode 100644 index 0000000000..cdf96fdfff --- /dev/null +++ b/x/payment/types/tx.pb.gw.go @@ -0,0 +1,166 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: payment/tx.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +var ( + filter_Msg_PayForMessage_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Msg_PayForMessage_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgWirePayForMessage + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_PayForMessage_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.PayForMessage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Msg_PayForMessage_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MsgWirePayForMessage + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_PayForMessage_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.PayForMessage(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". +// UnaryRPC :call MsgServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. +func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { + + mux.Handle("GET", pattern_Msg_PayForMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Msg_PayForMessage_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_PayForMessage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMsgHandler(ctx, mux, conn) +} + +// RegisterMsgHandler registers the http handlers for service Msg to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) +} + +// RegisterMsgHandlerClient registers the http handlers for service Msg +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MsgClient" to call the correct interceptors. +func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { + + mux.Handle("GET", pattern_Msg_PayForMessage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Msg_PayForMessage_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Msg_PayForMessage_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Msg_PayForMessage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"celestia", "payment", "payformessage"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Msg_PayForMessage_0 = runtime.ForwardResponseMessage +) From be7e4216aaebc9de93823eb85e1301235ce3b903 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:34:47 -0500 Subject: [PATCH 03/17] regenerate and adjust application --- app/abci.go | 163 +++++++++++++ app/abci_test.go | 368 ++++++++++++++++++++++++++++ app/app.go | 613 +++++++++++++++++++++++++++++++++++++++++++++++ app/encoding.go | 22 ++ app/export.go | 185 ++++++++++++++ app/genesis.go | 21 ++ 6 files changed, 1372 insertions(+) create mode 100644 app/abci.go create mode 100644 app/abci_test.go create mode 100755 app/app.go create mode 100644 app/encoding.go create mode 100755 app/export.go create mode 100755 app/genesis.go diff --git a/app/abci.go b/app/abci.go new file mode 100644 index 0000000000..fcf3ddd53c --- /dev/null +++ b/app/abci.go @@ -0,0 +1,163 @@ +package app + +import ( + "bytes" + "errors" + "fmt" + "sort" + + "github.com/celestiaorg/celestia-app/x/payment/types" + sdk "github.com/cosmos/cosmos-sdk/types" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/pkg/consts" + core "github.com/tendermint/tendermint/proto/tendermint/types" +) + +// This file should contain all of the altered ABCI methods + +// PreprocessTxs fullfills the celestia-core version of the ACBI interface, by +// performing basic validation for the incoming txs, and by cleanly separating +// share messages from transactions +func (app *App) PreprocessTxs(txs abci.RequestPreprocessTxs) abci.ResponsePreprocessTxs { + squareSize := app.SquareSize() + shareCounter := uint64(0) + var shareMsgs []*core.Message + var processedTxs [][]byte + for _, rawTx := range txs.Txs { + // decode the Tx + tx, err := app.txConfig.TxDecoder()(rawTx) + if err != nil { + continue + } + + // don't process the tx if the transaction doesn't contain a + // PayForMessage sdk.Msg + if !hasWirePayForMessage(tx) { + processedTxs = append(processedTxs, rawTx) + continue + } + + // only support transactions that contain a single sdk.Msg + if len(tx.GetMsgs()) != 1 { + continue + } + + msg := tx.GetMsgs()[0] + + // run basic validation on the transaction + err = tx.ValidateBasic() + if err != nil { + continue + } + + // process the message + coreMsg, signedTx, err := app.processMsg(msg) + if err != nil { + continue + } + + // increment the share counter by the number of shares taken by the message + sharesTaken := uint64(len(coreMsg.Data) / types.ShareSize) + shareCounter += sharesTaken + + // if there are too many shares stop processing and return the transactions + if shareCounter > squareSize*squareSize { + break + } + + // encode the processed tx + rawProcessedTx, err := app.appCodec.Marshal(signedTx) + if err != nil { + continue + } + + // add the message and tx to the output + shareMsgs = append(shareMsgs, &coreMsg) + processedTxs = append(processedTxs, rawProcessedTx) + } + + // sort messages lexigraphically + sort.Slice(shareMsgs, func(i, j int) bool { + return bytes.Compare(shareMsgs[i].NamespaceId, shareMsgs[j].NamespaceId) < 0 + }) + + return abci.ResponsePreprocessTxs{ + Txs: processedTxs, + Messages: &core.Messages{MessagesList: shareMsgs}, + } +} + +// pfmURL is the URL expected for pfm. NOTE: this will be deleted when we upgrade from +// sdk v0.44.0 +var pfmURL = sdk.MsgTypeURL(&types.MsgWirePayForMessage{}) + +func hasWirePayForMessage(tx sdk.Tx) bool { + for _, msg := range tx.GetMsgs() { + msgName := sdk.MsgTypeURL(msg) + if msgName == pfmURL { + return true + } + // note: this is what we will use in the future as proto.MessageName is + // deprecated + // svcMsg, ok := msg.(sdk.ServiceMsg) if !ok { + // continue + // } if svcMsg.SerivceMethod == types.TypeMsgPayforMessage { + // return true + // } + } + return false +} + +// processMsgs will perform the processing required by PreProcessTxs for a set +// of sdk.Msg's from a single sdk.Tx +func (app *App) processMsg(msg sdk.Msg) (core.Message, *types.TxSignedTransactionDataPayForMessage, error) { + squareSize := app.SquareSize() + // reject all msgs in tx if a single included msg is not correct type + wireMsg, ok := msg.(*types.MsgWirePayForMessage) + if !ok { + return core.Message{}, + nil, + errors.New("transaction contained a message type other than types.MsgWirePayForMessage") + } + + // make sure that a ShareCommitAndSignature of the correct size is + // included in the message + var shareCommit types.ShareCommitAndSignature + for _, commit := range wireMsg.MessageShareCommitment { + if commit.K == squareSize { + shareCommit = commit + } + } + // K == 0 means there was no share commit with the desired current square size + if shareCommit.K == 0 { + return core.Message{}, + nil, + fmt.Errorf("No share commit for correct square size. Current square size: %d", squareSize) + } + + // add the message to the list of core message to be returned to ll-core + coreMsg := core.Message{ + NamespaceId: wireMsg.GetMessageNameSpaceId(), + Data: wireMsg.GetMessage(), + } + + // wrap the signed transaction data + sTxData, err := wireMsg.SignedTransactionDataPayForMessage(squareSize) + if err != nil { + return core.Message{}, nil, err + } + + signedData := &types.TxSignedTransactionDataPayForMessage{ + Message: sTxData, + Signature: shareCommit.Signature, + PublicKey: wireMsg.PublicKey, + } + + return coreMsg, signedData, nil +} + +// SquareSize returns the current square size. Currently, the square size is +// hardcoded. todo(evan): don't hardcode the square size +func (app *App) SquareSize() uint64 { + return consts.MaxSquareSize +} diff --git a/app/abci_test.go b/app/abci_test.go new file mode 100644 index 0000000000..46f1f3567a --- /dev/null +++ b/app/abci_test.go @@ -0,0 +1,368 @@ +package app + +import ( + "bytes" + "encoding/json" + "fmt" + "os" + "testing" + + "github.com/celestiaorg/celestia-app/x/payment/types" + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/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" + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/spf13/cast" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/tendermint/spm/cosmoscmd" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + core "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" +) + +const testingKeyAcc = "test" + +// Get flags every time the simulator is run +func init() { + simapp.GetSimulatorFlags() +} + +func TestProcessMsg(t *testing.T) { + kb := keyring.NewInMemory() + info, _, err := kb.NewMnemonic(testingKeyAcc, keyring.English, "", "", hd.Secp256k1) + if err != nil { + t.Error(err) + } + ns := []byte{1, 1, 1, 1, 1, 1, 1, 1} + message := bytes.Repeat([]byte{1}, 256) + + // create a signed MsgWirePayFroMessage + msg := generateSignedWirePayForMessage(t, types.SquareSize, ns, message, kb) + + testApp := setupApp(t, info.GetPubKey()) + + tests := []struct { + name string + args sdk.Msg + want core.Message + }{ + { + name: "basic", + args: msg, + want: core.Message{NamespaceId: msg.MessageNameSpaceId, Data: msg.Message}, + }, + } + for _, tt := range tests { + result, _, err := testApp.processMsg(tt.args) + if err != nil { + t.Error(err) + } + assert.Equal(t, tt.want, result, tt.name) + } +} + +func TestPreprocessTxs(t *testing.T) { + kb := keyring.NewInMemory() + info, _, err := kb.NewMnemonic(testingKeyAcc, keyring.English, "", "", hd.Secp256k1) + if err != nil { + t.Error(err) + } + + testApp := setupApp(t, info.GetPubKey()) + + type test struct { + input abci.RequestPreprocessTxs + expectedMessages []*core.Message + expectedTxs int + } + + firstNS := []byte{2, 2, 2, 2, 2, 2, 2, 2} + firstMessage := bytes.Repeat([]byte{2}, 512) + firstRawTx := generateRawTx(t, testApp.txConfig, firstNS, firstMessage, kb) + + secondNS := []byte{1, 1, 1, 1, 1, 1, 1, 1} + secondMessage := []byte{2} + secondRawTx := generateRawTx(t, testApp.txConfig, secondNS, secondMessage, kb) + + thirdNS := []byte{3, 3, 3, 3, 3, 3, 3, 3} + thirdMessage := []byte{} + thirdRawTx := generateRawTx(t, testApp.txConfig, thirdNS, thirdMessage, kb) + + tests := []test{ + { + input: abci.RequestPreprocessTxs{ + Txs: [][]byte{firstRawTx, secondRawTx, thirdRawTx}, + }, + expectedMessages: []*core.Message{ + { + NamespaceId: secondNS, // the second message should be first + Data: append([]byte{2}, bytes.Repeat([]byte{0}, 255)...), // check that the message is padded + }, + { + NamespaceId: firstNS, + Data: firstMessage, + }, + { + NamespaceId: thirdNS, + Data: nil, + }, + }, + expectedTxs: 3, + }, + } + + for _, tt := range tests { + res := testApp.PreprocessTxs(tt.input) + assert.Equal(t, tt.expectedMessages, res.Messages.MessagesList) + assert.Equal(t, tt.expectedTxs, len(res.Txs)) + } +} + +func setupApp(t *testing.T, pub cryptotypes.PubKey) *App { + // var cache sdk.MultiStorePersistentCache + // EmptyAppOptions is a stub implementing AppOptions + emptyOpts := emptyAppOptions{} + var anteOpt = func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(nil) } + db := dbm.NewMemDB() + logger := log.NewTMLogger(log.NewSyncWriter(os.Stderr)) + + skipUpgradeHeights := make(map[int64]bool) + + encCfg := cosmoscmd.MakeEncodingConfig(ModuleBasics) + + testApp := New( + logger, db, nil, true, skipUpgradeHeights, + cast.ToString(emptyOpts.Get(flags.FlagHome)), + cast.ToUint(emptyOpts.Get(server.FlagInvCheckPeriod)), + encCfg, + emptyOpts, + anteOpt, + ) + + // for acc := range maccPerms { + // require.Equal(t, !allowedReceivingModAcc[acc], testApp.BankKeeper.BlockedAddr(testApp.AccountKeeper.GetModuleAddress(acc)), + // "ensure that blocked addresses are properly set in bank keeper") + // } + + genesisState := NewDefaultGenesisState(encCfg.Marshaler) + + genesisState, err := addGenesisAccount(sdk.AccAddress(pub.Address().Bytes()), genesisState, encCfg.Marshaler) + if err != nil { + t.Error(err) + } + + stateBytes, err := json.MarshalIndent(genesisState, "", " ") + require.NoError(t, err) + + // Initialize the chain + testApp.InitChain( + abci.RequestInitChain{ + Validators: []abci.ValidatorUpdate{}, + AppStateBytes: stateBytes, + }, + ) + + return testApp +} + +type emptyAppOptions struct{} + +// Get implements AppOptions +func (ao emptyAppOptions) Get(o string) interface{} { + return nil +} + +// addGenesisAccount mimics the cli addGenesisAccount command, providing an +// account with an allocation of to "token" and "stake" tokens in the genesis +// state +func addGenesisAccount(addr sdk.AccAddress, appState map[string]json.RawMessage, cdc codec.Codec) (map[string]json.RawMessage, error) { + // create concrete account type based on input parameters + var genAccount authtypes.GenesisAccount + + coins := sdk.Coins{ + sdk.NewCoin("token", sdk.NewInt(1000000)), + sdk.NewCoin("stake", sdk.NewInt(1000000)), + } + + balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} + baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) + + genAccount = baseAccount + + if err := genAccount.Validate(); err != nil { + return appState, fmt.Errorf("failed to validate new genesis account: %w", err) + } + + authGenState := authtypes.GetGenesisStateFromAppState(cdc, appState) + + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + if err != nil { + return appState, fmt.Errorf("failed to get accounts from any: %w", err) + } + + if accs.Contains(addr) { + return appState, fmt.Errorf("cannot add account at existing address %s", addr) + } + + // Add the new account to the set of genesis accounts and sanitize the + // accounts afterwards. + accs = append(accs, genAccount) + accs = authtypes.SanitizeGenesisAccounts(accs) + + genAccs, err := authtypes.PackAccounts(accs) + if err != nil { + return appState, fmt.Errorf("failed to convert accounts into any's: %w", err) + } + authGenState.Accounts = genAccs + + authGenStateBz, err := cdc.MarshalJSON(&authGenState) + if err != nil { + return appState, 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 appState, fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + + appState[banktypes.ModuleName] = bankGenStateBz + return appState, nil +} + +func generateRawTx(t *testing.T, txConfig client.TxConfig, ns, message []byte, ring keyring.Keyring) (rawTx []byte) { + // create a msg + msg := generateSignedWirePayForMessage(t, types.SquareSize, ns, message, ring) + + info, err := ring.Key(testingKeyAcc) + if err != nil { + t.Error(err) + } + + // this is returning a tx.wrapper + builder := txConfig.NewTxBuilder() + err = builder.SetMsgs(msg) + if err != nil { + t.Error(err) + } + + coin := sdk.Coin{ + Denom: "token", + Amount: sdk.NewInt(1000), + } + + builder.SetFeeAmount(sdk.NewCoins(coin)) + builder.SetGasLimit(10000) + builder.SetTimeoutHeight(99) + + signingData := authsigning.SignerData{ + ChainID: "test-chain", + AccountNumber: 0, + Sequence: 0, + } + + // Important set the Signature to nil BEFORE actually signing + sigData := signing.SingleSignatureData{ + SignMode: signing.SignMode_SIGN_MODE_DIRECT, + Signature: nil, + } + + sig := signing.SignatureV2{ + PubKey: info.GetPubKey(), + Data: &sigData, + Sequence: 0, + } + + // set the empty signature + err = builder.SetSignatures(sig) + if err != nil { + if err != nil { + t.Error(err) + } + } + + // Generate the bytes to be signed. + bytesToSign, err := txConfig. + SignModeHandler(). + GetSignBytes( + signing.SignMode_SIGN_MODE_DIRECT, + signingData, + builder.GetTx(), + ) + if err != nil { + t.Error(err) + } + + // Sign those bytes + sigBytes, _, err := ring.Sign(testingKeyAcc, bytesToSign) + if err != nil { + t.Error(err) + } + + // Construct the SignatureV2 struct + sigData = signing.SingleSignatureData{ + SignMode: signing.SignMode_SIGN_MODE_DIRECT, + Signature: sigBytes, + } + + sigV2 := signing.SignatureV2{ + PubKey: info.GetPubKey(), + Data: &sigData, + Sequence: 0, + } + + // set the actual signature + err = builder.SetSignatures(sigV2) + if err != nil { + if err != nil { + t.Error(err) + } + } + + // finish the tx + tx := builder.GetTx() + + // encode the tx + rawTx, err = txConfig.TxEncoder()(tx) + if err != nil { + t.Error(err) + } + + return rawTx +} + +func generateSignedWirePayForMessage(t *testing.T, k uint64, ns, message []byte, ring keyring.Keyring) *types.MsgWirePayForMessage { + info, err := ring.Key(testingKeyAcc) + if err != nil { + t.Error(err) + } + + msg, err := types.NewMsgWirePayForMessage(ns, message, info.GetPubKey().Bytes(), &types.TransactionFee{}, k) + if err != nil { + t.Error(err) + } + + err = msg.SignShareCommitments(testingKeyAcc, ring) + if err != nil { + t.Error(err) + } + + return msg +} diff --git a/app/app.go b/app/app.go new file mode 100755 index 0000000000..4adb0bce21 --- /dev/null +++ b/app/app.go @@ -0,0 +1,613 @@ +package app + +import ( + "io" + "os" + "path/filepath" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" + "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/server/api" + "github.com/cosmos/cosmos-sdk/server/config" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/cosmos/cosmos-sdk/version" + "github.com/cosmos/cosmos-sdk/x/auth" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + authrest "github.com/cosmos/cosmos-sdk/x/auth/client/rest" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authtx "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting" + "github.com/cosmos/cosmos-sdk/x/bank" + bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/capability" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" + "github.com/cosmos/cosmos-sdk/x/crisis" + 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" + 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" + evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + "github.com/cosmos/cosmos-sdk/x/feegrant" + feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" + "github.com/cosmos/cosmos-sdk/x/genutil" + genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" + "github.com/cosmos/cosmos-sdk/x/gov" + govclient "github.com/cosmos/cosmos-sdk/x/gov/client" + govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/cosmos/cosmos-sdk/x/mint" + mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/cosmos/cosmos-sdk/x/params" + paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" + paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" + paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + "github.com/cosmos/cosmos-sdk/x/slashing" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + "github.com/cosmos/cosmos-sdk/x/staking" + stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/cosmos-sdk/x/upgrade" + upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" + upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/cosmos/ibc-go/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/modules/core" + ibcclient "github.com/cosmos/ibc-go/modules/core/02-client" + ibcporttypes "github.com/cosmos/ibc-go/modules/core/05-port/types" + ibchost "github.com/cosmos/ibc-go/modules/core/24-host" + ibckeeper "github.com/cosmos/ibc-go/modules/core/keeper" + "github.com/spf13/cast" + abci "github.com/tendermint/tendermint/abci/types" + tmjson "github.com/tendermint/tendermint/libs/json" + "github.com/tendermint/tendermint/libs/log" + tmos "github.com/tendermint/tendermint/libs/os" + dbm "github.com/tendermint/tm-db" + + "github.com/tendermint/spm/cosmoscmd" + + paymentmodule "github.com/celestiaorg/celestia-app/x/payment" + paymentmodulekeeper "github.com/celestiaorg/celestia-app/x/payment/keeper" + paymentmoduletypes "github.com/celestiaorg/celestia-app/x/payment/types" + // this line is used by starport scaffolding # stargate/app/moduleImport +) + +const ( + AccountAddressPrefix = "celest" + Name = "celestia-app" +) + +// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals + +func getGovProposalHandlers() []govclient.ProposalHandler { + var govProposalHandlers []govclient.ProposalHandler + // this line is used by starport scaffolding # stargate/app/govProposalHandlers + + govProposalHandlers = append(govProposalHandlers, + paramsclient.ProposalHandler, + distrclient.ProposalHandler, + upgradeclient.ProposalHandler, + upgradeclient.CancelProposalHandler, + // this line is used by starport scaffolding # stargate/app/govProposalHandler + ) + + return govProposalHandlers +} + +var ( + // DefaultNodeHome default home directories for the application daemon + DefaultNodeHome string + + // ModuleBasics defines the module BasicManager is in charge of setting up basic, + // non-dependant module elements, such as codec registration + // and genesis verification. + ModuleBasics = module.NewBasicManager( + auth.AppModuleBasic{}, + genutil.AppModuleBasic{}, + bank.AppModuleBasic{}, + capability.AppModuleBasic{}, + staking.AppModuleBasic{}, + mint.AppModuleBasic{}, + distr.AppModuleBasic{}, + gov.NewAppModuleBasic(getGovProposalHandlers()...), + params.AppModuleBasic{}, + crisis.AppModuleBasic{}, + slashing.AppModuleBasic{}, + feegrantmodule.AppModuleBasic{}, + ibc.AppModuleBasic{}, + upgrade.AppModuleBasic{}, + evidence.AppModuleBasic{}, + transfer.AppModuleBasic{}, + vesting.AppModuleBasic{}, + paymentmodule.AppModuleBasic{}, + // this line is used by starport scaffolding # stargate/app/moduleBasic + ) + + // module account permissions + maccPerms = map[string][]string{ + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + // this line is used by starport scaffolding # stargate/app/maccPerms + } +) + +var ( + _ cosmoscmd.CosmosApp = (*App)(nil) + _ servertypes.Application = (*App)(nil) +) + +func init() { + userHomeDir, err := os.UserHomeDir() + if err != nil { + panic(err) + } + + DefaultNodeHome = filepath.Join(userHomeDir, "."+Name) +} + +// App extends an ABCI application, but with most of its parameters exported. +// They are exported for convenience in creating helper functions, as object +// capabilities aren't needed for testing. +type App struct { + *baseapp.BaseApp + + cdc *codec.LegacyAmino + appCodec codec.Codec + interfaceRegistry types.InterfaceRegistry + txConfig client.TxConfig + + invCheckPeriod uint + + // keys to access the substores + keys map[string]*sdk.KVStoreKey + tkeys map[string]*sdk.TransientStoreKey + memKeys map[string]*sdk.MemoryStoreKey + + // keepers + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + CapabilityKeeper *capabilitykeeper.Keeper + StakingKeeper stakingkeeper.Keeper + SlashingKeeper slashingkeeper.Keeper + MintKeeper mintkeeper.Keeper + DistrKeeper distrkeeper.Keeper + GovKeeper govkeeper.Keeper + CrisisKeeper crisiskeeper.Keeper + UpgradeKeeper upgradekeeper.Keeper + ParamsKeeper paramskeeper.Keeper + IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + EvidenceKeeper evidencekeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + + // make scoped keepers public for test purposes + ScopedIBCKeeper capabilitykeeper.ScopedKeeper + ScopedTransferKeeper capabilitykeeper.ScopedKeeper + + PaymentKeeper paymentmodulekeeper.Keeper + // this line is used by starport scaffolding # stargate/app/keeperDeclaration + + // the module manager + mm *module.Manager +} + +// New returns a reference to an initialized celestia app. +func New( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + loadLatest bool, + skipUpgradeHeights map[int64]bool, + homePath string, + invCheckPeriod uint, + encodingConfig cosmoscmd.EncodingConfig, + appOpts servertypes.AppOptions, + baseAppOptions ...func(*baseapp.BaseApp), +) *App { + appCodec := encodingConfig.Marshaler + cdc := encodingConfig.Amino + interfaceRegistry := encodingConfig.InterfaceRegistry + + bApp := baseapp.NewBaseApp(Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) + bApp.SetCommitMultiStoreTracer(traceStore) + bApp.SetVersion(version.Version) + bApp.SetInterfaceRegistry(interfaceRegistry) + + keys := sdk.NewKVStoreKeys( + authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, + minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, + govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, + evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, + paymentmoduletypes.StoreKey, + // this line is used by starport scaffolding # stargate/app/storeKey + ) + tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + + app := &App{ + BaseApp: bApp, + cdc: cdc, + appCodec: appCodec, + interfaceRegistry: interfaceRegistry, + txConfig: encodingConfig.TxConfig, + invCheckPeriod: invCheckPeriod, + keys: keys, + tkeys: tkeys, + memKeys: memKeys, + } + + app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) + + // set the BaseApp's parameter store + bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable())) + + // add capability keeper and ScopeToModule for ibc module + app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) + + // grant capabilities for the ibc and ibc-transfer modules + scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) + scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + // this line is used by starport scaffolding # stargate/app/scopedKeeper + + // add keepers + app.AccountKeeper = authkeeper.NewAccountKeeper( + appCodec, keys[authtypes.StoreKey], app.GetSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, + ) + app.BankKeeper = bankkeeper.NewBaseKeeper( + appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.ModuleAccountAddrs(), + ) + stakingKeeper := stakingkeeper.NewKeeper( + appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName), + ) + app.MintKeeper = mintkeeper.NewKeeper( + appCodec, keys[minttypes.StoreKey], app.GetSubspace(minttypes.ModuleName), &stakingKeeper, + app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, + ) + app.DistrKeeper = distrkeeper.NewKeeper( + appCodec, keys[distrtypes.StoreKey], app.GetSubspace(distrtypes.ModuleName), app.AccountKeeper, app.BankKeeper, + &stakingKeeper, authtypes.FeeCollectorName, app.ModuleAccountAddrs(), + ) + app.SlashingKeeper = slashingkeeper.NewKeeper( + appCodec, keys[slashingtypes.StoreKey], &stakingKeeper, app.GetSubspace(slashingtypes.ModuleName), + ) + app.CrisisKeeper = crisiskeeper.NewKeeper( + app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, + ) + + app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper) + app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp) + + // register the staking hooks + // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks + app.StakingKeeper = *stakingKeeper.SetHooks( + stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), + ) + + // ... other modules keepers + + // Create IBC Keeper + app.IBCKeeper = ibckeeper.NewKeeper( + appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, + ) + + // register the proposal types + govRouter := govtypes.NewRouter() + govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). + AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). + AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). + AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). + AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) + + // Create Transfer Keepers + app.TransferKeeper = ibctransferkeeper.NewKeeper( + appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), + app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, + ) + transferModule := transfer.NewAppModule(app.TransferKeeper) + + // Create evidence Keeper for to register the IBC light client misbehaviour evidence route + evidenceKeeper := evidencekeeper.NewKeeper( + appCodec, keys[evidencetypes.StoreKey], &app.StakingKeeper, app.SlashingKeeper, + ) + // If evidence needs to be handled for the app, set routes in router here and seal + app.EvidenceKeeper = *evidenceKeeper + + app.GovKeeper = govkeeper.NewKeeper( + appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, + &stakingKeeper, govRouter, + ) + + app.PaymentKeeper = *paymentmodulekeeper.NewKeeper( + appCodec, + app.BankKeeper, + keys[paymentmoduletypes.StoreKey], + keys[paymentmoduletypes.MemStoreKey], + ) + paymentmodule := paymentmodule.NewAppModule(appCodec, app.PaymentKeeper) + + // this line is used by starport scaffolding # stargate/app/keeperDefinition + + // Create static IBC router, add transfer route, then set and seal it + ibcRouter := ibcporttypes.NewRouter() + ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferModule) + // this line is used by starport scaffolding # ibc/app/router + app.IBCKeeper.SetRouter(ibcRouter) + + /**** Module Options ****/ + + // NOTE: we may consider parsing `appOpts` inside module constructors. For the moment + // we prefer to be more strict in what arguments the modules expect. + var skipGenesisInvariants = cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) + + // NOTE: Any module instantiated in the module manager that is later modified + // must be passed by reference here. + + app.mm = module.NewManager( + genutil.NewAppModule( + app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx, + encodingConfig.TxConfig, + ), + auth.NewAppModule(appCodec, app.AccountKeeper, nil), + vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), + bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), + capability.NewAppModule(appCodec, *app.CapabilityKeeper), + feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), + crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), + 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), + staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), + upgrade.NewAppModule(app.UpgradeKeeper), + evidence.NewAppModule(app.EvidenceKeeper), + ibc.NewAppModule(app.IBCKeeper), + params.NewAppModule(app.ParamsKeeper), + transferModule, + paymentmodule, + // this line is used by starport scaffolding # stargate/app/appModule + ) + + // During begin block slashing happens after distr.BeginBlocker so that + // there is nothing left over in the validator fee pool, so as to keep the + // CanWithdrawInvariant invariant. + // NOTE: staking module is required if HistoricalEntries param > 0 + app.mm.SetOrderBeginBlockers( + upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, + evidencetypes.ModuleName, stakingtypes.ModuleName, ibchost.ModuleName, + feegrant.ModuleName, + ) + + app.mm.SetOrderEndBlockers(crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName) + + // NOTE: The genutils module must occur after staking so that pools are + // properly initialized with tokens from genesis accounts. + // NOTE: Capability module must occur first so that it can initialize any capabilities + // so that other modules that want to create or claim capabilities afterwards in InitChain + // can do so safely. + app.mm.SetOrderInitGenesis( + capabilitytypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + govtypes.ModuleName, + minttypes.ModuleName, + crisistypes.ModuleName, + ibchost.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + ibctransfertypes.ModuleName, + paymentmoduletypes.ModuleName, + // this line is used by starport scaffolding # stargate/app/initGenesis + ) + + app.mm.RegisterInvariants(&app.CrisisKeeper) + app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) + app.mm.RegisterServices(module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())) + + // initialize stores + app.MountKVStores(keys) + app.MountTransientStores(tkeys) + app.MountMemoryStores(memKeys) + + // initialize BaseApp + app.SetInitChainer(app.InitChainer) + app.SetBeginBlocker(app.BeginBlocker) + + anteHandler, err := ante.NewAnteHandler( + ante.HandlerOptions{ + AccountKeeper: app.AccountKeeper, + BankKeeper: app.BankKeeper, + SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), + FeegrantKeeper: app.FeeGrantKeeper, + SigGasConsumer: ante.DefaultSigVerificationGasConsumer, + }, + ) + if err != nil { + panic(err) + } + + app.SetAnteHandler(anteHandler) + app.SetEndBlocker(app.EndBlocker) + + if loadLatest { + if err := app.LoadLatestVersion(); err != nil { + tmos.Exit(err.Error()) + } + } + + app.ScopedIBCKeeper = scopedIBCKeeper + app.ScopedTransferKeeper = scopedTransferKeeper + // this line is used by starport scaffolding # stargate/app/beforeInitReturn + + return app +} + +// Name returns the name of the App +func (app *App) Name() string { return app.BaseApp.Name() } + +// BeginBlocker application updates every begin block +func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { + return app.mm.BeginBlock(ctx, req) +} + +// EndBlocker application updates every end block +func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { + return app.mm.EndBlock(ctx, req) +} + +// InitChainer application update at chain initialization +func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { + var genesisState GenesisState + if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { + panic(err) + } + app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) + return app.mm.InitGenesis(ctx, app.appCodec, genesisState) +} + +// LoadHeight loads a particular height +func (app *App) LoadHeight(height int64) error { + return app.LoadVersion(height) +} + +// ModuleAccountAddrs returns all the app's module account addresses. +func (app *App) ModuleAccountAddrs() map[string]bool { + modAccAddrs := make(map[string]bool) + for acc := range maccPerms { + modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true + } + + return modAccAddrs +} + +// LegacyAmino returns SimApp's amino codec. +// +// NOTE: This is solely to be used for testing purposes as it may be desirable +// for modules to register their own custom testing types. +func (app *App) LegacyAmino() *codec.LegacyAmino { + return app.cdc +} + +// AppCodec returns Gaia's app codec. +// +// NOTE: This is solely to be used for testing purposes as it may be desirable +// for modules to register their own custom testing types. +func (app *App) AppCodec() codec.Codec { + return app.appCodec +} + +// InterfaceRegistry returns Gaia's InterfaceRegistry +func (app *App) InterfaceRegistry() types.InterfaceRegistry { + return app.interfaceRegistry +} + +// GetKey returns the KVStoreKey for the provided store key. +// +// NOTE: This is solely to be used for testing purposes. +func (app *App) GetKey(storeKey string) *sdk.KVStoreKey { + return app.keys[storeKey] +} + +// GetTKey returns the TransientStoreKey for the provided store key. +// +// NOTE: This is solely to be used for testing purposes. +func (app *App) GetTKey(storeKey string) *sdk.TransientStoreKey { + return app.tkeys[storeKey] +} + +// GetMemKey returns the MemStoreKey for the provided mem key. +// +// NOTE: This is solely used for testing purposes. +func (app *App) GetMemKey(storeKey string) *sdk.MemoryStoreKey { + return app.memKeys[storeKey] +} + +// GetSubspace returns a param subspace for a given module name. +// +// NOTE: This is solely to be used for testing purposes. +func (app *App) GetSubspace(moduleName string) paramstypes.Subspace { + subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) + return subspace +} + +// RegisterAPIRoutes registers all application module routes with the provided +// API server. +func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { + clientCtx := apiSvr.ClientCtx + rpc.RegisterRoutes(clientCtx, apiSvr.Router) + // Register legacy tx routes. + authrest.RegisterTxRoutes(clientCtx, apiSvr.Router) + // Register new tx routes from grpc-gateway. + authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + // Register new tendermint queries routes from grpc-gateway. + tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + + // Register legacy and grpc-gateway routes for all modules. + ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router) + ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) +} + +// RegisterTxService implements the Application.RegisterTxService method. +func (app *App) RegisterTxService(clientCtx client.Context) { + authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) +} + +// RegisterTendermintService implements the Application.RegisterTendermintService method. +func (app *App) RegisterTendermintService(clientCtx client.Context) { + tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry) +} + +// GetMaccPerms returns a copy of the module account permissions +func GetMaccPerms() map[string][]string { + dupMaccPerms := make(map[string][]string) + for k, v := range maccPerms { + dupMaccPerms[k] = v + } + return dupMaccPerms +} + +// initParamsKeeper init params keeper and its subspaces +func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper { + paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) + + paramsKeeper.Subspace(authtypes.ModuleName) + paramsKeeper.Subspace(banktypes.ModuleName) + paramsKeeper.Subspace(stakingtypes.ModuleName) + paramsKeeper.Subspace(minttypes.ModuleName) + paramsKeeper.Subspace(distrtypes.ModuleName) + paramsKeeper.Subspace(slashingtypes.ModuleName) + paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) + paramsKeeper.Subspace(crisistypes.ModuleName) + paramsKeeper.Subspace(ibctransfertypes.ModuleName) + paramsKeeper.Subspace(ibchost.ModuleName) + paramsKeeper.Subspace(paymentmoduletypes.ModuleName) + // this line is used by starport scaffolding # stargate/app/paramSubspace + + return paramsKeeper +} diff --git a/app/encoding.go b/app/encoding.go new file mode 100644 index 0000000000..4c21f72c83 --- /dev/null +++ b/app/encoding.go @@ -0,0 +1,22 @@ +package app + +import ( + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/tendermint/spm/cosmoscmd" +) + +// RegisterAccountInterface registers the authtypes.AccountI interface to the +// interface registery in the provided encoding config +// todo(evan): check if this is still needed +func RegisterAccountInterface() cosmoscmd.EncodingConfig { + conf := cosmoscmd.MakeEncodingConfig(ModuleBasics) + conf.InterfaceRegistry.RegisterInterface( + "cosmos.auth.v1beta1.BaseAccount", + (*authtypes.AccountI)(nil), + ) + conf.InterfaceRegistry.RegisterImplementations( + (*authtypes.AccountI)(nil), + &authtypes.BaseAccount{}, + ) + return conf +} diff --git a/app/export.go b/app/export.go new file mode 100755 index 0000000000..a744e54964 --- /dev/null +++ b/app/export.go @@ -0,0 +1,185 @@ +package app + +import ( + "encoding/json" + "log" + + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + servertypes "github.com/cosmos/cosmos-sdk/server/types" + sdk "github.com/cosmos/cosmos-sdk/types" + slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" + "github.com/cosmos/cosmos-sdk/x/staking" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// ExportAppStateAndValidators exports the state of the application for a genesis +// file. +func (app *App) ExportAppStateAndValidators( + forZeroHeight bool, jailAllowedAddrs []string, +) (servertypes.ExportedApp, error) { + + // as if they could withdraw from the start of the next block + ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + + // We export at last height + 1, because that's the height at which + // Tendermint will start InitChain. + height := app.LastBlockHeight() + 1 + if forZeroHeight { + height = 0 + app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) + } + + genState := app.mm.ExportGenesis(ctx, app.appCodec) + appState, err := json.MarshalIndent(genState, "", " ") + if err != nil { + return servertypes.ExportedApp{}, err + } + + validators, err := staking.WriteValidators(ctx, app.StakingKeeper) + if err != nil { + return servertypes.ExportedApp{}, err + } + return servertypes.ExportedApp{ + AppState: appState, + Validators: validators, + Height: height, + ConsensusParams: app.BaseApp.GetConsensusParams(ctx), + }, nil +} + +// prepare for fresh start at zero height +// NOTE zero height genesis is a temporary feature which will be deprecated +// in favour of export at a block height +func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { + applyAllowedAddrs := false + + // check if there is a allowed address list + if len(jailAllowedAddrs) > 0 { + applyAllowedAddrs = true + } + + allowedAddrsMap := make(map[string]bool) + + for _, addr := range jailAllowedAddrs { + _, err := sdk.ValAddressFromBech32(addr) + if err != nil { + log.Fatal(err) + } + allowedAddrsMap[addr] = true + } + + /* Just to be safe, assert the invariants on current state. */ + app.CrisisKeeper.AssertInvariants(ctx) + + /* Handle fee distribution state. */ + + // withdraw all validator commission + app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + _, err := app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) + if err != nil { + panic(err) + } + return false + }) + + // withdraw all delegator rewards + dels := app.StakingKeeper.GetAllDelegations(ctx) + for _, delegation := range dels { + _, err := app.DistrKeeper.WithdrawDelegationRewards(ctx, delegation.GetDelegatorAddr(), delegation.GetValidatorAddr()) + if err != nil { + panic(err) + } + } + + // clear validator slash events + app.DistrKeeper.DeleteAllValidatorSlashEvents(ctx) + + // clear validator historical rewards + app.DistrKeeper.DeleteAllValidatorHistoricalRewards(ctx) + + // set context height to zero + height := ctx.BlockHeight() + ctx = ctx.WithBlockHeight(0) + + // reinitialize all validators + app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + // donate any unwithdrawn outstanding reward fraction tokens to the community pool + scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) + feePool := app.DistrKeeper.GetFeePool(ctx) + feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) + app.DistrKeeper.SetFeePool(ctx, feePool) + + app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + return false + }) + + // reinitialize all delegations + for _, del := range dels { + app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) + app.DistrKeeper.Hooks().AfterDelegationModified(ctx, del.GetDelegatorAddr(), del.GetValidatorAddr()) + } + + // reset context height + ctx = ctx.WithBlockHeight(height) + + /* Handle staking state. */ + + // iterate through redelegations, reset creation height + app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { + for i := range red.Entries { + red.Entries[i].CreationHeight = 0 + } + app.StakingKeeper.SetRedelegation(ctx, red) + return false + }) + + // iterate through unbonding delegations, reset creation height + app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { + for i := range ubd.Entries { + ubd.Entries[i].CreationHeight = 0 + } + app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + return false + }) + + // Iterate through validators by power descending, reset bond heights, and + // update bond intra-tx counters. + store := ctx.KVStore(app.keys[stakingtypes.StoreKey]) + iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + counter := int16(0) + + for ; iter.Valid(); iter.Next() { + addr := sdk.ValAddress(iter.Key()[1:]) + validator, found := app.StakingKeeper.GetValidator(ctx, addr) + if !found { + panic("expected validator, not found") + } + + validator.UnbondingHeight = 0 + if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { + validator.Jailed = true + } + + app.StakingKeeper.SetValidator(ctx, validator) + counter++ + } + + iter.Close() + + if _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx); err != nil { + panic(err) + } + + /* Handle slashing state. */ + + // reset start height on signing infos + app.SlashingKeeper.IterateValidatorSigningInfos( + ctx, + func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { + info.StartHeight = 0 + app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) + return false + }, + ) +} diff --git a/app/genesis.go b/app/genesis.go new file mode 100755 index 0000000000..5bf0c1da80 --- /dev/null +++ b/app/genesis.go @@ -0,0 +1,21 @@ +package app + +import ( + "encoding/json" + + "github.com/cosmos/cosmos-sdk/codec" +) + +// The genesis state of the blockchain is represented here as a map of raw json +// messages key'd by a identifier string. +// The identifier is used to determine which module genesis information belongs +// to so it may be appropriately routed during init chain. +// Within this application default genesis information is retrieved from +// the ModuleBasicManager which populates json from each BasicModule +// object provided to it during init. +type GenesisState map[string]json.RawMessage + +// NewDefaultGenesisState generates the default state for the application. +func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState { + return ModuleBasics.DefaultGenesis(cdc) +} From 62eb22f90d1ca2704a113681e2ebffdb4ee4b83b Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:35:47 -0500 Subject: [PATCH 04/17] use cosmoscmd instead of copying everything over --- cmd/celestia-appd/main.go | 58 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 cmd/celestia-appd/main.go diff --git a/cmd/celestia-appd/main.go b/cmd/celestia-appd/main.go new file mode 100755 index 0000000000..4a306a755b --- /dev/null +++ b/cmd/celestia-appd/main.go @@ -0,0 +1,58 @@ +package main + +import ( + "io" + "os" + + "github.com/celestiaorg/celestia-app/app" + "github.com/cosmos/cosmos-sdk/baseapp" + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/tendermint/spm/cosmoscmd" + "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" +) + +func main() { + rootCmd, _ := cosmoscmd.NewRootCmd( + app.Name, + app.AccountAddressPrefix, + app.DefaultNodeHome, + app.Name, + app.ModuleBasics, + appBuilder, + // this line is used by starport scaffolding # root/arguments + ) + if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil { + os.Exit(1) + } +} + +// appBuilder wraps the app.New func to return a cosmoscmd.App interface instead +// of the raw app.App. The New func has to return a raw app.App, because we need +// to call PreprocessTxs +func appBuilder( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + loadLatest bool, + skipUpgradeHeights map[int64]bool, + homePath string, + invCheckPeriod uint, + encodingConfig cosmoscmd.EncodingConfig, + appOpts servertypes.AppOptions, + baseAppOptions ...func(*baseapp.BaseApp), +) cosmoscmd.App { + return app.New( + logger, + db, + traceStore, + loadLatest, + skipUpgradeHeights, + homePath, + invCheckPeriod, + encodingConfig, + appOpts, + baseAppOptions..., + ) +} From f7ae201f4b11923654152f33e2e9c13075f660ec Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:37:04 -0500 Subject: [PATCH 05/17] regenerate and adjust module boilerplate --- x/payment/genesis.go | 22 ++++ x/payment/genesis_test.go | 14 +++ x/payment/handler.go | 27 +++++ x/payment/keeper/grpc_query.go | 7 ++ x/payment/keeper/keeper.go | 56 ++++++++++ x/payment/keeper/msg_server.go | 25 +++++ x/payment/keeper/msg_server_test.go | 6 + x/payment/module.go | 167 ++++++++++++++++++++++++++++ 8 files changed, 324 insertions(+) create mode 100755 x/payment/genesis.go create mode 100755 x/payment/genesis_test.go create mode 100755 x/payment/handler.go create mode 100755 x/payment/keeper/grpc_query.go create mode 100755 x/payment/keeper/keeper.go create mode 100755 x/payment/keeper/msg_server.go create mode 100755 x/payment/keeper/msg_server_test.go create mode 100755 x/payment/module.go diff --git a/x/payment/genesis.go b/x/payment/genesis.go new file mode 100755 index 0000000000..9bc2051cf6 --- /dev/null +++ b/x/payment/genesis.go @@ -0,0 +1,22 @@ +package payment + +import ( + "github.com/celestiaorg/celestia-app/x/payment/keeper" + "github.com/celestiaorg/celestia-app/x/payment/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the capability module's state from a provided genesis +// state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { + // this line is used by starport scaffolding # genesis/module/init +} + +// ExportGenesis returns the capability module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/payment/genesis_test.go b/x/payment/genesis_test.go new file mode 100755 index 0000000000..bd51eb9939 --- /dev/null +++ b/x/payment/genesis_test.go @@ -0,0 +1,14 @@ +package payment_test + +// func TestGenesis(t *testing.T) { +// genesisState := types.GenesisState{ +// // this line is used by starport scaffolding # genesis/test/state +// } + +// k, ctx := keepertest.PaymentKeeper(t) +// payment.InitGenesis(ctx, *k, genesisState) +// got := payment.ExportGenesis(ctx, *k) +// require.NotNil(t, got) + +// // this line is used by starport scaffolding # genesis/test/assert +// } diff --git a/x/payment/handler.go b/x/payment/handler.go new file mode 100755 index 0000000000..77dbf8e6ea --- /dev/null +++ b/x/payment/handler.go @@ -0,0 +1,27 @@ +package payment + +import ( + "fmt" + + "github.com/celestiaorg/celestia-app/x/payment/keeper" + "github.com/celestiaorg/celestia-app/x/payment/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// NewHandler uses the provided payment keeper to create an sdk.Handler +func NewHandler(k keeper.Keeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) + switch msg := msg.(type) { + case *types.SignedTransactionDataPayForMessage: + res, err := msgServer.SignedTransactionDataPayForMessage(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + default: + errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + } + } +} diff --git a/x/payment/keeper/grpc_query.go b/x/payment/keeper/grpc_query.go new file mode 100755 index 0000000000..f5e93a4906 --- /dev/null +++ b/x/payment/keeper/grpc_query.go @@ -0,0 +1,7 @@ +package keeper + +import ( + "github.com/celestiaorg/celestia-app/x/payment/types" +) + +var _ types.QueryServer = Keeper{} diff --git a/x/payment/keeper/keeper.go b/x/payment/keeper/keeper.go new file mode 100755 index 0000000000..8e0a858429 --- /dev/null +++ b/x/payment/keeper/keeper.go @@ -0,0 +1,56 @@ +package keeper + +import ( + "context" + "fmt" + + "github.com/tendermint/tendermint/libs/log" + + "github.com/celestiaorg/celestia-app/x/payment/types" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// todo(evan): move these somewhere else +const ( + TokenDenomination = "token" +) + +// Keeper handles all the state changes for the celestia-app module. +type Keeper struct { + cdc codec.BinaryCodec + storeKey sdk.StoreKey + memKey sdk.StoreKey + bank BankKeeper +} + +func NewKeeper(cdc codec.BinaryCodec, bank BankKeeper, storeKey, memKey sdk.StoreKey) *Keeper { + return &Keeper{ + cdc: cdc, + storeKey: storeKey, + memKey: memKey, + bank: bank, + } +} + +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + +// PayForMessage moves a user's coins to the module address and burns them. +func (k Keeper) PayForMessage(goCtx context.Context, msg *types.MsgWirePayForMessage) (*types.MsgPayForMessageResponse, error) { + // don't pay for fees for the first version + return &types.MsgPayForMessageResponse{}, nil +} + +// SignedTransactionDataPayForMessage moves a user's coins to the module address and burns them. +func (k Keeper) SignedTransactionDataPayForMessage(goCtx context.Context, msg *types.SignedTransactionDataPayForMessage) (*types.SignedTransactionDataPayForMessageResponse, error) { + // don't pay for fees for the first version + return &types.SignedTransactionDataPayForMessageResponse{}, nil +} + +// BankKeeper restricts the funtionality of the bank keeper used in the payment keeper +type BankKeeper interface { + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error +} diff --git a/x/payment/keeper/msg_server.go b/x/payment/keeper/msg_server.go new file mode 100755 index 0000000000..c4ca6b51bc --- /dev/null +++ b/x/payment/keeper/msg_server.go @@ -0,0 +1,25 @@ +package keeper + +import ( + "context" + + "github.com/celestiaorg/celestia-app/x/payment/types" +) + +var _ types.MsgServer = msgServer{} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // PayForMessage allows the user to post data to made be available. + SignedTransactionDataPayForMessage(context.Context, *types.SignedTransactionDataPayForMessage) (*types.SignedTransactionDataPayForMessageResponse, error) +} + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the payment MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) MsgServer { + return &msgServer{Keeper: keeper} +} diff --git a/x/payment/keeper/msg_server_test.go b/x/payment/keeper/msg_server_test.go new file mode 100755 index 0000000000..035d477956 --- /dev/null +++ b/x/payment/keeper/msg_server_test.go @@ -0,0 +1,6 @@ +package keeper_test + +// func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { +// k, ctx := keepertest.PaymentKeeper(t) +// return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) +// } diff --git a/x/payment/module.go b/x/payment/module.go new file mode 100755 index 0000000000..74159e3f44 --- /dev/null +++ b/x/payment/module.go @@ -0,0 +1,167 @@ +package payment + +import ( + "encoding/json" + "fmt" + + // this line is used by starport scaffolding # 1 + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/celestiaorg/celestia-app/x/payment/client/cli" + "github.com/celestiaorg/celestia-app/x/payment/keeper" + "github.com/celestiaorg/celestia-app/x/payment/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" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface for the capability module. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the capability module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the capability module's default genesis state. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the capability module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterRESTRoutes registers the capability module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + // this line is used by starport scaffolding # 2 +} + +// GetTxCmd returns the capability module's root tx command. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the capability module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the capability module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper +} + +func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + } +} + +// Name returns the capability module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// Route returns the capability module's message routing key. +func (am AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) +} + +// QuerierRoute returns the capability module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// LegacyQuerierHandler returns the capability module's Querier. +func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { + return nil +} + +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the capability module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the capability module's genesis initialization It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion implements ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 2 } + +// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock executes all ABCI EndBlock logic respective to the capability module. It +// returns no validator updates. +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} From e7556f7f2ed649f468fe7c83df88ed0cabd7bcbf Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:37:34 -0500 Subject: [PATCH 06/17] copy over and adjust client code --- x/payment/client/builder.go | 187 ++++++++++++++++++ x/payment/client/builder_test.go | 141 +++++++++++++ x/payment/client/cli/query.go | 30 +++ x/payment/client/cli/tx.go | 36 ++++ .../client/cli/tx_wire_pay_for_message.go | 83 ++++++++ 5 files changed, 477 insertions(+) create mode 100644 x/payment/client/builder.go create mode 100644 x/payment/client/builder_test.go create mode 100755 x/payment/client/cli/query.go create mode 100755 x/payment/client/cli/tx.go create mode 100755 x/payment/client/cli/tx_wire_pay_for_message.go diff --git a/x/payment/client/builder.go b/x/payment/client/builder.go new file mode 100644 index 0000000000..7a9e9c55b7 --- /dev/null +++ b/x/payment/client/builder.go @@ -0,0 +1,187 @@ +package client + +import ( + "context" + + "github.com/celestiaorg/celestia-app/app" + sdkclient "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + sdktypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/tendermint/spm/cosmoscmd" + "google.golang.org/grpc" +) + +// KeyringSigner uses a keyring to sign and build celestia-app transactions +type KeyringSigner struct { + keyring.Keyring + keyringAccName string + accountNumber uint64 + sequence uint64 + chainID string + encCfg cosmoscmd.EncodingConfig +} + +// NewKeyringSigner returns a new KeyringSigner using the provided keyring +func NewKeyringSigner(ring keyring.Keyring, name string, chainID string) *KeyringSigner { + return &KeyringSigner{ + Keyring: ring, + keyringAccName: name, + chainID: chainID, + encCfg: app.RegisterAccountInterface(), + } +} + +// QueryAccountNumber queries the applicaiton to find the latest account number and +// sequence, updating the respective internal fields. The internal account number must +// be set by this method or by manually calling k.SetAccountNumber in order for any built +// transactions to be valide +func (k *KeyringSigner) QueryAccountNumber(ctx context.Context, conn *grpc.ClientConn) error { + info, err := k.Key(k.keyringAccName) + if err != nil { + return err + } + + accNum, seqNumb, err := QueryAccount(ctx, conn, k.encCfg, info.GetAddress().String()) + if err != nil { + return err + } + k.accountNumber = accNum + k.sequence = seqNumb + return nil +} + +// NewTxBuilder returns the default sdk Tx builder using the celestia-app encoding config +func (k KeyringSigner) NewTxBuilder() sdkclient.TxBuilder { + return k.encCfg.TxConfig.NewTxBuilder() +} + +// BuildSignedTx creates and signs a sdk.Tx that contains the provided message. The interal +// account number must be set by calling k.QueryAccountNumber or by manually setting it via +// k.SetAccountNumber for the built transactions to be valid. +func (k KeyringSigner) BuildSignedTx(builder sdkclient.TxBuilder, msg sdktypes.Msg) (authsigning.Tx, error) { + // set the msg + err := builder.SetMsgs(msg) + if err != nil { + return nil, err + } + + // lookup account info + keyInfo, err := k.Key(k.keyringAccName) + if err != nil { + return nil, err + } + + // we must first set an empty signature in order generate + // the correct sign bytes + sigV2 := signing.SignatureV2{ + PubKey: keyInfo.GetPubKey(), + Data: &signing.SingleSignatureData{ + SignMode: signing.SignMode_SIGN_MODE_DIRECT, + Signature: nil, + }, + Sequence: k.sequence, + } + + // set the empty signature + err = builder.SetSignatures(sigV2) + if err != nil { + return nil, err + } + + // Generate the bytes to be signed. + bytesToSign, err := k.encCfg.TxConfig.SignModeHandler().GetSignBytes( + signing.SignMode_SIGN_MODE_DIRECT, + authsigning.SignerData{ + ChainID: k.chainID, + AccountNumber: k.accountNumber, + Sequence: k.sequence, + }, + builder.GetTx(), + ) + if err != nil { + return nil, err + } + + // Sign those bytes using the keyring. we are ignoring the returned public key + sigBytes, _, err := k.SignByAddress(keyInfo.GetAddress(), bytesToSign) + if err != nil { + return nil, err + } + + // Construct the SignatureV2 struct, this time including a real signature + sigV2 = signing.SignatureV2{ + PubKey: keyInfo.GetPubKey(), + Data: &signing.SingleSignatureData{ + SignMode: signing.SignMode_SIGN_MODE_DIRECT, + Signature: sigBytes, + }, + Sequence: k.sequence, + } + + // set the final signature + err = builder.SetSignatures(sigV2) + if err != nil { + return nil, err + } + + // return the signed transaction + return builder.GetTx(), nil +} + +// SetAccountNumber manually sets the underlying account number +func (k *KeyringSigner) SetAccountNumber(n uint64) { + k.accountNumber = n +} + +// SetSequence manually sets the underlying sequence number +func (k *KeyringSigner) SetSequence(n uint64) { + k.sequence = n +} + +// SetKeyringAccName manually sets the underlying keyring account name +func (k *KeyringSigner) SetKeyringAccName(name string) { + k.keyringAccName = name +} + +// EncodeTx uses the keyring signer's encoding config to encode the provided sdk transaction +func (k KeyringSigner) EncodeTx(tx sdktypes.Tx) ([]byte, error) { + return k.encCfg.TxConfig.TxEncoder()(tx) +} + +// BroadcastTx uses the provided grpc connection to broadcast a signed and encoded transaction +func BroadcastTx(ctx context.Context, conn *grpc.ClientConn, mode tx.BroadcastMode, txBytes []byte) (*tx.BroadcastTxResponse, error) { + txClient := tx.NewServiceClient(conn) + + return txClient.BroadcastTx( + ctx, + &tx.BroadcastTxRequest{ + Mode: mode, + TxBytes: txBytes, + }, + ) +} + +// QueryAccount fetches the account number and sequence number from the celestia-app node. +func QueryAccount(ctx context.Context, conn *grpc.ClientConn, encCfg cosmoscmd.EncodingConfig, address string) (accNum uint64, seqNum uint64, err error) { + qclient := authtypes.NewQueryClient(conn) + resp, err := qclient.Account( + ctx, + &authtypes.QueryAccountRequest{Address: address}, + ) + if err != nil { + return accNum, seqNum, err + } + + var acc authtypes.AccountI + err = encCfg.InterfaceRegistry.UnpackAny(resp.Account, &acc) + if err != nil { + return accNum, seqNum, err + } + + accNum, seqNum = acc.GetAccountNumber(), acc.GetSequence() + return +} diff --git a/x/payment/client/builder_test.go b/x/payment/client/builder_test.go new file mode 100644 index 0000000000..19761ef748 --- /dev/null +++ b/x/payment/client/builder_test.go @@ -0,0 +1,141 @@ +package client + +import ( + "context" + "fmt" + "testing" + + "github.com/celestiaorg/celestia-app/x/payment/types" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + sdktypes "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + "github.com/stretchr/testify/require" + "google.golang.org/grpc" +) + +func TestBuildSignedPayForMessage(t *testing.T) { + testRing := generateKeyring(t) + + info, err := testRing.Key(testAccName) + require.NoError(t, err) + + k := NewKeyringSigner(testRing, testAccName, "chain-id") + require.NoError(t, err) + + namespace := []byte{1, 1, 1, 1, 1, 1, 1, 1} + message := []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0} + + msg, err := types.NewMsgWirePayForMessage( + namespace, + message, + info.GetPubKey().Bytes(), + &types.TransactionFee{}, + 4, 16, 32, + ) + require.NoError(t, err) + + signedTx, err := k.BuildSignedTx(k.NewTxBuilder(), msg) + require.NoError(t, err) + + sigs, err := signedTx.GetSignaturesV2() + require.NoError(t, err) + + signerData := authsigning.SignerData{ + ChainID: k.chainID, + AccountNumber: k.accountNumber, + Sequence: k.sequence, + } + + err = authsigning.VerifySignature(info.GetPubKey(), signerData, sigs[0].Data, k.encCfg.TxConfig.SignModeHandler(), signedTx) + require.NoError(t, err) +} + +func TestBroadcastPayForMessage(t *testing.T) { + testRing := generateKeyring(t) + info, err := testRing.Key(testAccName) + require.NoError(t, err) + t.Skip(fmt.Sprintf("no local connection to app and no funds in wallet %s", info.GetAddress())) + + k := NewKeyringSigner(testRing, testAccName, "test") + + RPCAddress := "127.0.0.1:9090" + + rpcClient, err := grpc.Dial(RPCAddress, grpc.WithInsecure()) + require.NoError(t, err) + err = k.QueryAccountNumber(context.TODO(), rpcClient) + require.NoError(t, err) + + builder := k.NewTxBuilder() + + builder.SetGasLimit(100000) + + coin := sdktypes.Coin{ + Denom: "token", + Amount: sdktypes.NewInt(10), + } + builder.SetFeeAmount(sdktypes.NewCoins(coin)) + + namespace := []byte{1, 1, 1, 1, 1, 1, 1, 1} + message := []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0} + + msg, err := types.NewMsgWirePayForMessage( + namespace, + message, + info.GetPubKey().Bytes(), + &types.TransactionFee{}, + 4, 16, 32, + ) + require.NoError(t, err) + + signedTx, err := k.BuildSignedTx(builder, msg) + require.NoError(t, err) + + encodedTx, err := k.EncodeTx(signedTx) + require.NoError(t, err) + + resp, err := BroadcastTx(context.TODO(), rpcClient, tx.BroadcastMode_BROADCAST_MODE_BLOCK, encodedTx) + require.NoError(t, err) + + require.Equal(t, "", resp.TxResponse.Data) +} + +func TestQueryAccountNumber(t *testing.T) { + t.Skip("no local connection to app and no funds in wallet") + testRing := generateKeyring(t) + + k := NewKeyringSigner(testRing, testAccName, "test") + + RPCAddress := "127.0.0.1:9090" + + rpcClient, err := grpc.Dial(RPCAddress, grpc.WithInsecure()) + require.NoError(t, err) + err = k.QueryAccountNumber(context.TODO(), rpcClient) + require.NoError(t, err) +} + +func generateKeyring(t *testing.T, accts ...string) keyring.Keyring { + t.Helper() + kb := keyring.NewInMemory() + + for _, acc := range accts { + _, _, err := kb.NewMnemonic(acc, keyring.English, "", "", hd.Secp256k1) + if err != nil { + t.Error(err) + } + } + + _, err := kb.NewAccount(testAccName, testMnemo, "1234", "", hd.Secp256k1) + if err != nil { + panic(err) + } + + return kb +} + +const ( + // nolint:lll + testMnemo = `ramp soldier connect gadget domain mutual staff unusual first midnight iron good deputy wage vehicle mutual spike unlock rocket delay hundred script tumble choose` + testAccName = "test-account" +) diff --git a/x/payment/client/cli/query.go b/x/payment/client/cli/query.go new file mode 100755 index 0000000000..153a50ba85 --- /dev/null +++ b/x/payment/client/cli/query.go @@ -0,0 +1,30 @@ +package cli + +import ( + "fmt" + // "strings" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + // sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/celestiaorg/celestia-app/x/payment/types" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group payment queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + // this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/payment/client/cli/tx.go b/x/payment/client/cli/tx.go new file mode 100755 index 0000000000..cded108af3 --- /dev/null +++ b/x/payment/client/cli/tx.go @@ -0,0 +1,36 @@ +package cli + +import ( + "fmt" + "time" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + // "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/celestiaorg/celestia-app/x/payment/types" +) + +var ( + DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) +) + +const ( + flagPacketTimeoutTimestamp = "packet-timeout-timestamp" +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(CmdWirePayForMessage()) +// this line is used by starport scaffolding # 1 + + return cmd +} diff --git a/x/payment/client/cli/tx_wire_pay_for_message.go b/x/payment/client/cli/tx_wire_pay_for_message.go new file mode 100755 index 0000000000..1bc62bc5df --- /dev/null +++ b/x/payment/client/cli/tx_wire_pay_for_message.go @@ -0,0 +1,83 @@ +package cli + +import ( + "encoding/hex" + "errors" + "fmt" + "strconv" + + "github.com/spf13/cobra" + + "github.com/celestiaorg/celestia-app/x/payment/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" +) + +var _ = strconv.Itoa(0) + +func CmdWirePayForMessage() *cobra.Command { + cmd := &cobra.Command{ + Use: "payForMessage [hexNamespace] [hexMessage]", + Short: "Creates a new WirePayForMessage", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + // get the account name + accName := clientCtx.GetFromName() + if accName == "" { + return errors.New("no account name provided, please use the --from flag") + } + + // get info on the key + keyInfo, err := clientCtx.Keyring.Key(accName) + if err != nil { + return err + } + + // decode the namespace + namespace, err := hex.DecodeString(args[0]) + if err != nil { + return fmt.Errorf("failure to decode hex namespace: %w", err) + } + + // decode the message + message, err := hex.DecodeString(args[1]) + if err != nil { + return fmt.Errorf("failure to decode hex message: %w", err) + } + + // create the PayForMessage + pfmMsg, err := types.NewMsgWirePayForMessage( + namespace, + message, + keyInfo.GetPubKey().Bytes(), + &types.TransactionFee{}, // transaction fee is not yet used + types.SquareSize, + ) + if err != nil { + return err + } + + // sign the PayForMessage's ShareCommitments + err = pfmMsg.SignShareCommitments(accName, clientCtx.Keyring) + if err != nil { + return err + } + + // run message checks + if err = pfmMsg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), pfmMsg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} From 0e77e384f273a41a8675802c86f0daf937fdfd8d Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:38:36 -0500 Subject: [PATCH 07/17] copy over and adjust core WirePayForMessage along with SignedTransactionDataPayForMessage --- go.mod | 33 ++- go.sum | 362 +++++++++++++++----------- x/payment/types/codec.go | 29 +++ x/payment/types/errors.go | 12 + x/payment/types/expected_keepers.go | 1 + x/payment/types/genesis.go | 23 ++ x/payment/types/genesis_test.go | 39 +++ x/payment/types/keys.go | 22 ++ x/payment/types/payformessage.go | 356 +++++++++++++++++++++++++ x/payment/types/payformessage_test.go | 336 ++++++++++++++++++++++++ x/payment/types/types.go | 1 + 11 files changed, 1052 insertions(+), 162 deletions(-) create mode 100755 x/payment/types/codec.go create mode 100755 x/payment/types/errors.go create mode 100755 x/payment/types/expected_keepers.go create mode 100755 x/payment/types/genesis.go create mode 100755 x/payment/types/genesis_test.go create mode 100755 x/payment/types/keys.go create mode 100644 x/payment/types/payformessage.go create mode 100644 x/payment/types/payformessage_test.go create mode 100755 x/payment/types/types.go diff --git a/go.mod b/go.mod index 833c1afb64..ff98ec8d5e 100644 --- a/go.mod +++ b/go.mod @@ -1,31 +1,30 @@ module github.com/celestiaorg/celestia-app -go 1.15 +go 1.16 require ( - github.com/celestiaorg/celestia-core v0.0.1-mvp-das-lightclient.0.20210831143948-ceaf5e5c3eec - github.com/celestiaorg/nmt v0.6.0 - github.com/cosmos/cosmos-sdk v0.40.0-rc5 - github.com/gogo/protobuf v1.3.2 + github.com/celestiaorg/nmt v0.7.0 + github.com/cosmos/cosmos-sdk v0.44.0 + github.com/cosmos/ibc-go v1.2.0 + github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.2 - github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3 // indirect + github.com/google/go-cmp v0.5.6 // indirect github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/pelletier/go-toml v1.9.3 - github.com/regen-network/cosmos-proto v0.3.1 - github.com/rs/zerolog v1.23.0 github.com/spf13/cast v1.3.1 - github.com/spf13/cobra v1.2.1 - github.com/spf13/pflag v1.0.5 + github.com/spf13/cobra v1.1.3 github.com/stretchr/testify v1.7.0 - github.com/tendermint/tm-db v0.6.3 - golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect - google.golang.org/genproto v0.0.0-20210830153122-0bac4d21c8ea + github.com/tendermint/spm v0.1.5 + github.com/tendermint/tendermint v0.34.13 + github.com/tendermint/tm-db v0.6.4 + google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 google.golang.org/grpc v1.40.0 - ) replace ( - github.com/cosmos/cosmos-sdk v0.40.0-rc5 => github.com/celestiaorg/cosmos-sdk v0.40.0-rc5.0.20210831150455-4a354186ed7a - github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alpha.regen.4 + github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 + github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v0.40.0-rc5.0.20210929155038-f1d7264b323c + github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + github.com/tendermint/tendermint v0.34.13 => github.com/celestiaorg/celestia-core v0.34.12-tendermint-base + google.golang.org/grpc => google.golang.org/grpc v1.33.2 ) diff --git a/go.sum b/go.sum index eca6768bc6..aa9ecb7dda 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 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.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= @@ -37,10 +36,21 @@ 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= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-alpha.2 h1:EWbZLqGEPSIj2W69gx04KtNVkyPIfe3uj0DhDQJonbQ= -filippo.io/edwards25519 v1.0.0-alpha.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= -github.com/99designs/keyring v1.1.6 h1:kVDC2uCgVwecxCk+9zoCt2uEL6dt+dfVzMvGgnVcIuM= -github.com/99designs/keyring v1.1.6/go.mod h1:16e0ds7LGQQcT59QqkTg72Hh5ShM51Byv5PEmW6uoRU= +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= +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-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= @@ -54,9 +64,13 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= 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 h1:PLSK6pwn8mYdaoaCZEMsXBpBotr4HHn9abU0yMQt0NI= github.com/Workiva/go-datastructures v1.0.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= +github.com/Zilliqa/gozilliqa-sdk v1.2.1-0.20201201074141-dd0ecada1be6/go.mod h1:eSYp2T6f0apnuW8TzhV3f6Aff2SE8Dwio++U4ha4yEM= 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/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -64,17 +78,20 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= 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= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.3.6 h1:x/tmtOF9cDBoXH7XoAGOz2qqm1DknFD1590XmD/DUJ8= -github.com/armon/go-metrics v0.3.6/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-metrics v0.3.9 h1:O2sNqxBdvq8Eq5xmzljcYzAORli6RWCvEym4cJf9m18= +github.com/armon/go-metrics v0.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -85,13 +102,16 @@ github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= +github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= +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.22.0-beta h1:LTDpDKUM5EeOFBPM8IXpinEcmZ6FWfNZbE3lfrfdnWo= github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= 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= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= @@ -104,20 +124,21 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/celestiaorg/celestia-core v0.0.1-mvp-das-lightclient.0.20210831143948-ceaf5e5c3eec h1:FRa3UTfxQWEHlXewbn43IyDsfr34FGNR9wkrd6ph1Jc= -github.com/celestiaorg/celestia-core v0.0.1-mvp-das-lightclient.0.20210831143948-ceaf5e5c3eec/go.mod h1:q0dlLrBebyylQK1LlEQxl33JpjNzrQlyNH8g52Jm1Uo= -github.com/celestiaorg/cosmos-sdk v0.40.0-rc5.0.20210831150455-4a354186ed7a h1:l92Eqhkn/WCUwvaBxPlaFmeOdfJ0+uEkED0Qxh2uTPE= -github.com/celestiaorg/cosmos-sdk v0.40.0-rc5.0.20210831150455-4a354186ed7a/go.mod h1:ZU/2LFdOtrAfcK8JLboHWZWUGPoNaGhkEB/4qHoLzyk= +github.com/celestiaorg/celestia-core v0.34.12-tendermint-base h1:BbsGOuX2F6V5wOGc3z1vtCYvGzfRUicCA71p5GMddjo= +github.com/celestiaorg/celestia-core v0.34.12-tendermint-base/go.mod h1:D2KttOyf7W8ICTTd9pIotJRQ04Cqi0MA7S8ZpLqK4Wk= +github.com/celestiaorg/cosmos-sdk v0.40.0-rc5.0.20210929155038-f1d7264b323c h1:BWgI5mWznKoo6jBMJcL7U0/yGrWJUIKM4VdKm1FmvdU= +github.com/celestiaorg/cosmos-sdk v0.40.0-rc5.0.20210929155038-f1d7264b323c/go.mod h1:rnuMUNznGfdExz+9+s5lSTeBM4lCZAYB6vXxPtlX4QQ= github.com/celestiaorg/go-leopard v0.1.0 h1:28z2EkvKJIez5J9CEaiiUEC+OxalRLtTGJJ1oScfE1g= github.com/celestiaorg/go-leopard v0.1.0/go.mod h1:NtO/rjlB8dw2aq7jr06vZFKGvryQcTDXaNHelmPNOAM= github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 h1:CJdIpo8n5MFP2MwK0gSRcOVlDlFdQJO1p+FqdxYzmvc= github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4/go.mod h1:fzuHnhzj1pUygGz+1ZkB3uQbEUL4htqCGJ4Qs2LwMZA= -github.com/celestiaorg/nmt v0.6.0 h1:8nXHAL+bKiCTmUwvAUO2ahvCHAIBbVbfqNJh5wTlkLY= -github.com/celestiaorg/nmt v0.6.0/go.mod h1:3bqzTj8xKj0DgQUpOgZzoxvtNkC3MS/hTbQ6dn8SIa0= +github.com/celestiaorg/nmt v0.7.0 h1:XRYh7F7TH6ewD3Gybk1L1zjyvgkWPt1iGqWtbMtB2Lk= +github.com/celestiaorg/nmt v0.7.0/go.mod h1:3bqzTj8xKj0DgQUpOgZzoxvtNkC3MS/hTbQ6dn8SIa0= github.com/celestiaorg/rsmt2d v0.3.0 h1:c82dh9J3DBcIQu9OND+5HViUKb5NmpKYVvf8z3zjlfA= github.com/celestiaorg/rsmt2d v0.3.0/go.mod h1:2Frw4GEYUnVu6Mvlo+CUzuC2/8wn+zLwVVtp+muN6vg= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= 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= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= @@ -128,16 +149,16 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn 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/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 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/rosetta-sdk-go v0.6.10 h1:rgHD/nHjxLh0lMEdfGDqpTtlvtSBwULqrrZ2qPdNaCM= +github.com/coinbase/rosetta-sdk-go v0.6.10/go.mod h1:J/JFMsfcePrjJZkwQFLh+hJErkAmdm9Iyy3D5Y0LfXo= github.com/confio/ics23/go v0.0.0-20200817220745-f173e6211efb/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= -github.com/confio/ics23/go v0.6.3 h1:PuGK2V1NJWZ8sSkNDq91jgT/cahFEW9RGp4Y5jxulf0= github.com/confio/ics23/go v0.6.3/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= +github.com/confio/ics23/go v0.6.6 h1:pkOy18YxxJ/r0XFDCnrl4Bjv6h4LkBSpLS6F38mrKL8= +github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -149,14 +170,18 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cosiner/argv v0.1.0/go.mod h1:EusR6TucWKX+zFgtdUsKT2Cvg45K5rtpCcWz4hK06d8= 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= github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE= github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I= -github.com/cosmos/iavl v0.15.3 h1:xE9r6HW8GeKeoYJN4zefpljZ1oukVScP/7M8oj6SUts= github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= +github.com/cosmos/iavl v0.16.0 h1:ICIOB8xysirTX27GmVAaoeSpeozzgSu9d49w36xkVJA= +github.com/cosmos/iavl v0.16.0/go.mod h1:2A8O/Jz9YwtjqXMO0CjnnbTYEEaovE8jWcwrakH3PoE= +github.com/cosmos/ibc-go v1.2.0 h1:0RgxmKzCzIH9SwDp4ckL5VrzlO1KJ5hO0AsOAzOiWE4= +github.com/cosmos/ibc-go v1.2.0/go.mod h1:wGjeNd+T4kpGrt0OC8DTiE/qXLrlmTPNpdoYsBZUjKI= +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= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= @@ -172,49 +197,52 @@ github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= +github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= github.com/dgraph-io/badger/v2 v2.2007.1/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= -github.com/dgraph-io/badger/v3 v3.2011.1 h1:Hmyof0WMEF/QtutX5SQHzIMnJQxb/IrSzhjckV2SD6g= -github.com/dgraph-io/badger/v3 v3.2011.1/go.mod h1:0rLLrQpKVQAL0or/lBLMQznhr6dWWX7h5AKnmnqx268= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.0.4-0.20210122082011-bb5d392ed82d h1:eQYOG6A4td1tht0NdJB9Ls6DsXRGb2Ft6X9REU/MbbE= -github.com/dgraph-io/ristretto v0.0.4-0.20210122082011-bb5d392ed82d/go.mod h1:tv2ec8nA7vRpSYX7/MbP52ihrUMXIHit54CQMq8npXQ= +github.com/dgraph-io/ristretto v0.0.3 h1:jh22xisGBjrEVnRZ1DVTpBVQm0Xndu8sMl0CWDzSIBI= +github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 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/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ= github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= +github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= 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/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/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 h1:2vLKys4RBU4pn2T/hjXMbvwTr1Cvy5THHrQkbeY9HRk= github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25/go.mod h1:hTr8+TLQmkUkgcuh3mcr5fjrT9c64ZzsBCdCEC6UppY= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870 h1:E2s37DuLxFhQDg5gKsWoLBOB0n+ZW8s599zru8FJ2/Y= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= +github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= 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/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -222,11 +250,12 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.5.0/go.mod h1:Nd6IXA8m5kNZdNEHMBd93KT+mdY3+bewLgRvmCsR2Do= -github.com/go-delve/delve v1.5.0/go.mod h1:c6b3a1Gry6x8a4LGCe/CWzrocrfaHvkUxCj3k4bvSUQ= +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/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -237,37 +266,46 @@ github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgO github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih4= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= -github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= +github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= +github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= +github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= +github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= +github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= +github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= 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.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -289,14 +327,11 @@ github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3 h1:ur2rms48b3Ep1dxh7aUV2FZEQ8jEVO2F6ILKx8ofkAg= github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/flatbuffers v1.12.0 h1:/PtAHvnBY4Kqnx/xCQ3OIV9uYcSFGScBsWI3Oogeh6w= -github.com/google/flatbuffers v1.12.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= @@ -307,16 +342,19 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-dap v0.2.0/go.mod h1:5q8aYQFnHOAZEMP+6vmq25HKYAEwE+LF5yh7JKrrhSQ= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= +github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -330,12 +368,13 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe 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/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f h1:KMlcu9X58lhTA/KrfX8Bi1LQSO4pzoVjTiL3h4Jk+Zk= -github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= @@ -345,13 +384,17 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.1/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= @@ -396,17 +439,27 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO 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-20201207055737-7fde80a9d5ff h1:LeVKjw8pcDQj7WVVnbFvbD7ovcv+r/l15ka1NH6Lswc= -github.com/hdevalence/ed25519consensus v0.0.0-20201207055737-7fde80a9d5ff/go.mod h1:Feit0l8NcNO4g69XNjwvsR0LGcwMMfzI1TF253rOIlQ= +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/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 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/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/improbable-eng/grpc-web v0.14.0 h1:GdoK+cXABdB+1keuqsV1drSFO2XLYIxqt/4Rj8SWGBk= +github.com/improbable-eng/grpc-web v0.14.0/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6OL4eEvELdran/3cs= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +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= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jhump/protoreflect v1.8.2 h1:k2xE7wcUomeqwY0LDCYA16y4WWfyTcMx5mKhk0d4ua0= +github.com/jhump/protoreflect v1.8.2/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -418,48 +471,62 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 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/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +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/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= 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.10.3 h1:OP96hzwJVBIHYU52pVTI6CczrxPvrGfgqF9N5eTO0Q8= +github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= 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.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +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/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mattn/go-colorable v0.0.0-20170327083344-ded68f7a9561/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 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.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +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.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= +github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= 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= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= @@ -469,24 +536,28 @@ github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mmcloughlin/avo v0.0.0-20201105074841-5d2f697d268f/go.mod h1:6aKT4zZIrpGqB3RpFU14ByCSSyKY6LfJz4J/JJChHfI= 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= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= +github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= @@ -494,13 +565,17 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -520,24 +595,23 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxS github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/otiai10/copy v1.4.2 h1:RTiz2sol3eoXPLF4o+YWqEybwfUa/Q2Nkc4ZIUs3fwI= -github.com/otiai10/copy v1.4.2/go.mod h1:XWfuS3CrI0R6IE0FbgHsEazaXO8G0LpMp9o8tos0x4E= +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= -github.com/otiai10/curr v1.0.0 h1:TJIWdbX0B+kpNagQrjgq8bCMrbhiuX73M2XwgtDMoOI= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.2 h1:VYWnrP5fXmz1MXvjuUvcBrXSjGE6xjON+axB/UrpO3E= github.com/otiai10/mint v1.3.2/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= 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/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= github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/peterh/liner v0.0.0-20170317030525-88609521dc4b/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/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= @@ -576,8 +650,9 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.29.0 h1:3jqPBvKT4OHAbje2Ql7KeaaSicDBCxMYwEJU1zRJceE= +github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -587,6 +662,7 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= @@ -595,34 +671,36 @@ github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= 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.2-alpha.regen.4 h1:c9jEnU+xm6vqyrQe3M94UFWqiXxRIKKnqBOh2EACmBE= -github.com/regen-network/protobuf v1.3.2-alpha.regen.4 h1:c9jEnU+xm6vqyrQe3M94UFWqiXxRIKKnqBOh2EACmBE= -github.com/regen-network/protobuf v1.3.2-alpha.regen.4/go.mod h1:/J8/bR1T/NXyIdQDLUaq15LjNE83nRzkyrLAMcPewig= -github.com/regen-network/protobuf v1.3.2-alpha.regen.4/go.mod h1:/J8/bR1T/NXyIdQDLUaq15LjNE83nRzkyrLAMcPewig= +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/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.0 h1:P2KMzcFwrPoSjkF1WLRPsp3UMLyql8L4v9hQpVeK5so= -github.com/rs/cors v1.8.0/go.mod h1:EBwu+T5AvHOcXwvZIkQFjUN6s8Czyqw12GL/Y0tUyRM= +github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/zerolog v1.20.0/go.mod h1:IzD0RJ65iWH0w97OQQebJEvTZYvsCUm9WVLWBQrJRjo= +github.com/rs/zerolog v1.18.0/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I= github.com/rs/zerolog v1.23.0 h1:UskrK+saS9P9Y789yNNulYKdARjPZuS35B8gJF2x60g= github.com/rs/zerolog v1.23.0/go.mod h1:6c7hFfxPOy7TacJc4Fcdi24/J0NKYGzjG8FWRI916Qo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y= 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/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= +github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= -github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= @@ -637,17 +715,15 @@ github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.0-20170417170307-b6cb39589372/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= 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= -github.com/spf13/pflag v0.0.0-20170417173400-9e4c21054fa1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -656,8 +732,11 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= 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 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.8.0 h1:QRwDgoG8xX+kp69di68D+YYTCWfYEckbZRfUlEIAal0= +github.com/spf13/viper v1.8.0/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +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/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= @@ -684,32 +763,49 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RM github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= +github.com/tendermint/spm v0.1.5 h1:/MkM8SOsHBkX1kbo74a2WNmrViLaEem/OzBHI5v6l1c= +github.com/tendermint/spm v0.1.5/go.mod h1:+rHrI1axfSX1R0DY6KA4IbrHPgJ0WVNJKhey71ulXO8= github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= -github.com/tendermint/tendermint v0.34.0 h1:eXCfMgoqVSzrjzOj6clI9GAejcHH0LvOlRjpCmMJksU= github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= +github.com/tendermint/tendermint v0.34.10/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= +github.com/tendermint/tendermint v0.34.12/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= -github.com/tendermint/tm-db v0.6.3 h1:ZkhQcKnB8/2jr5EaZwGndN4owkPsGezW2fSisS9zGbg= github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= +github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= +github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= +github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= +github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= 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= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/twitchyliquid64/golang-asm v0.15.0/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= 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/vektra/mockery/v2 v2.9.4/go.mod h1:2gU4Cf/f8YyC8oEaSXfCnZBMxMjMl/Ko205rlP0fO90= github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3 h1:zMsHhfK9+Wdl1F7sIKLyx3wrOFofpb3rWFbA4HgcK5k= github.com/vivint/infectious v0.0.0-20200605153912-25a574ae18a3/go.mod h1:R0Gbuw7ElaGSLOZUSwBm/GgVwMd30jWxBDdAyMOeTuc= +github.com/vmihailenco/msgpack/v5 v5.1.4/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZGo8UTqP/9/XvLI= +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= 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= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= gitlab.com/NebulousLabs/errors v0.0.0-20171229012116-7ead97ef90b8/go.mod h1:ZkMZ0dpQyWwlENaeZVBiQRjhMEZvk6VTXquzl3FOFP8= @@ -733,10 +829,7 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20190702223751-32f345186213/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -748,17 +841,17 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E 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= -golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= -golang.org/x/arch v0.0.0-20201008161808-52c3e6f60cff/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200109152110-61a87790db17/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -770,12 +863,12 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/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= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -786,7 +879,6 @@ 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/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-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -800,10 +892,12 @@ golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPI golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -811,8 +905,8 @@ 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/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-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -849,6 +943,7 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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-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= @@ -856,8 +951,9 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/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 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 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= @@ -870,6 +966,7 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -882,7 +979,6 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -902,7 +998,6 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/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-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -932,7 +1027,9 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -946,30 +1043,27 @@ golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/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-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/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-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -992,12 +1086,11 @@ golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191127201027-ecd32218bd7f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/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-20200110213125-a7a6caa82ab2/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-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1008,21 +1101,26 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200323144430-8dcfad9e016e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201105001634-bc3cf281b174/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1053,7 +1151,6 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1108,38 +1205,10 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210830153122-0bac4d21c8ea h1:5eMUso2GVOxypVH1fR4oKgDobrvi4DHctJ4fVk66s/4= -google.golang.org/genproto v0.0.0-20210830153122-0bac4d21c8ea/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 h1:3V2dxSZpz4zozWWUq36vUxXEKnSYitEH2LdsAx+RUmg= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +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 v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= 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= @@ -1150,6 +1219,7 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 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 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= @@ -1166,14 +1236,15 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= -gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1188,7 +1259,7 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= 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= @@ -1196,8 +1267,9 @@ 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= +nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= +nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= 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= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/x/payment/types/codec.go b/x/payment/types/codec.go new file mode 100755 index 0000000000..fce8e7cb4c --- /dev/null +++ b/x/payment/types/codec.go @@ -0,0 +1,29 @@ +package types + +import ( + "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/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgWirePayForMessage{}, "payment/WirePayForMessage", nil) + // this line is used by starport scaffolding # 2 +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgWirePayForMessage{}, + ) + // this line is used by starport scaffolding # 3 + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/payment/types/errors.go b/x/payment/types/errors.go new file mode 100755 index 0000000000..eff60122be --- /dev/null +++ b/x/payment/types/errors.go @@ -0,0 +1,12 @@ +package types + +// DONTCOVER + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// x/payment module sentinel errors +var ( + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") +) diff --git a/x/payment/types/expected_keepers.go b/x/payment/types/expected_keepers.go new file mode 100755 index 0000000000..ab1254f4c2 --- /dev/null +++ b/x/payment/types/expected_keepers.go @@ -0,0 +1 @@ +package types diff --git a/x/payment/types/genesis.go b/x/payment/types/genesis.go new file mode 100755 index 0000000000..06921a5995 --- /dev/null +++ b/x/payment/types/genesis.go @@ -0,0 +1,23 @@ +package types + +import ( +// this line is used by starport scaffolding # genesis/types/import +) + +// DefaultIndex is the default capability global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default Capability genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{ + // this line is used by starport scaffolding # genesis/types/default + } +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // this line is used by starport scaffolding # genesis/types/validate + + return nil +} diff --git a/x/payment/types/genesis_test.go b/x/payment/types/genesis_test.go new file mode 100755 index 0000000000..f9fe23fba4 --- /dev/null +++ b/x/payment/types/genesis_test.go @@ -0,0 +1,39 @@ +package types_test + +import ( + "testing" + + "github.com/celestiaorg/celestia-app/x/payment/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/payment/types/keys.go b/x/payment/types/keys.go new file mode 100755 index 0000000000..69ea299e68 --- /dev/null +++ b/x/payment/types/keys.go @@ -0,0 +1,22 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "payment" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_payment" +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/x/payment/types/payformessage.go b/x/payment/types/payformessage.go new file mode 100644 index 0000000000..7150056223 --- /dev/null +++ b/x/payment/types/payformessage.go @@ -0,0 +1,356 @@ +package types + +import ( + "bytes" + "crypto/sha256" + "errors" + "fmt" + + "github.com/celestiaorg/nmt" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/tendermint/tendermint/crypto/merkle" + "github.com/tendermint/tendermint/pkg/consts" +) + +const ( + TypeMsgPayforMessage = "payformessage" + TypeSignedTransactionDataPayForMessage = "signedtransactiondatapayformessage" + ShareSize = consts.ShareSize + SquareSize = consts.MaxSquareSize + NamespaceIDSize = consts.NamespaceSize +) + +var _ sdk.Msg = &MsgWirePayForMessage{} + +// NewMsgWirePayForMessage creates a new MsgWirePayForMessage by using the +// namespace and message to generate share commitments for the provided square sizes +// Note that the share commitments generated still need to be signed using the Sign +// method +func NewMsgWirePayForMessage(namespace, message, pubK []byte, fee *TransactionFee, sizes ...uint64) (*MsgWirePayForMessage, error) { + message = PadMessage(message) + out := &MsgWirePayForMessage{ + Fee: fee, + Nonce: 0, + MessageNameSpaceId: namespace, + MessageSize: uint64(len(message)), + Message: message, + MessageShareCommitment: make([]ShareCommitAndSignature, len(sizes)), + PublicKey: pubK, + } + + // generate the share commitments + for i, size := range sizes { + commit, err := CreateCommitment(size, namespace, message) + if err != nil { + return nil, err + } + out.MessageShareCommitment[i] = ShareCommitAndSignature{K: size, ShareCommitment: commit} + } + return out, nil +} + +// SignShareCommitments use the provided Keyring to sign each of the share commits +// generated during the creation of the MsgWirePayForMessage +func (msg *MsgWirePayForMessage) SignShareCommitments(accName string, ring keyring.Keyring) error { + for i, commit := range msg.MessageShareCommitment { + bytesToSign, err := msg.GetCommitmentSignBytes(commit.K) + if err != nil { + return err + } + sig, _, err := ring.Sign(accName, bytesToSign) + if err != nil { + return err + } + msg.MessageShareCommitment[i].Signature = sig + } + return nil +} + +func (msg *MsgWirePayForMessage) Route() string { return RouterKey } + +func (msg *MsgWirePayForMessage) Type() string { return TypeMsgPayforMessage } + +// ValidateBasic checks for valid namespace length, declared message size, share +// commitments, signatures for those share commitments, and fulfills the sdk.Msg +// interface +func (msg *MsgWirePayForMessage) ValidateBasic() error { + pubK := msg.PubKey() + + // ensure that the namespace id is of length == NamespaceIDSize + if len(msg.GetMessageNameSpaceId()) != NamespaceIDSize { + return fmt.Errorf( + "invalid namespace length: got %d wanted %d", + len(msg.GetMessageNameSpaceId()), + NamespaceIDSize, + ) + } + + // ensure that the included message is evenly divisble into shares + if uint64(len(msg.GetMessage()))%ShareSize != 0 { + return fmt.Errorf("Share message must be divisible by %d", ShareSize) + } + + // make sure that the message size matches the actual size of the message + if msg.MessageSize != uint64(len(msg.Message)) { + return fmt.Errorf( + "Declared Message size does not match actual Message size, %d vs %d", + msg.MessageSize, + len(msg.Message), + ) + } + + // ensure that a reserved namespace is not used + if bytes.Compare(msg.GetMessageNameSpaceId(), consts.MaxReservedNamespace) < 1 { + return errors.New("message is not valid: uses a reserved namesapce ID") + } + + for _, commit := range msg.MessageShareCommitment { + // check that each commit is valid + calculatedCommit, err := CreateCommitment(commit.K, msg.GetMessageNameSpaceId(), msg.Message) + if err != nil { + return err + } + + if string(calculatedCommit) != string(commit.ShareCommitment) { + return fmt.Errorf("invalid commit for square size %d", commit.K) + } + + // check that the signatures are valid + bytesToSign, err := msg.GetCommitmentSignBytes(commit.K) + if err != nil { + return err + } + + if !pubK.VerifySignature(bytesToSign, commit.Signature) { + return fmt.Errorf("invalid signature for share commitment to square size %d", commit.K) + } + } + + return nil +} + +// GetSignBytes returns messages bytes that need to be signed in order for the +// message to be valid +func (msg *MsgWirePayForMessage) GetSignBytes() []byte { + out, err := msg.GetCommitmentSignBytes(SquareSize) + if err != nil { + // this panic can only be reached if the nmt cannot push bytes onto the + // tree while creating the commit. This should never happen, as an error + // only occurs when out of order or varying sized namespaces are used, + // and we are using an identical namespace when pushing to the nmt + // https://github.com/celestiaorg/nmt/blob/b22170d6f23796a186c07e87e4ef9856282ffd1a/nmt.go#L250 + panic(err) + } + return out +} + +// GetSigners returns the addresses of the message signers +func (msg *MsgWirePayForMessage) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{sdk.AccAddress(msg.PubKey().Address().Bytes())} +} + +// PubKey returns the public key of the creator of MsgWirePayForMessage +func (msg *MsgWirePayForMessage) PubKey() *secp256k1.PubKey { + return &secp256k1.PubKey{Key: msg.PublicKey} +} + +// GetCommitmentSignBytes generates the bytes that each need to be signed per share commit +func (msg *MsgWirePayForMessage) GetCommitmentSignBytes(k uint64) ([]byte, error) { + sTxMsg, err := msg.SignedTransactionDataPayForMessage(k) + if err != nil { + return nil, err + } + return sTxMsg.GetSignBytes(), nil +} + +// SignedTransactionDataPayForMessage use the data in the MsgWirePayForMessage +// to create a new SignedTransactionDataPayForMessage +func (msg *MsgWirePayForMessage) SignedTransactionDataPayForMessage(k uint64) (*SignedTransactionDataPayForMessage, error) { + // create the commitment using the padded message + commit, err := CreateCommitment(k, msg.MessageNameSpaceId, msg.Message) + if err != nil { + return nil, err + } + + sTxMsg := SignedTransactionDataPayForMessage{ + Fee: &TransactionFee{ + BaseRateMax: msg.Fee.BaseRateMax, + TipRateMax: msg.Fee.TipRateMax, + }, + Nonce: msg.Nonce, + MessageNamespaceId: msg.MessageNameSpaceId, + MessageSize: msg.MessageSize, + MessageShareCommitment: commit, + } + return &sTxMsg, nil +} + +var _ sdk.Tx = &TxSignedTransactionDataPayForMessage{} + +// GetMsgs fullfills the sdk.Tx interface +func (tx *TxSignedTransactionDataPayForMessage) GetMsgs() []sdk.Msg { + return []sdk.Msg{tx.Message} +} + +// ValidateBasic fullfills the sdk.Tx interface by verifing the signature of the +// underlying signed transaction +func (tx *TxSignedTransactionDataPayForMessage) ValidateBasic() error { + pKey := secp256k1.PubKey{Key: tx.PublicKey} + + if !pKey.VerifySignature(tx.Message.GetSignBytes(), tx.Signature) { + return errors.New("failure to validte SignedTransactionDataPayForMessage") + } + return nil +} + +var _ sdk.Msg = &SignedTransactionDataPayForMessage{} + +// Route fullfills the sdk.Msg interface +func (msg *SignedTransactionDataPayForMessage) Route() string { return RouterKey } + +// Type fullfills the sdk.Msg interface +func (msg *SignedTransactionDataPayForMessage) Type() string { + return TypeSignedTransactionDataPayForMessage +} + +// ValidateBasic fullfills the sdk.Msg interface by performing stateless +// validity checks on the msg that also don't require having the actual message +func (msg *SignedTransactionDataPayForMessage) ValidateBasic() error { + // ensure that the namespace id is of length == NamespaceIDSize + if len(msg.GetMessageNamespaceId()) != NamespaceIDSize { + return fmt.Errorf( + "invalid namespace length: got %d wanted %d", + len(msg.GetMessageNamespaceId()), + NamespaceIDSize, + ) + } + return nil +} + +// GetSignBytes fullfills the sdk.Msg interface by reterning a deterministic set +// of bytes to sign over +func (msg *SignedTransactionDataPayForMessage) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +// GetSigners fullfills the sdk.Msg interface but does not return anything, as +// SignTransactionDataPayForMessage doesn't have access the public key necessary +// in MsgWirePayForMessage +func (msg *SignedTransactionDataPayForMessage) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{} +} + +// CreateCommitment generates the commit bytes for a given message, namespace, and +// squaresize using a namespace merkle tree and the rules described at +// https://github.com/celestiaorg/celestia-specs/blob/master/rationale/message_block_layout.md#non-interactive-default-rules +func CreateCommitment(k uint64, namespace, message []byte) ([]byte, error) { + // add padding to the message if necessary + message = PadMessage(message) + + // break message into shares + shares := chunkMessage(message) + + // organize shares for merkle mountain range + heights := PowerOf2MountainRange(uint64(len(shares)), k) + leafSets := make([][][]byte, len(heights)) + cursor := uint64(0) + for i, height := range heights { + leafSets[i] = shares[cursor : cursor+height] + cursor = cursor + height + } + + // create the commits by pushing each leaf set onto an nmt + subTreeRoots := make([][]byte, len(leafSets)) + for i, set := range leafSets { + // create the nmt + tree := nmt.New(sha256.New(), nmt.NamespaceIDSize(NamespaceIDSize)) + for _, leaf := range set { + nsLeaf := append(make([]byte, 0), append(namespace, leaf...)...) + err := tree.Push(nsLeaf) + if err != nil { + return nil, err + } + } + // add the root + subTreeRoots[i] = tree.Root() + } + return merkle.HashFromByteSlices(subTreeRoots), nil +} + +// chunkMessage breaks the message into ShareSize pieces +func chunkMessage(message []byte) [][]byte { + var shares [][]byte + for i := 0; i < len(message); i += ShareSize { + end := i + ShareSize + if end > len(message) { + end = len(message) + } + shares = append(shares, message[i:end]) + } + return shares +} + +// PadMessage adds padding to the msg if the length of the msg is not divisible +// by the share size specified in celestia-core +func PadMessage(msg []byte) []byte { + // check if the message needs padding + if uint64(len(msg))%ShareSize == 0 { + return msg + } + + shareCount := (len(msg) / ShareSize) + 1 + + padded := make([]byte, shareCount*ShareSize) + copy(padded, msg) + return padded +} + +// PowerOf2MountainRange returns the heights of the subtrees for binary merkle +// mountian range +func PowerOf2MountainRange(l, k uint64) []uint64 { + var output []uint64 + + for l != 0 { + switch { + case l >= k: + output = append(output, k) + l = l - k + case l < k: + p := nextPowerOf2(l) + output = append(output, p) + l = l - p + } + } + + return output +} + +// nextPowerOf2 returns the next lowest power of 2 unless the input is a power +// of two, in which case it returns the input +func nextPowerOf2(v uint64) uint64 { + if v == 1 { + return 1 + } + // keep track of the input + i := v + + // find the next highest power using bit mashing + v-- + v |= v >> 1 + v |= v >> 2 + v |= v >> 4 + v |= v >> 8 + v |= v >> 16 + v |= v >> 32 + v++ + + // check if the input was the next highest power + if i == v { + return v + } + + // return the next lowest power + return v / 2 +} diff --git a/x/payment/types/payformessage_test.go b/x/payment/types/payformessage_test.go new file mode 100644 index 0000000000..55af59f2b4 --- /dev/null +++ b/x/payment/types/payformessage_test.go @@ -0,0 +1,336 @@ +package types + +import ( + "bytes" + "testing" + + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/pkg/consts" +) + +const ( + testingKeyAcc = "test" +) + +func TestMountainRange(t *testing.T) { + type test struct { + l, k uint64 + expected []uint64 + } + tests := []test{ + { + l: 11, + k: 4, + expected: []uint64{4, 4, 2, 1}, + }, + { + l: 2, + k: 64, + expected: []uint64{2}, + }, + { //should this test throw an error? we + l: 64, + k: 8, + expected: []uint64{8, 8, 8, 8, 8, 8, 8, 8}, + }, + } + for _, tt := range tests { + res := PowerOf2MountainRange(tt.l, tt.k) + assert.Equal(t, tt.expected, res) + } +} + +func TestNextPowerOf2(t *testing.T) { + type test struct { + input uint64 + expected uint64 + } + tests := []test{ + { + input: 2, + expected: 2, + }, + { + input: 11, + expected: 8, + }, + { + input: 511, + expected: 256, + }, + { + input: 1, + expected: 1, + }, + { + input: 0, + expected: 0, + }, + } + for _, tt := range tests { + res := nextPowerOf2(tt.input) + assert.Equal(t, tt.expected, res) + } +} + +// TestCreateCommit only shows if something changed, it doesn't actually show +// the commit is being created correctly todo(evan): fix me. +func TestCreateCommitment(t *testing.T) { + type test struct { + k uint64 + namespace []byte + message []byte + expected []byte + } + tests := []test{ + { + k: 4, + namespace: bytes.Repeat([]byte{0xFF}, 8), + message: bytes.Repeat([]byte{0xFF}, 11*256), + expected: []byte{0x1c, 0x57, 0x89, 0x2f, 0xbe, 0xbf, 0xa2, 0xa4, 0x4c, 0x41, 0x9e, 0x2d, 0x88, 0xd5, 0x87, 0xc0, 0xbd, 0x37, 0xc0, 0x85, 0xbd, 0x10, 0x3c, 0x36, 0xd9, 0xa2, 0x4d, 0x4e, 0x31, 0xa2, 0xf8, 0x4e}, + }, + } + for _, tt := range tests { + res, err := CreateCommitment(tt.k, tt.namespace, tt.message) + assert.NoError(t, err) + assert.Equal(t, tt.expected, res) + } +} + +// this test only tests for changes, it doesn't actually test that the result is valid. +// todo(evan): fixme +func TestGetCommitmentSignBytes(t *testing.T) { + type test struct { + msg MsgWirePayForMessage + expected []byte + } + tests := []test{ + { + msg: MsgWirePayForMessage{ + MessageSize: 4, + Message: []byte{1, 2, 3, 4}, + MessageNameSpaceId: []byte{1, 2, 3, 4, 1, 2, 3, 4}, + Nonce: 1, + Fee: &TransactionFee{ + BaseRateMax: 10000, + TipRateMax: 1000, + }, + }, + expected: []byte(`{"fee":{"base_rate_max":"10000","tip_rate_max":"1000"},"message_namespace_id":"AQIDBAECAwQ=","message_share_commitment":"Elh5P8yB1FeiPP0uWCkp67mqSsaVat6iwjH2vSMQJys=","message_size":"4","nonce":"1"}`), + }, + } + for _, tt := range tests { + res, err := tt.msg.GetCommitmentSignBytes(SquareSize) + assert.NoError(t, err) + assert.Equal(t, tt.expected, res) + } +} + +func TestPadMessage(t *testing.T) { + type test struct { + input []byte + expected []byte + } + tests := []test{ + { + input: []byte{1}, + expected: append([]byte{1}, bytes.Repeat([]byte{0}, ShareSize-1)...), + }, + { + input: []byte{}, + expected: []byte{}, + }, + { + input: bytes.Repeat([]byte{1}, ShareSize), + expected: bytes.Repeat([]byte{1}, ShareSize), + }, + { + input: bytes.Repeat([]byte{1}, (3*ShareSize)-10), + expected: append(bytes.Repeat([]byte{1}, (3*ShareSize)-10), bytes.Repeat([]byte{0}, 10)...), + }, + } + for _, tt := range tests { + res := PadMessage(tt.input) + assert.Equal(t, tt.expected, res) + } +} + +func TestSignShareCommitments(t *testing.T) { + type test struct { + accName string + msg *MsgWirePayForMessage + } + + kb := generateKeyring(t, "test") + + // create the first PFM for the first test + firstPubKey, err := kb.Key("test") + if err != nil { + t.Error(err) + } + firstNs := []byte{1, 1, 1, 1, 1, 1, 1, 1} + firstMsg := bytes.Repeat([]byte{1}, ShareSize) + firstPFM, err := NewMsgWirePayForMessage( + firstNs, + firstMsg, + firstPubKey.GetPubKey().Bytes(), + &TransactionFee{}, + SquareSize, + ) + if err != nil { + t.Error(err) + } + + tests := []test{ + { + accName: "test", + msg: firstPFM, + }, + } + + for _, tt := range tests { + err := tt.msg.SignShareCommitments(tt.accName, kb) + // there should be no error + assert.NoError(t, err) + // the signature should exist + assert.Equal(t, len(tt.msg.MessageShareCommitment[0].Signature), 64) + } +} + +func generateKeyring(t *testing.T, accts ...string) keyring.Keyring { + kb := keyring.NewInMemory() + + for _, acc := range accts { + _, _, err := kb.NewMnemonic(acc, keyring.English, "", "", hd.Secp256k1) + if err != nil { + t.Error(err) + } + } + + return kb +} + +func TestMsgWirePayForMessage_ValidateBasic(t *testing.T) { + type test struct { + name string + msg *MsgWirePayForMessage + expectErr bool + errStr string + } + + kr := newKeyring() + + // valid pfm + validMsg := validMsgWirePayForMessage(kr) + + // pfm with bad ns id + badIDMsg := validMsgWirePayForMessage(kr) + badIDMsg.MessageNameSpaceId = []byte{1, 2, 3, 4, 5, 6, 7} + + // pfm that uses reserved ns id + reservedMsg := validMsgWirePayForMessage(kr) + reservedMsg.MessageNameSpaceId = []byte{0, 0, 0, 0, 0, 0, 0, 100} + + // pfm that has a wrong msg size + invalidMsgSizeMsg := validMsgWirePayForMessage(kr) + invalidMsgSizeMsg.Message = bytes.Repeat([]byte{1}, consts.ShareSize-20) + + // pfm that has a wrong msg size + invalidDeclaredMsgSizeMsg := validMsgWirePayForMessage(kr) + invalidDeclaredMsgSizeMsg.MessageSize = 999 + + // pfm with bad sig + badSigMsg := validMsgWirePayForMessage(kr) + badSigMsg.MessageShareCommitment[0].Signature = []byte{1, 2, 3, 4} + + // pfm with bad commitment + badCommitMsg := validMsgWirePayForMessage(kr) + badCommitMsg.MessageShareCommitment[0].ShareCommitment = []byte{1, 2, 3, 4} + + tests := []test{ + { + name: "valid msg", + msg: validMsg, + }, + { + name: "bad ns ID", + msg: badIDMsg, + expectErr: true, + errStr: "invalid namespace length", + }, + { + name: "reserved ns id", + msg: reservedMsg, + expectErr: true, + errStr: "uses a reserved namesapce ID", + }, + { + name: "invalid msg size", + msg: invalidMsgSizeMsg, + expectErr: true, + errStr: "Share message must be divisible", + }, + { + name: "bad declared message size", + msg: invalidDeclaredMsgSizeMsg, + expectErr: true, + errStr: "Declared Message size does not match actual Message size", + }, + { + name: "bad sig", + msg: badSigMsg, + expectErr: true, + errStr: "invalid signature for share commitment", + }, + { + name: "bad commitment", + msg: badCommitMsg, + expectErr: true, + errStr: "invalid commit for square size", + }, + } + + for _, tt := range tests { + err := tt.msg.ValidateBasic() + if tt.expectErr { + require.NotNil(t, err, tt.name) + require.Contains(t, err.Error(), tt.errStr, tt.name) + continue + } + require.NoError(t, err, tt.name) + } +} + +func validMsgWirePayForMessage(keyring keyring.Keyring) *MsgWirePayForMessage { + info, err := keyring.Key(testingKeyAcc) + if err != nil { + panic(err) + } + msg, err := NewMsgWirePayForMessage( + []byte{1, 2, 3, 4, 5, 6, 7, 8}, + bytes.Repeat([]byte{1}, 1000), + info.GetPubKey().Bytes(), + &TransactionFee{}, + 16, 32, 64, + ) + if err != nil { + panic(err) + } + err = msg.SignShareCommitments(testingKeyAcc, keyring) + if err != nil { + panic(err) + } + return msg +} + +func newKeyring() keyring.Keyring { + kb := keyring.NewInMemory() + _, _, err := kb.NewMnemonic(testingKeyAcc, keyring.English, "", "", hd.Secp256k1) + if err != nil { + panic(err) + } + return kb +} diff --git a/x/payment/types/types.go b/x/payment/types/types.go new file mode 100755 index 0000000000..ab1254f4c2 --- /dev/null +++ b/x/payment/types/types.go @@ -0,0 +1 @@ +package types From 954ec172341f7b3c40ae34b94e1f17997685c971 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:44:13 -0500 Subject: [PATCH 08/17] use go 1.17 --- .github/workflows/sims.yml | 12 ++--- go.mod | 105 ++++++++++++++++++++++++++++++++++++- go.sum | 19 ++++--- 3 files changed, 122 insertions(+), 14 deletions(-) diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index e47dba64ef..baf87c562e 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.4 with: - go-version: 1.15 + go-version: 1.17 - name: Display go version run: go version - run: make build @@ -34,7 +34,7 @@ jobs: steps: - uses: actions/setup-go@v2.1.4 with: - go-version: 1.15 + go-version: 1.16 - name: Display go version run: go version - name: Install runsim @@ -51,7 +51,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.4 with: - go-version: 1.15 + go-version: 1.17 - name: Display go version run: go version - uses: technote-space/get-diff-action@v5 @@ -77,7 +77,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.4 with: - go-version: 1.15 + go-version: 1.17 - name: Display go version run: go version - uses: technote-space/get-diff-action@v5 @@ -105,7 +105,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.4 with: - go-version: 1.15 + go-version: 1.17 - name: Display go version run: go version - uses: technote-space/get-diff-action@v5 @@ -133,7 +133,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.4 with: - go-version: 1.15 + go-version: 1.17 - name: Display go version run: go version - uses: technote-space/get-diff-action@v5 diff --git a/go.mod b/go.mod index ff98ec8d5e..61d1b2235b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/celestiaorg/celestia-app -go 1.16 +go 1.17 require ( github.com/celestiaorg/nmt v0.7.0 @@ -12,15 +12,116 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cast v1.3.1 - github.com/spf13/cobra v1.1.3 + github.com/spf13/cobra v1.2.1 github.com/stretchr/testify v1.7.0 github.com/tendermint/spm v0.1.5 github.com/tendermint/tendermint v0.34.13 github.com/tendermint/tm-db v0.6.4 + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect + golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d // indirect + golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 google.golang.org/grpc v1.40.0 ) +require ( + filippo.io/edwards25519 v1.0.0-beta.2 // indirect + github.com/99designs/keyring v1.1.6 // indirect + github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/DataDog/zstd v1.4.5 // indirect + github.com/Workiva/go-datastructures v1.0.52 // indirect + github.com/armon/go-metrics v0.3.9 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/bgentry/speakeasy v0.1.0 // indirect + github.com/btcsuite/btcd v0.22.0-beta // indirect + github.com/celestiaorg/go-leopard v0.1.0 // indirect + github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 // indirect + github.com/celestiaorg/rsmt2d v0.3.0 // indirect + github.com/cespare/xxhash v1.1.0 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/coinbase/rosetta-sdk-go v0.6.10 // indirect + github.com/confio/ics23/go v0.6.6 // indirect + github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/iavl v0.16.0 // indirect + github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect + github.com/cosmos/ledger-go v0.9.2 // indirect + github.com/danieljoos/wincred v1.0.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect + github.com/dgraph-io/badger/v2 v2.2007.2 // indirect + github.com/dgraph-io/ristretto v0.0.3 // indirect + github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect + github.com/dustin/go-humanize v1.0.0 // indirect + github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect + github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 // indirect + github.com/felixge/httpsnoop v1.0.1 // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/go-kit/kit v0.10.0 // indirect + github.com/go-logfmt/logfmt v0.5.0 // indirect + github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gogo/gateway v1.1.0 // indirect + github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3 // indirect + github.com/google/btree v1.0.0 // indirect + github.com/google/orderedcode v0.0.1 // indirect + github.com/gorilla/handlers v1.5.1 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // 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.0.0 // indirect + github.com/hashicorp/golang-lru v0.5.4 // 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.0 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // 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.10.3 // indirect + github.com/libp2p/go-buffer-pool v0.0.2 // indirect + github.com/magiconair/properties v1.8.5 // indirect + github.com/mattn/go-isatty v0.0.13 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect + github.com/minio/highwayhash v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/mtibben/percent v0.2.1 // indirect + github.com/pelletier/go-toml v1.9.3 // indirect + github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.11.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.29.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/rakyll/statik v0.1.7 // indirect + github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect + github.com/regen-network/cosmos-proto v0.3.1 // indirect + github.com/rs/cors v1.7.0 // indirect + github.com/rs/zerolog v1.23.0 // indirect + github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect + github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.8.1 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect + github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // 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/vivint/infectious v0.0.0-20200605153912-25a574ae18a3 // indirect + github.com/zondax/hid v0.9.0 // indirect + go.etcd.io/bbolt v1.3.5 // indirect + golang.org/x/text v0.3.6 // indirect + google.golang.org/protobuf v1.27.1 // indirect + gopkg.in/ini.v1 v1.62.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + nhooyr.io/websocket v1.8.6 // indirect +) + replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v0.40.0-rc5.0.20210929155038-f1d7264b323c diff --git a/go.sum b/go.sum index aa9ecb7dda..313d6dd057 100644 --- a/go.sum +++ b/go.sum @@ -719,8 +719,9 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= 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= @@ -732,8 +733,9 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= 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.0 h1:QRwDgoG8xX+kp69di68D+YYTCWfYEckbZRfUlEIAal0= github.com/spf13/viper v1.8.0/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= 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= @@ -863,8 +865,9 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/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= @@ -952,8 +955,9 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v 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-20210525063256-abc453219eb5 h1:wjuX4b5yYQnEQHzd+CBcrcC6OVR2J1CN6mUy0oSxIPo= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= 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= @@ -1045,11 +1049,14 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 h1:foEbQz/B0Oz6YIqu/69kfXPYeFQAuuMYFkjaqXzl5Wo= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/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 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 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= From cfc71996b2755c285fe158706a587af64a99b639 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:45:35 -0500 Subject: [PATCH 09/17] linter --- x/payment/client/cli/tx.go | 6 +----- x/payment/types/codec.go | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/x/payment/client/cli/tx.go b/x/payment/client/cli/tx.go index cded108af3..b63d240bd7 100755 --- a/x/payment/client/cli/tx.go +++ b/x/payment/client/cli/tx.go @@ -15,10 +15,6 @@ var ( DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) ) -const ( - flagPacketTimeoutTimestamp = "packet-timeout-timestamp" -) - // GetTxCmd returns the transaction commands for this module func GetTxCmd() *cobra.Command { cmd := &cobra.Command{ @@ -30,7 +26,7 @@ func GetTxCmd() *cobra.Command { } cmd.AddCommand(CmdWirePayForMessage()) -// this line is used by starport scaffolding # 1 + // this line is used by starport scaffolding # 1 return cmd } diff --git a/x/payment/types/codec.go b/x/payment/types/codec.go index fce8e7cb4c..c1b342f4ce 100755 --- a/x/payment/types/codec.go +++ b/x/payment/types/codec.go @@ -24,6 +24,5 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { } var ( - amino = codec.NewLegacyAmino() ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) ) From 9fc9028b51a645ec4c1857caebeb3e7d1d9334b5 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:47:18 -0500 Subject: [PATCH 10/17] replace missed go versions --- .github/workflows/sims.yml | 2 +- .github/workflows/tag.yml | 2 +- .github/workflows/test.yml | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index baf87c562e..4389df39db 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -34,7 +34,7 @@ jobs: steps: - uses: actions/setup-go@v2.1.4 with: - go-version: 1.16 + go-version: 1.17 - name: Display go version run: go version - name: Install runsim diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index bc65438ff4..f05a15f99e 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@v2.1.4 with: - go-version: 1.15 + go-version: 1.17 - name: Unshallow run: git fetch --prune --unshallow - name: Create release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c202c7d231..f117ecff89 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/setup-go@v2.1.4 with: - go-version: 1.15 + go-version: 1.17 - name: Display go version run: go version - name: install tparse @@ -38,7 +38,7 @@ jobs: # - uses: actions/checkout@v2 # - uses: actions/setup-go@v2.1.4 # with: - # go-version: 1.15 + # go-version: 1.17 # - name: Display go version # run: go version # - uses: technote-space/get-diff-action@v5 @@ -91,7 +91,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.4 with: - go-version: 1.15 + go-version: 1.17 - uses: technote-space/get-diff-action@v5 with: PATTERNS: | @@ -169,7 +169,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.4 with: - go-version: 1.15 + go-version: 1.17 - uses: technote-space/get-diff-action@v5 with: PATTERNS: | @@ -235,7 +235,7 @@ jobs: # - uses: actions/checkout@v2 # - uses: actions/setup-go@v2.1.4 # with: - # go-version: 1.15 + # go-version: 1.17 # - uses: technote-space/get-diff-action@v5 # id: git_diff # with: From 8c288c1840e18edd8c5441fc18f457025f100eec Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:49:52 -0500 Subject: [PATCH 11/17] clean up test --- app/abci_test.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/app/abci_test.go b/app/abci_test.go index 46f1f3567a..cfc2d59475 100644 --- a/app/abci_test.go +++ b/app/abci_test.go @@ -151,11 +151,6 @@ func setupApp(t *testing.T, pub cryptotypes.PubKey) *App { anteOpt, ) - // for acc := range maccPerms { - // require.Equal(t, !allowedReceivingModAcc[acc], testApp.BankKeeper.BlockedAddr(testApp.AccountKeeper.GetModuleAddress(acc)), - // "ensure that blocked addresses are properly set in bank keeper") - // } - genesisState := NewDefaultGenesisState(encCfg.Marshaler) genesisState, err := addGenesisAccount(sdk.AccAddress(pub.Address().Bytes()), genesisState, encCfg.Marshaler) From ef9aab1c549ac2173aa02c4b1ac088d9807d601d Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 29 Sep 2021 18:53:56 -0500 Subject: [PATCH 12/17] stop using the governace module --- app/app.go | 49 ++----------------------------------------------- 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/app/app.go b/app/app.go index 4adb0bce21..e416bdc72a 100755 --- a/app/app.go +++ b/app/app.go @@ -34,7 +34,6 @@ 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" - 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" @@ -45,18 +44,12 @@ import ( feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/cosmos/cosmos-sdk/x/gov" - govclient "github.com/cosmos/cosmos-sdk/x/gov/client" - govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/mint" mintkeeper "github.com/cosmos/cosmos-sdk/x/mint/keeper" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" "github.com/cosmos/cosmos-sdk/x/params" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/cosmos/cosmos-sdk/x/slashing" slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" @@ -64,14 +57,12 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/cosmos/ibc-go/modules/apps/transfer" ibctransferkeeper "github.com/cosmos/ibc-go/modules/apps/transfer/keeper" ibctransfertypes "github.com/cosmos/ibc-go/modules/apps/transfer/types" ibc "github.com/cosmos/ibc-go/modules/core" - ibcclient "github.com/cosmos/ibc-go/modules/core/02-client" ibcporttypes "github.com/cosmos/ibc-go/modules/core/05-port/types" ibchost "github.com/cosmos/ibc-go/modules/core/24-host" ibckeeper "github.com/cosmos/ibc-go/modules/core/keeper" @@ -95,23 +86,6 @@ const ( Name = "celestia-app" ) -// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals - -func getGovProposalHandlers() []govclient.ProposalHandler { - var govProposalHandlers []govclient.ProposalHandler - // this line is used by starport scaffolding # stargate/app/govProposalHandlers - - govProposalHandlers = append(govProposalHandlers, - paramsclient.ProposalHandler, - distrclient.ProposalHandler, - upgradeclient.ProposalHandler, - upgradeclient.CancelProposalHandler, - // this line is used by starport scaffolding # stargate/app/govProposalHandler - ) - - return govProposalHandlers -} - var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string @@ -127,7 +101,6 @@ var ( staking.AppModuleBasic{}, mint.AppModuleBasic{}, distr.AppModuleBasic{}, - gov.NewAppModuleBasic(getGovProposalHandlers()...), params.AppModuleBasic{}, crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, @@ -148,7 +121,6 @@ var ( minttypes.ModuleName: {authtypes.Minter}, stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, // this line is used by starport scaffolding # stargate/app/maccPerms } @@ -194,7 +166,6 @@ type App struct { SlashingKeeper slashingkeeper.Keeper MintKeeper mintkeeper.Keeper DistrKeeper distrkeeper.Keeper - GovKeeper govkeeper.Keeper CrisisKeeper crisiskeeper.Keeper UpgradeKeeper upgradekeeper.Keeper ParamsKeeper paramskeeper.Keeper @@ -239,7 +210,7 @@ func New( keys := sdk.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, + paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, paymentmoduletypes.StoreKey, // this line is used by starport scaffolding # stargate/app/storeKey @@ -313,14 +284,6 @@ func New( appCodec, keys[ibchost.StoreKey], app.GetSubspace(ibchost.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, ) - // register the proposal types - govRouter := govtypes.NewRouter() - govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). - AddRoute(ibchost.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) - // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName), @@ -336,11 +299,6 @@ func New( // If evidence needs to be handled for the app, set routes in router here and seal app.EvidenceKeeper = *evidenceKeeper - app.GovKeeper = govkeeper.NewKeeper( - appCodec, keys[govtypes.StoreKey], app.GetSubspace(govtypes.ModuleName), app.AccountKeeper, app.BankKeeper, - &stakingKeeper, govRouter, - ) - app.PaymentKeeper = *paymentmodulekeeper.NewKeeper( appCodec, app.BankKeeper, @@ -377,7 +335,6 @@ func New( capability.NewAppModule(appCodec, *app.CapabilityKeeper), feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), - 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), @@ -401,7 +358,7 @@ func New( feegrant.ModuleName, ) - app.mm.SetOrderEndBlockers(crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName) + app.mm.SetOrderEndBlockers(crisistypes.ModuleName, stakingtypes.ModuleName) // NOTE: The genutils module must occur after staking so that pools are // properly initialized with tokens from genesis accounts. @@ -415,7 +372,6 @@ func New( distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, - govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, ibchost.ModuleName, @@ -602,7 +558,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(minttypes.ModuleName) paramsKeeper.Subspace(distrtypes.ModuleName) paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) paramsKeeper.Subspace(crisistypes.ModuleName) paramsKeeper.Subspace(ibctransfertypes.ModuleName) paramsKeeper.Subspace(ibchost.ModuleName) From 0d0b88a989b182b3876cbb501291a9b6f798f2d1 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Thu, 30 Sep 2021 11:51:22 -0500 Subject: [PATCH 13/17] delete unsused files Co-authored-by: Nguyen Nhu Viet --- x/payment/genesis_test.go | 14 -------------- x/payment/keeper/grpc_query.go | 7 ------- x/payment/keeper/msg_server_test.go | 6 ------ x/payment/types/expected_keepers.go | 1 - x/payment/types/types.go | 1 - 5 files changed, 29 deletions(-) delete mode 100755 x/payment/genesis_test.go delete mode 100755 x/payment/keeper/grpc_query.go delete mode 100755 x/payment/keeper/msg_server_test.go delete mode 100755 x/payment/types/expected_keepers.go delete mode 100755 x/payment/types/types.go diff --git a/x/payment/genesis_test.go b/x/payment/genesis_test.go deleted file mode 100755 index bd51eb9939..0000000000 --- a/x/payment/genesis_test.go +++ /dev/null @@ -1,14 +0,0 @@ -package payment_test - -// func TestGenesis(t *testing.T) { -// genesisState := types.GenesisState{ -// // this line is used by starport scaffolding # genesis/test/state -// } - -// k, ctx := keepertest.PaymentKeeper(t) -// payment.InitGenesis(ctx, *k, genesisState) -// got := payment.ExportGenesis(ctx, *k) -// require.NotNil(t, got) - -// // this line is used by starport scaffolding # genesis/test/assert -// } diff --git a/x/payment/keeper/grpc_query.go b/x/payment/keeper/grpc_query.go deleted file mode 100755 index f5e93a4906..0000000000 --- a/x/payment/keeper/grpc_query.go +++ /dev/null @@ -1,7 +0,0 @@ -package keeper - -import ( - "github.com/celestiaorg/celestia-app/x/payment/types" -) - -var _ types.QueryServer = Keeper{} diff --git a/x/payment/keeper/msg_server_test.go b/x/payment/keeper/msg_server_test.go deleted file mode 100755 index 035d477956..0000000000 --- a/x/payment/keeper/msg_server_test.go +++ /dev/null @@ -1,6 +0,0 @@ -package keeper_test - -// func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { -// k, ctx := keepertest.PaymentKeeper(t) -// return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) -// } diff --git a/x/payment/types/expected_keepers.go b/x/payment/types/expected_keepers.go deleted file mode 100755 index ab1254f4c2..0000000000 --- a/x/payment/types/expected_keepers.go +++ /dev/null @@ -1 +0,0 @@ -package types diff --git a/x/payment/types/types.go b/x/payment/types/types.go deleted file mode 100755 index ab1254f4c2..0000000000 --- a/x/payment/types/types.go +++ /dev/null @@ -1 +0,0 @@ -package types From 5ca9dc244ca1394bc79170d8d637ed637459a9b8 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Thu, 30 Sep 2021 11:59:00 -0500 Subject: [PATCH 14/17] shorten address prefix Co-authored-by: Nguyen Nhu Viet --- app/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/app.go b/app/app.go index e416bdc72a..dceb42ef4f 100755 --- a/app/app.go +++ b/app/app.go @@ -82,7 +82,7 @@ import ( ) const ( - AccountAddressPrefix = "celest" + AccountAddressPrefix = "celes" Name = "celestia-app" ) From 83044f3eabd26ddd1d1fbdff26662d7c820f4fd5 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Mon, 4 Oct 2021 07:35:29 -0500 Subject: [PATCH 15/17] update go mod tag to use sdk v0.44.1-celestia --- go.mod | 10 +++++----- go.sum | 45 ++++++++++++++++++++++++++++++--------------- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 61d1b2235b..291c73636d 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( github.com/coinbase/rosetta-sdk-go v0.6.10 // indirect github.com/confio/ics23/go v0.6.6 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/iavl v0.16.0 // indirect + github.com/cosmos/iavl v0.17.1 // indirect github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect github.com/cosmos/ledger-go v0.9.2 // indirect github.com/danieljoos/wincred v1.0.2 // indirect @@ -74,14 +74,14 @@ require ( github.com/hashicorp/golang-lru v0.5.4 // 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.0 // indirect + github.com/improbable-eng/grpc-web v0.14.1 // indirect github.com/inconshreveable/mousetrap v1.0.0 // 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.10.3 // indirect + github.com/klauspost/compress v1.11.7 // indirect github.com/libp2p/go-buffer-pool v0.0.2 // indirect github.com/magiconair/properties v1.8.5 // indirect - github.com/mattn/go-isatty v0.0.13 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect github.com/minio/highwayhash v1.0.1 // indirect @@ -124,7 +124,7 @@ require ( replace ( github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 - github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v0.40.0-rc5.0.20210929155038-f1d7264b323c + github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v0.44.1-celestia github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/tendermint/tendermint v0.34.13 => github.com/celestiaorg/celestia-core v0.34.12-tendermint-base google.golang.org/grpc => google.golang.org/grpc v1.33.2 diff --git a/go.sum b/go.sum index 313d6dd057..d1ace86f4b 100644 --- a/go.sum +++ b/go.sum @@ -126,8 +126,8 @@ github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46f github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/celestiaorg/celestia-core v0.34.12-tendermint-base h1:BbsGOuX2F6V5wOGc3z1vtCYvGzfRUicCA71p5GMddjo= github.com/celestiaorg/celestia-core v0.34.12-tendermint-base/go.mod h1:D2KttOyf7W8ICTTd9pIotJRQ04Cqi0MA7S8ZpLqK4Wk= -github.com/celestiaorg/cosmos-sdk v0.40.0-rc5.0.20210929155038-f1d7264b323c h1:BWgI5mWznKoo6jBMJcL7U0/yGrWJUIKM4VdKm1FmvdU= -github.com/celestiaorg/cosmos-sdk v0.40.0-rc5.0.20210929155038-f1d7264b323c/go.mod h1:rnuMUNznGfdExz+9+s5lSTeBM4lCZAYB6vXxPtlX4QQ= +github.com/celestiaorg/cosmos-sdk v0.44.1-celestia h1:WbNV1I4L7oudA38lZ+7ILnWElfDIbdZdNp3jHBvIXgU= +github.com/celestiaorg/cosmos-sdk v0.44.1-celestia/go.mod h1:YVeOYCHyYj6Ig58sB9wxpu2hxzdI+apUtQ+hrp308kg= github.com/celestiaorg/go-leopard v0.1.0 h1:28z2EkvKJIez5J9CEaiiUEC+OxalRLtTGJJ1oScfE1g= github.com/celestiaorg/go-leopard v0.1.0/go.mod h1:NtO/rjlB8dw2aq7jr06vZFKGvryQcTDXaNHelmPNOAM= github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 h1:CJdIpo8n5MFP2MwK0gSRcOVlDlFdQJO1p+FqdxYzmvc= @@ -176,8 +176,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE= github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I= github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mVvSA4= -github.com/cosmos/iavl v0.16.0 h1:ICIOB8xysirTX27GmVAaoeSpeozzgSu9d49w36xkVJA= -github.com/cosmos/iavl v0.16.0/go.mod h1:2A8O/Jz9YwtjqXMO0CjnnbTYEEaovE8jWcwrakH3PoE= +github.com/cosmos/iavl v0.17.1 h1:b/Cl8h1PRMvsu24+TYNlKchIu7W6tmxIBGe6E9u2Ybw= +github.com/cosmos/iavl v0.17.1/go.mod h1:7aisPZK8yCpQdy3PMvKeO+bhq1NwDjUwjzxwwROUxFk= github.com/cosmos/ibc-go v1.2.0 h1:0RgxmKzCzIH9SwDp4ckL5VrzlO1KJ5hO0AsOAzOiWE4= github.com/cosmos/ibc-go v1.2.0/go.mod h1:wGjeNd+T4kpGrt0OC8DTiE/qXLrlmTPNpdoYsBZUjKI= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= @@ -280,6 +280,7 @@ github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5Nq github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= @@ -448,8 +449,8 @@ github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7 github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/improbable-eng/grpc-web v0.14.0 h1:GdoK+cXABdB+1keuqsV1drSFO2XLYIxqt/4Rj8SWGBk= -github.com/improbable-eng/grpc-web v0.14.0/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6OL4eEvELdran/3cs= +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/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= @@ -458,8 +459,8 @@ github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH 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= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.8.2 h1:k2xE7wcUomeqwY0LDCYA16y4WWfyTcMx5mKhk0d4ua0= -github.com/jhump/protoreflect v1.8.2/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= +github.com/jhump/protoreflect v1.9.0 h1:npqHz788dryJiR/l6K/RUQAyh2SwV91+d1dnh4RjO9w= +github.com/jhump/protoreflect v1.9.0/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= @@ -487,8 +488,9 @@ github.com/kisielk/errcheck v1.5.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.10.3 h1:OP96hzwJVBIHYU52pVTI6CczrxPvrGfgqF9N5eTO0Q8= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.11.7 h1:0hzRabrMN4tSTvMfnL3SCv1ZGeAP23ynzodBgaHeMeg= +github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= 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.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -522,8 +524,8 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx 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.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= -github.com/mattn/go-isatty v0.0.13/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-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= @@ -556,6 +558,7 @@ github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ib github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -568,8 +571,9 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -579,13 +583,16 @@ github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= +github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= 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= @@ -650,6 +657,7 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.29.0 h1:3jqPBvKT4OHAbje2Ql7KeaaSicDBCxMYwEJU1zRJceE= github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= @@ -660,6 +668,7 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= @@ -699,6 +708,7 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= @@ -770,7 +780,6 @@ github.com/tendermint/spm v0.1.5/go.mod h1:+rHrI1axfSX1R0DY6KA4IbrHPgJ0WVNJKhey7 github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4= github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg= github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ= -github.com/tendermint/tendermint v0.34.10/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= github.com/tendermint/tendermint v0.34.12/go.mod h1:aeHL7alPh4uTBIJQ8mgFEE8VwJLXI1VD3rVOmH2Mcy0= 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= @@ -866,6 +875,7 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/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-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -955,6 +965,7 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v 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-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1039,6 +1050,7 @@ golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1051,6 +1063,7 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20210927094055-39ccf1dd6fa6 h1:foEbQz/B0Oz6YIqu/69kfXPYeFQAuuMYFkjaqXzl5Wo= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -1124,6 +1137,7 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= @@ -1206,6 +1220,7 @@ google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= From bcabdfa2fb7517c7c23b11fed8d7fee745f12665 Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 6 Oct 2021 17:59:10 -0500 Subject: [PATCH 16/17] change permissions back from starport generation --- app/app.go | 0 app/export.go | 0 app/genesis.go | 0 cmd/celestia-appd/main.go | 0 x/payment/client/cli/query.go | 0 x/payment/client/cli/tx.go | 0 x/payment/client/cli/tx_wire_pay_for_message.go | 0 x/payment/genesis.go | 0 x/payment/handler.go | 0 x/payment/keeper/keeper.go | 0 x/payment/keeper/msg_server.go | 0 x/payment/module.go | 0 x/payment/types/codec.go | 0 x/payment/types/errors.go | 0 x/payment/types/genesis.go | 0 x/payment/types/genesis_test.go | 0 x/payment/types/keys.go | 0 17 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 app/app.go mode change 100755 => 100644 app/export.go mode change 100755 => 100644 app/genesis.go mode change 100755 => 100644 cmd/celestia-appd/main.go mode change 100755 => 100644 x/payment/client/cli/query.go mode change 100755 => 100644 x/payment/client/cli/tx.go mode change 100755 => 100644 x/payment/client/cli/tx_wire_pay_for_message.go mode change 100755 => 100644 x/payment/genesis.go mode change 100755 => 100644 x/payment/handler.go mode change 100755 => 100644 x/payment/keeper/keeper.go mode change 100755 => 100644 x/payment/keeper/msg_server.go mode change 100755 => 100644 x/payment/module.go mode change 100755 => 100644 x/payment/types/codec.go mode change 100755 => 100644 x/payment/types/errors.go mode change 100755 => 100644 x/payment/types/genesis.go mode change 100755 => 100644 x/payment/types/genesis_test.go mode change 100755 => 100644 x/payment/types/keys.go diff --git a/app/app.go b/app/app.go old mode 100755 new mode 100644 diff --git a/app/export.go b/app/export.go old mode 100755 new mode 100644 diff --git a/app/genesis.go b/app/genesis.go old mode 100755 new mode 100644 diff --git a/cmd/celestia-appd/main.go b/cmd/celestia-appd/main.go old mode 100755 new mode 100644 diff --git a/x/payment/client/cli/query.go b/x/payment/client/cli/query.go old mode 100755 new mode 100644 diff --git a/x/payment/client/cli/tx.go b/x/payment/client/cli/tx.go old mode 100755 new mode 100644 diff --git a/x/payment/client/cli/tx_wire_pay_for_message.go b/x/payment/client/cli/tx_wire_pay_for_message.go old mode 100755 new mode 100644 diff --git a/x/payment/genesis.go b/x/payment/genesis.go old mode 100755 new mode 100644 diff --git a/x/payment/handler.go b/x/payment/handler.go old mode 100755 new mode 100644 diff --git a/x/payment/keeper/keeper.go b/x/payment/keeper/keeper.go old mode 100755 new mode 100644 diff --git a/x/payment/keeper/msg_server.go b/x/payment/keeper/msg_server.go old mode 100755 new mode 100644 diff --git a/x/payment/module.go b/x/payment/module.go old mode 100755 new mode 100644 diff --git a/x/payment/types/codec.go b/x/payment/types/codec.go old mode 100755 new mode 100644 diff --git a/x/payment/types/errors.go b/x/payment/types/errors.go old mode 100755 new mode 100644 diff --git a/x/payment/types/genesis.go b/x/payment/types/genesis.go old mode 100755 new mode 100644 diff --git a/x/payment/types/genesis_test.go b/x/payment/types/genesis_test.go old mode 100755 new mode 100644 diff --git a/x/payment/types/keys.go b/x/payment/types/keys.go old mode 100755 new mode 100644 From b51edd2d5fedb6bbbb9e3de5f5cb53cf58c887da Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Wed, 6 Oct 2021 18:03:22 -0500 Subject: [PATCH 17/17] delete unused error --- x/payment/types/errors.go | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 x/payment/types/errors.go diff --git a/x/payment/types/errors.go b/x/payment/types/errors.go deleted file mode 100644 index eff60122be..0000000000 --- a/x/payment/types/errors.go +++ /dev/null @@ -1,12 +0,0 @@ -package types - -// DONTCOVER - -import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// x/payment module sentinel errors -var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") -)