From 9afafdb1b5e136d3a46b81f1a6ffb026df565b2e Mon Sep 17 00:00:00 2001 From: evan-forbes Date: Thu, 11 Feb 2021 18:50:46 -0600 Subject: [PATCH] integrate PayForMessage into PreprocessTxs delete unused utility func change the respone type name to appease the linter go mod tidy app: just save the encoding config instead of the only the tx encoder and decoders types: register PayForMessage types in the codec registry break up testing into two chunks. document process add a sanity check for signing and verifying signatures lazyledgerapp: sign the commit bytes instead of the message bytes add genesis accounts, and attempt to debug why the signature data is getting erased clean up tests a bit, and fix bug causing the inability to verify the signature app: add sorting by namespace ids for returned core.Messages clean up unused code slight reorg of tests unused code caught by linter only pass successfully processed txs update test fix accidental changes to go.mod mod.go: fixed the dep that was causing weird ci errors and failed proto generation init simapp flags when testing run make build --- app/abci.go | 141 +++++-- app/abci_test.go | 432 ++++++++++++++++---- app/app.go | 9 +- go.mod | 12 +- go.sum | 95 +++-- proto/lazyledgerapp/tx.proto | 4 +- x/lazyledgerapp/keeper/keeper.go | 4 +- x/lazyledgerapp/types/codec.go | 6 +- x/lazyledgerapp/types/payformessage.go | 18 +- x/lazyledgerapp/types/payformessage_test.go | 4 +- x/lazyledgerapp/types/tx.pb.go | 130 +++--- x/lazyledgerapp/types/tx.pb.gw.go | 7 +- 12 files changed, 615 insertions(+), 247 deletions(-) diff --git a/app/abci.go b/app/abci.go index 74b9223642..38d1fa8b2a 100644 --- a/app/abci.go +++ b/app/abci.go @@ -1,6 +1,12 @@ package app import ( + "bytes" + "errors" + "fmt" + "sort" + + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/lazyledger/lazyledger-app/x/lazyledgerapp/types" abci "github.com/lazyledger/lazyledger-core/abci/types" core "github.com/lazyledger/lazyledger-core/proto/tendermint/types" @@ -13,75 +19,142 @@ import ( // share messages from transactions // todo(evan): refactor out a for loop. 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.txDecoder(rawTx) + tx, err := app.txConfig.TxDecoder()(rawTx) if err != nil { continue } - // run basic validation on the transaction - err = tx.ValidateBasic() - if err != nil { + // don't do anything if the transaction doesn't contain a PayForMessage sdk.Msg + if !hasWirePayForMessage(tx) { + processedTxs = append(processedTxs, rawTx) continue } - // don't allow transactions with multiple messages to be ran + // only support transactions that contain a single sdk.Msg for now if len(tx.GetMsgs()) != 1 { continue } msg := tx.GetMsgs()[0] - // run basic validation on the msg - err = msg.ValidateBasic() + // run basic validation on the transaction + err = tx.ValidateBasic() if err != nil { continue } - // quickly check the stated type of the message - if msg.Type() != types.TypeMsgPayforMessage { + // process and validate the message + coreMsg, signedTx, err := app.processMsg(msg) + if err != nil { continue } - // double check the actual type of the message - wireMsg, ok := msg.(*types.MsgWirePayForMessage) - if !ok { + // execute the tx in runTxModeDeliver mode (3) + // execution includes all validation checks burning fees + // currently, no fees are burned + _, _, err = app.BaseApp.TxRunner()(3, rawTx) + if err != nil { + continue } - // todo(evan): this needs to turn the transaction into a SignedTransactionDataPayForMessage - // // discard the share commitments that won't be used - // var shareCommit types.ShareCommitAndSignature - // for _, commit := range wireMsg.MessageShareCommitment { - // if commit.K == app.SquareSize() { - // shareCommit = commit - // break - // } - // } + // increment the share counter by the number of shares taken by the message + sharesTaken := uint64(len(coreMsg.Data) / 256) + shareCounter += sharesTaken - // make sure to get rid of excess txs or do something with them + // if there are too many shares stop processing and return the transactions + // this is related to issues 67 and 77 of lazyledger-core + if shareCounter > squareSize { + break + } - // execute the tx in runTxModeDeliver mode (3) - // execution includes all validation checks burning fees - _, _, err = app.BaseApp.TxRunner()(3, rawTx) + // encode the processed tx + rawProcessedTx, err := app.appCodec.MarshalBinaryBare(signedTx) if err != nil { continue } - // the message is valid and paid for, include it in the response - shareMsgs = append( - shareMsgs, - &core.Message{ - NamespaceId: wireMsg.GetMessageNameSpaceId(), - Data: wireMsg.Message, - }, - ) + // add the message and tx to the output + shareMsgs = append(shareMsgs, &coreMsg) + processedTxs = append(processedTxs, rawProcessedTx) } + // sort messages lexographically + sort.Slice(shareMsgs, func(i, j int) bool { + return bytes.Compare(shareMsgs[i].NamespaceId, shareMsgs[j].NamespaceId) < 0 + }) + return abci.ResponsePreprocessTxs{ - Txs: txs.Txs, + 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) + } + + // run basic validation on the msg + err := wireMsg.ValidateBasic() + if err != nil { + return core.Message{}, nil, err + } + + // 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 index c857a0f116..3d3e891fea 100644 --- a/app/abci_test.go +++ b/app/abci_test.go @@ -1,62 +1,308 @@ package app import ( + "bytes" + "encoding/json" + "fmt" "os" "testing" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client/flags" + cliTx "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/server" + "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "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/lazyledger/lazyledger-app/x/lazyledgerapp/types" abci "github.com/lazyledger/lazyledger-core/abci/types" "github.com/lazyledger/lazyledger-core/libs/log" + core "github.com/lazyledger/lazyledger-core/proto/tendermint/types" "github.com/spf13/cast" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" ) -// this test doesn't currently test anything, but it's a good starting template -func TestPreProcessTxs(t *testing.T) { - testApp := setupApp() - basicTx := &types.MsgWirePayForMessage{ - MessageSize: 4, - Message: []byte{1, 2, 3, 4}, - MessageNameSpaceId: []byte{1, 2, 3, 4}, - From: "cosmos1tg66f06v0jh42g5wxnht9a5fqqj0lu78n37ss5", +// TODO: +// - flesh tests with more cases +// - test for when the tx should fail + +// Get flags every time the simulator is run +func init() { + simapp.GetSimulatorFlags() +} + +func TestProcessMsg(t *testing.T) { + key := secp256k1.GenPrivKey() + + testApp := setupApp(t) + + 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") } - rawBasicTx, err := testApp.txEncoder(txTest{[]sdk.Msg{basicTx}}) + + genesisState := NewDefaultGenesisState() + + genesisState, err := addGenesisAccount(sdk.AccAddress(key.PubKey().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, + }, + ) + + // create a tx + msg := generateWirePayForMessage(t, testApp.SquareSize(), key) + tests := []struct { name string - args abci.RequestPreprocessTxs - want abci.ResponsePreprocessTxs + args sdk.Msg + want core.Message }{ { name: "basic", - args: abci.RequestPreprocessTxs{ - Txs: [][]byte{rawBasicTx}, - }, + args: msg, + want: core.Message{NamespaceId: msg.MessageNameSpaceId, Data: msg.Message}, }, } for _, tt := range tests { - result := testApp.PreprocessTxs(tt.args) + result, _, err := testApp.processMsg(tt.args) + if err != nil { + t.Error(err) + } assert.Equal(t, tt.want, result, tt.name) } } -func generateTxs() [][]byte { - return [][]byte{} +// this belongs in the lazyledgerapp/simulation package +func TestRunTx(t *testing.T) { + key := secp256k1.GenPrivKey() + + testApp := setupApp(t) + + 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() + + // give the key a bunch a coins for testing + genesisState, err := addGenesisAccount(sdk.AccAddress(key.PubKey().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, + ChainId: "test-chain", + }, + ) + + // create a msg + msg := generateWirePayForMessage(t, 64, key) + + // this is returning a tx.wrapper + builder := testApp.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: key.PubKey(), + Data: &sigData, + Sequence: 0, + } + + // set the empty signature + err = builder.SetSignatures(sig) + if err != nil { + if err != nil { + t.Error(err) + } + } + + // create the actual signature + sigV2, err := cliTx.SignWithPrivKey(signing.SignMode_SIGN_MODE_DIRECT, signingData, builder, key, testApp.txConfig, 0) + if err != nil { + t.Error(err) + } + + // set the actual signature + err = builder.SetSignatures(sigV2) + if err != nil { + if err != nil { + t.Error(err) + } + } + + // finish the tx + tx := builder.GetTx() + + // verify the signature before encoding + err = authsigning.VerifySignature(key.PubKey(), signingData, sigV2.Data, testApp.txConfig.SignModeHandler(), tx) + if err != nil { + t.Error(err) + } + + rawTx, err := testApp.txConfig.TxEncoder()(tx) + if err != nil { + t.Error(err) + } + + tests := []struct { + name string + input []byte + want core.Message + mode uint8 + }{ + { + name: "basic", + mode: 3, + input: rawTx, + want: core.Message{NamespaceId: msg.MessageNameSpaceId, Data: msg.Message}, + }, + } + + for _, tt := range tests { + _, _, err := testApp.TxRunner()(3, tt.input) + assert.NoError(t, err, "failure to validate and run tx") + } } -func setupApp() *App { +// this is more of a sanity check +func TestTxSignature(t *testing.T) { + key := secp256k1.GenPrivKey() + + encConf := MakeEncodingConfig() + txConf := encConf.TxConfig + + // create a msg + msg := generateWirePayForMessage(t, 64, key) + + // this is returning a tx.wrapper + builder := txConf.NewTxBuilder() + err := builder.SetMsgs(msg) + if err != nil { + t.Error(err) + } + + signingData := authsigning.SignerData{ + ChainID: "test-chain", + AccountNumber: 0, + Sequence: 0, + } + + sigData := signing.SingleSignatureData{ + SignMode: signing.SignMode_SIGN_MODE_DIRECT, + Signature: nil, + } + + sig := signing.SignatureV2{ + PubKey: key.PubKey(), + Data: &sigData, + Sequence: 0, + } + + // set the unsigned signature data (nil) first + // this is required for SignWithPriveKey to sign properly + err = builder.SetSignatures(sig) + if err != nil { + if err != nil { + t.Error(err) + } + } + + sigV2, err := cliTx.SignWithPrivKey(signing.SignMode_SIGN_MODE_DIRECT, signingData, builder, key, txConf, 0) + if err != nil { + t.Error(err) + } + + err = builder.SetSignatures(sigV2) + if err != nil { + if err != nil { + t.Error(err) + } + } + + tx := builder.GetTx() + + err = authsigning.VerifySignature(key.PubKey(), signingData, sigV2.Data, txConf.SignModeHandler(), tx) + if err != nil { + t.Error("failure to verify Signature") + } + + rawTx, err := txConf.TxEncoder()(tx) + if err != nil { + t.Error(err) + } + + stx, err := txConf.TxDecoder()(rawTx) + if err != nil { + t.Error(err) + } + + // verify the signature after decoding + err = authsigning.VerifySignature(key.PubKey(), signingData, sigV2.Data, txConf.SignModeHandler(), stx) + if err != nil { + t.Error(err) + } +} + +///////////////////////////// +// Setup App +///////////////////////////// + +func setupApp(t *testing.T) *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.Stdout)) + logger := log.NewTMLogger(log.NewSyncWriter(os.Stderr)) skipUpgradeHeights := make(map[int64]bool) @@ -64,8 +310,9 @@ func setupApp() *App { "test-app", logger, db, nil, true, skipUpgradeHeights, cast.ToString(emptyOpts.Get(flags.FlagHome)), cast.ToUint(emptyOpts.Get(server.FlagInvCheckPeriod)), - MakeEncodingConfig(), // Ideally, we would reuse the one created by NewRootCmd. + MakeEncodingConfig(), emptyOpts, + anteOpt, ) } @@ -76,63 +323,110 @@ 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 +} + ///////////////////////////// // Generate Txs ///////////////////////////// -func generateRawTxs(t *testing.T, count int, txEncoder sdk.TxEncoder) [][]byte { - output := make([][]byte, count) - for i := 0; i < count; i++ { - // create the tx - tx := newTxCounter(int64(i), int64(i)) - // encode the tx - raw, err := txEncoder(tx) - if err != nil { - t.Error(err) - } - output[i] = raw - } - return output -} +func generateWirePayForMessage(t *testing.T, k uint64, key *secp256k1.PrivKey) *types.MsgWirePayForMessage { + pubKey := key.PubKey() -// Simple tx with a list of Msgs. -type txTest struct { - Msgs []sdk.Msg -} + message := bytes.Repeat([]byte{2}, 512) + nsp := []byte{1, 1, 1, 1, 1, 1, 1, 1} -// Implements Tx -func (tx txTest) GetMsgs() []sdk.Msg { return tx.Msgs } -func (tx txTest) ValidateBasic() error { return nil } + commit, err := types.CreateCommit(k, nsp, message) + if err != nil { + t.Error(err) + } -// ValidateBasic() fails on negative counters. -// Otherwise it's up to the handlers -type msgCounter struct { - Counter int64 - FailOnHandler bool -} + msg := &types.MsgWirePayForMessage{ + Fee: &types.TransactionFee{}, + Nonce: 0, + MessageNameSpaceId: nsp, + MessageSize: 512, + Message: message, + PublicKey: pubKey.Bytes(), + MessageShareCommitment: []types.ShareCommitAndSignature{ + { + K: k, + ShareCommitment: commit, + }, + }, + } -// dummy implementation of proto.Message -func (msg msgCounter) Reset() {} -func (msg msgCounter) String() string { return "TODO" } -func (msg msgCounter) ProtoMessage() {} - -// Implements Msg -func (msg msgCounter) Route() string { return "lazyledgerapp" } -func (msg msgCounter) Type() string { return types.TypeMsgPayforMessage } -func (msg msgCounter) GetSignBytes() []byte { return nil } -func (msg msgCounter) GetSigners() []sdk.AccAddress { return nil } -func (msg msgCounter) ValidateBasic() error { - if msg.Counter >= 0 { - return nil - } - return sdkerrors.Wrap(sdkerrors.ErrInvalidSequence, "counter should be a non-negative integer") -} + rawTxPFM, err := msg.GetCommitSignBytes(k) + if err != nil { + t.Error(err) + } -func newTxCounter(counter int64, msgCounters ...int64) *txTest { - msgs := make([]sdk.Msg, 0, len(msgCounters)) - for _, c := range msgCounters { - msgs = append(msgs, msgCounter{c, false}) + signedTxPFM, err := key.Sign(rawTxPFM) + if err != nil { + t.Error(err) } - return &txTest{msgs} + msg.MessageShareCommitment[0].Signature = signedTxPFM + + return msg } diff --git a/app/app.go b/app/app.go index 612ce6f3c0..827d6870f9 100644 --- a/app/app.go +++ b/app/app.go @@ -146,8 +146,7 @@ type App struct { cdc *codec.LegacyAmino appCodec codec.Marshaler - txDecoder sdk.TxDecoder - txEncoder sdk.TxEncoder + txConfig client.TxConfig interfaceRegistry types.InterfaceRegistry invCheckPeriod uint @@ -195,8 +194,7 @@ func New( appCodec := encodingConfig.Marshaler cdc := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry - txDecoder := encodingConfig.TxConfig.TxDecoder() - txEncoder := encodingConfig.TxConfig.TxEncoder() + txConfig := encodingConfig.TxConfig bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) @@ -221,8 +219,7 @@ func New( squareSize: 64, cdc: cdc, appCodec: appCodec, - txDecoder: txDecoder, - txEncoder: txEncoder, + txConfig: txConfig, interfaceRegistry: interfaceRegistry, invCheckPeriod: invCheckPeriod, keys: keys, diff --git a/go.mod b/go.mod index 5b16ad4435..1699579d11 100644 --- a/go.mod +++ b/go.mod @@ -4,30 +4,38 @@ go 1.15 require ( github.com/cosmos/cosmos-sdk v0.40.0-rc5 + github.com/gobuffalo/packr/v2 v2.8.1 // indirect github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.4.3 github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3 // indirect github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/karrick/godirwalk v1.16.1 // indirect github.com/lazyledger/lazyledger-core v0.0.0-20210122184344-b83e6766973c github.com/lazyledger/nmt v0.1.0 + github.com/magefile/mage v1.11.0 // indirect github.com/pelletier/go-toml v1.8.0 github.com/regen-network/cosmos-proto v0.3.1 + github.com/rogpeppe/go-internal v1.7.0 // indirect github.com/rs/zerolog v1.20.0 + github.com/sirupsen/logrus v1.7.1 // indirect github.com/spf13/cast v1.3.1 github.com/spf13/cobra v1.1.3 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.6.1 github.com/tendermint/tm-db v0.6.3 golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect - golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect + golang.org/x/sync v0.0.0-20201207232520-09787c993a3a // indirect + golang.org/x/sys v0.0.0-20210216224549-f992740a1bac // indirect golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect + golang.org/x/tools v0.1.0 // indirect google.golang.org/genproto v0.0.0-20210207032614-bba0dbe2a9ea google.golang.org/grpc v1.33.2 ) replace ( - github.com/cosmos/cosmos-sdk v0.40.0-rc5 => github.com/lazyledger/cosmos-sdk v0.40.0-rc5.0.20210210133003-f5820a7732ed + github.com/cosmos/cosmos-sdk v0.40.0-rc5 => github.com/lazyledger/cosmos-sdk v0.40.0-rc5.0.20210217005603-b260792f5546 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alpha.regen.4 + golang.org/x/sys => golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // updating this dep will mess up ci and proto generation ) diff --git a/go.sum b/go.sum index 514377d17c..3576ee5e2e 100644 --- a/go.sum +++ b/go.sum @@ -198,6 +198,13 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG 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/gobuffalo/logger v1.0.3 h1:YaXOTHNPCvkqqA7w05A4v0k2tCdpr+sgFlgINbQ6gqc= +github.com/gobuffalo/logger v1.0.3/go.mod h1:SoeejUwldiS7ZsyCBphOGURmWdwUFXs0J7TCjEhjKxM= +github.com/gobuffalo/packd v1.0.0 h1:6ERZvJHfe24rfFmA9OaoKBdC7+c9sydrytMg8SdFGBM= +github.com/gobuffalo/packd v1.0.0/go.mod h1:6VTc4htmJRFB7u1m/4LeMTWjFoYrUiBkU9Fdec9hrhI= +github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg= +github.com/gobuffalo/packr/v2 v2.8.1 h1:tkQpju6i3EtMXJ9uoF5GT6kB+LMTimDWD8Xvbz6zDVA= +github.com/gobuffalo/packr/v2 v2.8.1/go.mod h1:c/PLlOuTU+p3SybaJATW3H6lX/iK7xEz5OeMf+NnJpg= 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/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= @@ -353,6 +360,10 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV 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/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= +github.com/karrick/godirwalk v1.15.8 h1:7+rWAZPn9zuRxaIqqT8Ohs2Q2Ac0msBqwRdxNCr2VVs= +github.com/karrick/godirwalk v1.15.8/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= +github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw= +github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= 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= @@ -360,6 +371,7 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o 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/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= 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= @@ -369,8 +381,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lazyledger/cosmos-sdk v0.40.0-rc5.0.20210210133003-f5820a7732ed h1:gkJ4Iu1ku7gfwx0Uh3GRzzH8wDqybAITbcl0INr3vu8= -github.com/lazyledger/cosmos-sdk v0.40.0-rc5.0.20210210133003-f5820a7732ed/go.mod h1:JVWmoRJFlFZthbwocA6GVFvS6cwoZgw02vGJr2qj6Cc= +github.com/lazyledger/cosmos-sdk v0.40.0-rc5.0.20210217005603-b260792f5546 h1:REPUOcb/gUIoC9tDibope+CxeuLOJFFH9ASouiXDDsk= +github.com/lazyledger/cosmos-sdk v0.40.0-rc5.0.20210217005603-b260792f5546/go.mod h1:xd7XFf9WnYPJiZp1XWQdITvlOtWxZClrlYHxvJeDeaU= github.com/lazyledger/go-leopard v0.0.0-20200604113236-298f93361181 h1:mUeCGuCgjZVadW4CzA2dMBq7p2BqaoCfpnKjxMmSaSE= github.com/lazyledger/go-leopard v0.0.0-20200604113236-298f93361181/go.mod h1:v1o1CRihQ9i7hizx23KK4aR79lxA6VDUIzUCfDva0XQ= github.com/lazyledger/lazyledger-core v0.0.0-20210115223437-eff282ad2592/go.mod h1:yNWM9NVGWzSqRS56TL5cVdD6fS0eoxZlCZNHRvxjneE= @@ -388,11 +400,21 @@ github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoR 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/magefile/mage v1.10.0 h1:3HiXzCUY12kh9bIuyXShaVe529fJfyqoVM42o/uom2g= +github.com/magefile/mage v1.10.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= +github.com/magefile/mage v1.11.0 h1:C/55Ywp9BpgVVclD3lRnSYCwXTYxmSppIgLeDYlNuls= +github.com/magefile/mage v1.11.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.4 h1:8KGKTcQQGm0Kv7vEbKFErAoAOFyyacLStRtQSeYtvkY= github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/markbates/errx v1.1.0 h1:QDFeR+UP95dO12JgW+tgi2UVfo0V8YBHiUIOaeBPiEI= +github.com/markbates/errx v1.1.0/go.mod h1:PLa46Oex9KNbVDZhKel8v1OT7hD5JZ2eI7AHhA0wswc= +github.com/markbates/oncer v1.0.0 h1:E83IaVAHygyndzPimgUYJjbshhDTALZyXxvk9FOlQRY= +github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI= +github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 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= @@ -528,12 +550,15 @@ github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFB github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/regen-network/cosmos-proto v0.3.0 h1:24dVpPrPi0GDoPVLesf2Ug98iK5QgVscPl0ga4Eoub0= +github.com/regen-network/cosmos-proto v0.3.0/go.mod h1:zuP2jVPHab6+IIyOx3nXHFN+euFNeS3W8XQkcdd4s7A= 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= @@ -543,6 +568,10 @@ github.com/regen-network/protobuf v1.3.2-alpha.regen.4/go.mod h1:/J8/bR1T/NXyIdQ 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/rogpeppe/go-internal v1.5.2 h1:qLvObTrvO/XRCqmkKxUlOBc48bI3efyDuAZe25QiF0w= +github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.7.0 h1:3qqXGV8nn7GJT65debw77Dzrx9sfWYgP0DDo7xcMFRk= +github.com/rogpeppe/go-internal v1.7.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= 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/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= @@ -560,6 +589,8 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.1 h1:rsizeFmZP+GYwyb4V6t6qpG7ZNWzA2bvgW/yC2xHCcg= +github.com/sirupsen/logrus v1.7.1/go.mod h1:4GuYW9TZmE769R5STWrRakJc4UqQ3+QQ95fyz7ENv1A= 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= @@ -584,6 +615,7 @@ 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.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= @@ -644,6 +676,7 @@ github.com/vivint/infectious v0.0.0-20190108171102-2455b059135b h1:dLkqBELopfQNh github.com/vivint/infectious v0.0.0-20190108171102-2455b059135b/go.mod h1:5oyMAv4hrBEKqBwORFsiqIrCNCmL2qcZLQTdJLYeYIc= 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/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 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 h1:gZfMjx7Jr6N8b7iJO4eUjDsn6xJqoyXg8D+ogdoAfKY= @@ -679,6 +712,7 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U 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-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 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= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -718,6 +752,8 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG 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.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/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= @@ -739,6 +775,7 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -764,52 +801,9 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/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= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -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-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= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed h1:J22ig1FUekjjkmZUM7pTKixYm8DvrYsvrBZdunYeIuQ= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/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 h1:9UQO31fZ+0aKQOFldThf7BKPMJTiBfWycGh/u3UoO88= -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= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= @@ -850,9 +844,14 @@ golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/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-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-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200308013534-11ec41452d41 h1:9Di9iYgOt9ThCipBxChBVhgNipDoE5mxO84rQV7D0FE= +golang.org/x/tools v0.0.0-20200308013534-11ec41452d41/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= diff --git a/proto/lazyledgerapp/tx.proto b/proto/lazyledgerapp/tx.proto index 1bf4a518ea..76aaaf374a 100644 --- a/proto/lazyledgerapp/tx.proto +++ b/proto/lazyledgerapp/tx.proto @@ -10,7 +10,7 @@ option go_package = "github.com/lazyledger/lazyledger-app/x/lazyledgerapp/types" // Msg defines the bank Msg service. service Msg { // PayForMessage allows the user to post data to made be available. - rpc PayForMessage(MsgWirePayForMessage) returns (MsgWirePayForMessageResponse) { + rpc PayForMessage(MsgWirePayForMessage) returns (MsgPayForMessageResponse) { option (google.api.http).get = "/layzyledger/lazyledgerapp/payformessage"; } } @@ -28,7 +28,7 @@ message MsgWirePayForMessage { } // WirePayForMessageResponse describes the response returned after the submission of a MsgWirePayForMessage -message MsgWirePayForMessageResponse {} +message MsgPayForMessageResponse {} // ShareCommitAndSignature defines the message ShareCommitAndSignature { diff --git a/x/lazyledgerapp/keeper/keeper.go b/x/lazyledgerapp/keeper/keeper.go index d32676e0be..6ab1b0c99e 100644 --- a/x/lazyledgerapp/keeper/keeper.go +++ b/x/lazyledgerapp/keeper/keeper.go @@ -39,9 +39,9 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { } // PayForMessage moves a user's coins to the module address and burns them. -func (k Keeper) PayForMessage(goCtx context.Context, msg *types.MsgWirePayForMessage) (*types.MsgWirePayForMessageResponse, error) { +func (k Keeper) PayForMessage(goCtx context.Context, msg *types.MsgWirePayForMessage) (*types.MsgPayForMessageResponse, error) { // don't pay for fees for the first version - return &types.MsgWirePayForMessageResponse{}, nil + return &types.MsgPayForMessageResponse{}, nil } // BankKeeper restricts the funtionality of the bank keeper used in the lazyledgerapp keeper diff --git a/x/lazyledgerapp/types/codec.go b/x/lazyledgerapp/types/codec.go index 8fb9abf553..9eaf2e6154 100644 --- a/x/lazyledgerapp/types/codec.go +++ b/x/lazyledgerapp/types/codec.go @@ -3,15 +3,19 @@ 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{}, "lazyledgerapp/WirePayForMessage", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - // this line is used by starport scaffolding # 3 + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgWirePayForMessage{}, + ) } var ( diff --git a/x/lazyledgerapp/types/payformessage.go b/x/lazyledgerapp/types/payformessage.go index ccf63b4eab..e6978c5017 100644 --- a/x/lazyledgerapp/types/payformessage.go +++ b/x/lazyledgerapp/types/payformessage.go @@ -7,7 +7,6 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/lazyledger/lazyledger-core/crypto/merkle" "github.com/lazyledger/nmt" ) @@ -33,14 +32,6 @@ func (msg *MsgWirePayForMessage) Type() string { return TypeMsgPayforMessage } // interface func (msg *MsgWirePayForMessage) ValidateBasic() error { pubK := msg.PubKey() - _, err := sdk.AccAddressFromBech32(pubK.Address().String()) - if err != nil { - return sdkerrors.Wrapf( - sdkerrors.ErrInvalidAddress, - "Invalid sender address (%s)", - err, - ) - } // ensure that the namespace id is of length == 8 if len(msg.GetMessageNameSpaceId()) != 8 { @@ -92,13 +83,18 @@ func (msg *MsgWirePayForMessage) ValidateBasic() error { // GetSignBytes returns messages bytes that need to be signed in order for the // message to be valid todo(evan): follow the spec so that each share commitment // is signed, instead of the entire message +// TODO(evan): remove panic and add possibility to vary square size func (msg *MsgWirePayForMessage) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) + out, err := msg.GetCommitSignBytes(64) + if err != nil { + 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())} + return []sdk.AccAddress{sdk.AccAddress(msg.PubKey().Address().Bytes())} } // PubKey uses the string version of the public key to diff --git a/x/lazyledgerapp/types/payformessage_test.go b/x/lazyledgerapp/types/payformessage_test.go index 086dda5326..163a720947 100644 --- a/x/lazyledgerapp/types/payformessage_test.go +++ b/x/lazyledgerapp/types/payformessage_test.go @@ -92,6 +92,8 @@ func TestCreateCommit(t *testing.T) { } } +// this test only tests for changes, it doesn't actually test that the result is valid. +// todo(evan): fixme func TestGetCommitSignBytes(t *testing.T) { type test struct { msg MsgWirePayForMessage @@ -109,7 +111,7 @@ func TestGetCommitSignBytes(t *testing.T) { TipRateMax: 1000, }, }, - expected: []byte(`{"fee":{"base_rate_max":"10000","tip_rate_max":"1000"},"message_namespace_id":"AQIDBAECAwQ=","message_share_commitment":"kLkMnfL0wruFOdgRJ4KnyjJBLJWlKxbEyks8SI0cfZs=","message_size":"4","nonce":"1","type":2}`), + expected: []byte(`{"fee":{"base_rate_max":"10000","tip_rate_max":"1000"},"message_namespace_id":"AQIDBAECAwQ=","message_share_commitment":"kLkMnfL0wruFOdgRJ4KnyjJBLJWlKxbEyks8SI0cfZs=","message_size":"4","nonce":"1"}`), }, } for _, tt := range tests { diff --git a/x/lazyledgerapp/types/tx.pb.go b/x/lazyledgerapp/types/tx.pb.go index 3067091063..8b7e3c74d5 100644 --- a/x/lazyledgerapp/types/tx.pb.go +++ b/x/lazyledgerapp/types/tx.pb.go @@ -124,21 +124,21 @@ func (m *MsgWirePayForMessage) GetPublicKey() []byte { } // WirePayForMessageResponse describes the response returned after the submission of a MsgWirePayForMessage -type MsgWirePayForMessageResponse struct { +type MsgPayForMessageResponse struct { } -func (m *MsgWirePayForMessageResponse) Reset() { *m = MsgWirePayForMessageResponse{} } -func (m *MsgWirePayForMessageResponse) String() string { return proto.CompactTextString(m) } -func (*MsgWirePayForMessageResponse) ProtoMessage() {} -func (*MsgWirePayForMessageResponse) Descriptor() ([]byte, []int) { +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_4a525bbab69d1e80, []int{1} } -func (m *MsgWirePayForMessageResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgPayForMessageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgWirePayForMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgPayForMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgWirePayForMessageResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgPayForMessageResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -148,17 +148,17 @@ func (m *MsgWirePayForMessageResponse) XXX_Marshal(b []byte, deterministic bool) return b[:n], nil } } -func (m *MsgWirePayForMessageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgWirePayForMessageResponse.Merge(m, src) +func (m *MsgPayForMessageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgPayForMessageResponse.Merge(m, src) } -func (m *MsgWirePayForMessageResponse) XXX_Size() int { +func (m *MsgPayForMessageResponse) XXX_Size() int { return m.Size() } -func (m *MsgWirePayForMessageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgWirePayForMessageResponse.DiscardUnknown(m) +func (m *MsgPayForMessageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgPayForMessageResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgWirePayForMessageResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgPayForMessageResponse proto.InternalMessageInfo // ShareCommitAndSignature defines the type ShareCommitAndSignature struct { @@ -416,7 +416,7 @@ func (m *TransactionFee) GetTipRateMax() uint64 { func init() { proto.RegisterType((*MsgWirePayForMessage)(nil), "lazyledgerapp.MsgWirePayForMessage") - proto.RegisterType((*MsgWirePayForMessageResponse)(nil), "lazyledgerapp.MsgWirePayForMessageResponse") + proto.RegisterType((*MsgPayForMessageResponse)(nil), "lazyledgerapp.MsgPayForMessageResponse") proto.RegisterType((*ShareCommitAndSignature)(nil), "lazyledgerapp.ShareCommitAndSignature") proto.RegisterType((*TxSignedTransactionDataPayForMessage)(nil), "lazyledgerapp.TxSignedTransactionDataPayForMessage") proto.RegisterType((*SignedTransactionDataPayForMessage)(nil), "lazyledgerapp.SignedTransactionDataPayForMessage") @@ -426,45 +426,45 @@ func init() { func init() { proto.RegisterFile("lazyledgerapp/tx.proto", fileDescriptor_4a525bbab69d1e80) } var fileDescriptor_4a525bbab69d1e80 = []byte{ - // 600 bytes of a gzipped FileDescriptorProto + // 602 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0xce, 0x26, 0x69, 0xab, 0x4e, 0xd2, 0xdf, 0x0f, 0xad, 0x42, 0xb1, 0xaa, 0xd6, 0x04, 0x83, - 0x50, 0x00, 0x11, 0xb7, 0xe5, 0x82, 0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0x7f, 0xdd, 0x93, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x61, 0x4c, 0x17, 0xa5, 0x48, 0x05, 0x00, 0x00, + 0x10, 0xce, 0x26, 0x69, 0xab, 0x4e, 0xd2, 0xdf, 0x0f, 0xad, 0x42, 0xb1, 0xa2, 0x36, 0x04, 0x83, + 0x20, 0x20, 0x11, 0xb7, 0xe5, 0x82, 0xb8, 0x51, 0x50, 0x25, 0x54, 0x05, 0x21, 0xa7, 0x02, 0x89, + 0x8b, 0xb5, 0x71, 0xa6, 0xee, 0xaa, 0xb1, 0x77, 0xe5, 0xdd, 0x4a, 0x71, 0x8f, 0xbc, 0x00, 0x48, + 0x1c, 0x78, 0x0d, 0x1e, 0xa3, 0xc7, 0x4a, 0x70, 0xe0, 0x84, 0x50, 0xcb, 0x53, 0x70, 0x42, 0xfe, + 0x13, 0x12, 0xbb, 0x7f, 0xe8, 0x81, 0xdb, 0xee, 0xcc, 0xb7, 0xdf, 0xcc, 0x7e, 0xf3, 0x69, 0x60, + 0x79, 0xc4, 0x0e, 0xa3, 0x11, 0x0e, 0x3d, 0x0c, 0x99, 0x94, 0x96, 0x1e, 0x77, 0x65, 0x28, 0xb4, + 0xa0, 0x4b, 0xb9, 0x78, 0xb3, 0xe1, 0x09, 0x4f, 0x24, 0x19, 0x2b, 0x3e, 0xa5, 0xa0, 0xe6, 0x8a, + 0x27, 0x84, 0x37, 0x42, 0x8b, 0x49, 0x6e, 0xb1, 0x20, 0x10, 0x9a, 0x69, 0x2e, 0x02, 0x95, 0x66, + 0xcd, 0xaf, 0x65, 0x68, 0xf4, 0x94, 0xf7, 0x86, 0x87, 0xf8, 0x8a, 0x45, 0x5b, 0x22, 0xec, 0xa1, + 0x52, 0xcc, 0x43, 0x6a, 0x41, 0x65, 0x17, 0xd1, 0x20, 0x6d, 0xd2, 0xa9, 0x6d, 0xac, 0x76, 0x73, + 0x95, 0xba, 0x3b, 0x21, 0x0b, 0x14, 0x73, 0x63, 0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c8, 0x87, 0xd3, 0x56, 0xe9, 0xf8, 0xb4, 0x55, 0xfa, 0x76, 0xda, 0x2a, + 0xbd, 0x7d, 0xe2, 0x71, 0xbd, 0x77, 0x30, 0xe8, 0xba, 0xc2, 0x9f, 0x61, 0x98, 0x39, 0x3e, 0x8c, + 0xd9, 0xc6, 0x05, 0x76, 0x1d, 0x49, 0x54, 0x83, 0xf9, 0x64, 0xc7, 0x3d, 0xfa, 0x1d, 0x00, 0x00, + 0xff, 0xff, 0xd7, 0x1a, 0x00, 0x37, 0x40, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -480,7 +480,7 @@ const _ = grpc.SupportPackageIsVersion4 // 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) (*MsgWirePayForMessageResponse, error) + PayForMessage(ctx context.Context, in *MsgWirePayForMessage, opts ...grpc.CallOption) (*MsgPayForMessageResponse, error) } type msgClient struct { @@ -491,8 +491,8 @@ func NewMsgClient(cc grpc1.ClientConn) MsgClient { return &msgClient{cc} } -func (c *msgClient) PayForMessage(ctx context.Context, in *MsgWirePayForMessage, opts ...grpc.CallOption) (*MsgWirePayForMessageResponse, error) { - out := new(MsgWirePayForMessageResponse) +func (c *msgClient) PayForMessage(ctx context.Context, in *MsgWirePayForMessage, opts ...grpc.CallOption) (*MsgPayForMessageResponse, error) { + out := new(MsgPayForMessageResponse) err := c.cc.Invoke(ctx, "/lazyledgerapp.Msg/PayForMessage", in, out, opts...) if err != nil { return nil, err @@ -503,14 +503,14 @@ func (c *msgClient) PayForMessage(ctx context.Context, in *MsgWirePayForMessage, // 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) (*MsgWirePayForMessageResponse, error) + 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) (*MsgWirePayForMessageResponse, error) { +func (*UnimplementedMsgServer) PayForMessage(ctx context.Context, req *MsgWirePayForMessage) (*MsgPayForMessageResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PayForMessage not implemented") } @@ -629,7 +629,7 @@ func (m *MsgWirePayForMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgWirePayForMessageResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgPayForMessageResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -639,12 +639,12 @@ func (m *MsgWirePayForMessageResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgWirePayForMessageResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgPayForMessageResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgWirePayForMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgPayForMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -883,7 +883,7 @@ func (m *MsgWirePayForMessage) Size() (n int) { return n } -func (m *MsgWirePayForMessageResponse) Size() (n int) { +func (m *MsgPayForMessageResponse) Size() (n int) { if m == nil { return 0 } @@ -1244,7 +1244,7 @@ func (m *MsgWirePayForMessage) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgWirePayForMessageResponse) Unmarshal(dAtA []byte) error { +func (m *MsgPayForMessageResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1267,10 +1267,10 @@ func (m *MsgWirePayForMessageResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgWirePayForMessageResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgPayForMessageResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgWirePayForMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgPayForMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: diff --git a/x/lazyledgerapp/types/tx.pb.gw.go b/x/lazyledgerapp/types/tx.pb.gw.go index b3167be184..dfadd14b4d 100644 --- a/x/lazyledgerapp/types/tx.pb.gw.go +++ b/x/lazyledgerapp/types/tx.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join var ( filter_Msg_PayForMessage_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} @@ -72,14 +70,12 @@ func local_request_Msg_PayForMessage_0(ctx context.Context, marshaler runtime.Ma // 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 to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. +// 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() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -87,7 +83,6 @@ func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server return } resp, md, err := local_request_Msg_PayForMessage_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)