From 551247571f5fef5bb18a7c21bb07b25901cdf10d Mon Sep 17 00:00:00 2001 From: "Steve H. Jung" Date: Sat, 12 Feb 2022 10:14:00 +0900 Subject: [PATCH 1/6] Merge v0.42.11 --- CHANGELOG.md | 159 ++++++++++++++++ Makefile | 1 + client/context.go | 6 +- client/docs/swagger-ui/swagger.yaml | 236 +++++++++++++++++++++++- client/grpc_query.go | 5 +- client/keys/add.go | 2 +- client/keys/add_test.go | 47 ++++- client/keys/export.go | 2 +- client/keys/export_test.go | 139 +++++++++----- client/keys/import.go | 2 +- client/keys/import_test.go | 109 ++++++++--- client/keys/list_test.go | 2 - client/keys/show_test.go | 6 +- client/query.go | 14 +- client/query_test.go | 62 +++++++ crypto/keys/multisig/amino.go | 23 ++- crypto/keys/multisig/multisig_test.go | 38 +++- crypto/keys/secp256k1/secp256k1_test.go | 2 +- docs/.vuepress/enhanceApp.js | 8 + docs/core/proto-docs.md | 5 +- go.mod | 6 +- go.sum | 88 +-------- proto/lbm/bank/v1/query.proto | 2 +- proto/lbm/base/abci/v1/abci.proto | 7 + simapp/ante_handler.go | 36 ++++ simapp/app.go | 6 + simapp/simd/cmd/genaccounts.go | 21 ++- simapp/simd/cmd/genaccounts_test.go | 55 ++++-- simapp/simd/cmd/root.go | 11 +- store/cachekv/memiterator.go | 110 +++-------- store/cachekv/store.go | 109 ++++++----- store/gaskv/store.go | 4 - store/iavl/store.go | 161 +--------------- types/abci.pb.go | 179 ++++++++++++------ types/address_test.go | 20 +- types/bech32/bech32.go | 2 +- types/coin.go | 31 +++- types/coin_test.go | 27 +++ types/result.go | 52 +----- types/result_test.go | 63 +++++-- types/tx/types.go | 7 + x/auth/client/cli/cli_test.go | 81 -------- x/auth/client/cli/query.go | 6 +- x/auth/tx/service.go | 2 +- x/auth/tx/service_test.go | 12 ++ x/bank/client/rest/grpc_query_test.go | 4 +- x/bank/types/query.pb.go | 104 +++++------ x/bank/types/query.pb.gw.go | 30 ++- x/capability/module.go | 3 - x/genutil/client/cli/init.go | 1 - x/gov/client/testutil/helpers.go | 12 ++ x/gov/client/utils/utils.go | 14 -- x/ibc/core/04-channel/types/errors.go | 3 + x/ibc/core/ante/ante.go | 72 ++++++++ 54 files changed, 1410 insertions(+), 799 deletions(-) create mode 100644 client/query_test.go create mode 100644 docs/.vuepress/enhanceApp.js create mode 100644 simapp/ante_handler.go create mode 100644 x/ibc/core/ante/ante.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b0cb8f1ee..376429586e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,165 @@ if input key is empty, or input data contains empty key. * [\#8953](https://github.com/cosmos/cosmos-sdk/pull/8953) Add the `config` CLI subcommand back to the SDK, which saves client-side configuration in a `client.toml` file. +## [v0.42.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.4) - 2021-04-08 + +### Client Breaking Changes + +* [\#9026](https://github.com/cosmos/cosmos-sdk/pull/9026) By default, the `tx sign` and `tx sign-batch` CLI commands use SIGN_MODE_DIRECT to sign transactions for local pubkeys. For multisigs and ledger keys, the default LEGACY_AMINO_JSON is used. + +### Bug Fixes + +* (gRPC) [\#9015](https://github.com/cosmos/cosmos-sdk/pull/9015) Fix invalid status code when accessing gRPC endpoints. +* [\#9026](https://github.com/cosmos/cosmos-sdk/pull/9026) Fixed the bug that caused the `gentx` command to fail for Ledger keys. + +### Improvements + +* [\#9081](https://github.com/cosmos/cosmos-sdk/pull/9081) Upgrade Tendermint to v0.34.9 that includes a security issue fix for Tendermint light clients. + +## [v0.42.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.3) - 2021-03-24 + +This release fixes a security vulnerability identified in x/bank. + +## [v0.42.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.2) - 2021-03-19 + +### Improvements + +* (grpc) [\#8815](https://github.com/cosmos/cosmos-sdk/pull/8815) Add orderBy parameter to `TxsByEvents` endpoint. +* (cli) [\#8826](https://github.com/cosmos/cosmos-sdk/pull/8826) Add trust to macOS Keychain for caller app by default. +* (store) [\#8811](https://github.com/cosmos/cosmos-sdk/pull/8811) store/cachekv: use typed types/kv.List instead of container/list.List + +### Bug Fixes + +* (crypto) [\#8841](https://github.com/cosmos/cosmos-sdk/pull/8841) Fix legacy multisig amino marshaling, allowing migrations to work between v0.39 and v0.40+. +* (cli) [\#8873](https://github.com/cosmos/cosmos-sdk/pull/8873) add --output-document to multisign-batch. + +## Unreleased + +## [v0.42.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.11) - 2021-12-07 + +### Improvements + +* (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures _all_ events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution. +* [\#10327](https://github.com/cosmos/cosmos-sdk/pull/10327) Add null guard for possible nil `Amount` in tx fee `Coins` +* [\#10339](https://github.com/cosmos/cosmos-sdk/pull/10339) Improve performance of `removeZeroCoins` by only allocating memory when necessary +* (deps) [\#10376](https://github.com/cosmos/cosmos-sdk/pull/10376) Bump Tendermint to [v0.34.14](https://github.com/tendermint/tendermint/releases/tag/v0.34.14). +* (deps) [\#10654](https://github.com/cosmos/cosmos-sdk/pull/10654) Bump IAVL version to 0.17.3. +* (deps) [\#10201](https://github.com/cosmos/cosmos-sdk/pull/10201) Migrate from `enigmampc/btcutil` to `cosmos/btcutil`. + + +### Bug Fixes + +* (client) [#10226](https://github.com/cosmos/cosmos-sdk/pull/10226) Fix --home flag parsing. + +### Client Breaking Changes + +* [\#10394](https://github.com/cosmos/cosmos-sdk/issues/10394) Fixes issue related to grpc-gateway of account balance by ibc-denom. Please use `/cosmos/bank/v1beta1/balances/{address}/by_denom?denom={DENOM or IBC-DENOM}` for querying balances by denom. + +## [v0.42.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.10) - 2021-09-28 + +### Improvements + +* (store) [\#10026](https://github.com/cosmos/cosmos-sdk/pull/10026) Improve CacheKVStore datastructures / algorithms, to no longer take O(N^2) time when interleaving iterators and insertions. +* (store) [\#10040](https://github.com/cosmos/cosmos-sdk/pull/10040) Bump IAVL to v0.17.1 which includes performance improvements on a batch load. +* [\#10211](https://github.com/cosmos/cosmos-sdk/pull/10211) Backport of the mechanism to reject redundant IBC transactions from [ibc-go \#235](https://github.com/cosmos/ibc-go/pull/235). + +### Bug Fixes + +* [\#9969](https://github.com/cosmos/cosmos-sdk/pull/9969) fix: use keyring in config for add-genesis-account cmd. +* [\#10061](https://github.com/cosmos/cosmos-sdk/pull/10061) Ensure that `LegacyAminoPubKey` struct correctly unmarshals from JSON + +### Client Breaking Changes + +* [\#9879](https://github.com/cosmos/cosmos-sdk/pull/9879) Modify ABCI Queries to use `abci.QueryRequest` Height field if it is non-zero, otherwise continue using context height. + +### API Breaking Changes + ++ [\#10077](https://github.com/cosmos/cosmos-sdk/pull/10077) Remove telemetry on `GasKV` and `CacheKV` store Get/Set operations, significantly improving their performance. + +## [v0.42.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.9) - 2021-08-04 + +### Bug Fixes + +* [\#9835](https://github.com/cosmos/cosmos-sdk/pull/9835) Moved capability initialization logic to BeginBlocker to fix nondeterminsim issue mentioned in [\#9800](https://github.com/cosmos/cosmos-sdk/issues/9800). Applications must now include the capability module in their BeginBlocker order before any module that uses capabilities gets run. +* [\#9201](https://github.com/cosmos/cosmos-sdk/pull/9201) Fixed ` init --recover` flag. + +### API Breaking Changes + +* [\#9835](https://github.com/cosmos/cosmos-sdk/pull/9835) The `InitializeAndSeal` API has not changed, however it no longer initializes the in-memory state. `InitMemStore` has been introduced to serve this function, which will be called either in `InitChain` or `BeginBlock` (whichever is first after app start). Nodes may run this version on a network running 0.42.x, however, they must update their app.go files to include the capability module in their begin blockers. + +### Client Breaking Changes + +* [\#9781](https://github.com/cosmos/cosmos-sdk/pull/9781) Improve`withdraw-all-rewards` UX when broadcast mode `async` or `async` is used. + +## [v0.42.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.8) - 2021-07-30 + +### Features + +* [\#9750](https://github.com/cosmos/cosmos-sdk/pull/9750) Emit events for tx signature and sequence, so clients can now query txs by signature (`tx.signature=''`) or by address and sequence combo (`tx.acc_seq='/'`). + +### Improvements + +* (deps) [\#9956](https://github.com/cosmos/cosmos-sdk/pull/9956) Bump Tendermint to [v0.34.12](https://github.com/tendermint/tendermint/releases/tag/v0.34.12). +* (cli) [\#9717](https://github.com/cosmos/cosmos-sdk/pull/9717) Added CLI flag `--output json/text` to `tx` cli commands. + +### Bug Fixes + +* [\#9766](https://github.com/cosmos/cosmos-sdk/pull/9766) Fix hardcoded ledger signing algorithm on `keys add` command. + +## [v0.42.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.7) - 2021-07-09 + +### Improvements + +* (baseapp) [\#9578](https://github.com/cosmos/cosmos-sdk/pull/9578) Return `Baseapp`'s `trace` value for logging error stack traces. +* (cli) [\#9593](https://github.com/cosmos/cosmos-sdk/pull/9593) Check if chain-id is blank before verifying signatures in multisign and error. + +### Bug Fixes + +* (x/ibc) [\#9640](https://github.com/cosmos/cosmos-sdk/pull/9640) Fix IBC Transfer Ack Success event as it was initially emitting opposite value. +* [\#9645](https://github.com/cosmos/cosmos-sdk/pull/9645) Use correct Prometheus format for metric labels. +* [\#9299](https://github.com/cosmos/cosmos-sdk/pull/9299) Fix `[appd] keys parse cosmos1...` freezing. +* (keyring) [\#9563](https://github.com/cosmos/cosmos-sdk/pull/9563) fix keyring kwallet backend when using with empty wallet. +* (x/capability) [\#9392](https://github.com/cosmos/cosmos-sdk/pull/9392) initialization fix, which fixes the consensus error when using statesync. + + +## [v0.42.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.6) - 2021-06-18 + +### Improvements + +* [\#9428](https://github.com/cosmos/cosmos-sdk/pull/9428) Optimize bank InitGenesis. Added `k.initBalances`. +* [\#9429](https://github.com/cosmos/cosmos-sdk/pull/9429) Add `cosmos_sdk_version` to node_info +* [\#9541](https://github.com/cosmos/cosmos-sdk/pull/9541) Bump tendermint dependency to v0.34.11. + +### Bug Fixes + +* [\#9385](https://github.com/cosmos/cosmos-sdk/pull/9385) Fix IBC `query ibc client header` cli command. Support historical queries for query header/node-state commands. +* [\#9401](https://github.com/cosmos/cosmos-sdk/pull/9401) Fixes incorrect export of IBC identifier sequences. Previously, the next identifier sequence for clients/connections/channels was not set during genesis export. This resulted in the next identifiers being generated on the new chain to reuse old identifiers (the sequences began again from 0). +* [\#9408](https://github.com/cosmos/cosmos-sdk/pull/9408) Update simapp to use correct default broadcast mode. +* [\#9513](https://github.com/cosmos/cosmos-sdk/pull/9513) Fixes testnet CLI command. Testnet now updates the supply in genesis. Previously, when using add-genesis-account and testnet together, inconsistent genesis files would be produced, as only add-genesis-account was updating the supply. +* (x/gov) [\#8813](https://github.com/cosmos/cosmos-sdk/pull/8813) fix `GET /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` to include initial deposit + +### Features + +* [\#9383](https://github.com/cosmos/cosmos-sdk/pull/9383) New CLI command `query ibc-transfer escrow-address ` to get the escrow address for a channel; can be used to then query balance of escrowed tokens +* (baseapp, types) [#\9390](https://github.com/cosmos/cosmos-sdk/pull/9390) Add current block header hash to `Context` +* (store) [\#9403](https://github.com/cosmos/cosmos-sdk/pull/9403) Add `RefundGas` function to `GasMeter` interface + +## [v0.42.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.5) - 2021-05-18 + +### Bug Fixes + +* [\#9514](https://github.com/cosmos/cosmos-sdk/issues/9514) Fix panic when retrieving the `BlockGasMeter` on `(Re)CheckTx` mode. +* [\#9235](https://github.com/cosmos/cosmos-sdk/pull/9235) CreateMembershipProof/CreateNonMembershipProof now returns an error +if input key is empty, or input data contains empty key. +* [\#9108](https://github.com/cosmos/cosmos-sdk/pull/9108) Fixed the bug with querying multisig account, which is not showing threshold and public_keys. +* [\#9345](https://github.com/cosmos/cosmos-sdk/pull/9345) Fix ARM support. +* [\#9040](https://github.com/cosmos/cosmos-sdk/pull/9040) Fix ENV variables binding to CLI flags for client config. + +### Features + +* [\#8953](https://github.com/cosmos/cosmos-sdk/pull/8953) Add the `config` CLI subcommand back to the SDK, which saves client-side configuration in a `client.toml` file. + + ## [v0.42.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.4) - 2021-04-08 ### Client Breaking Changes diff --git a/Makefile b/Makefile index a393615c0b..caa55ecf5f 100644 --- a/Makefile +++ b/Makefile @@ -451,6 +451,7 @@ proto-check-breaking: @$(DOCKER_BUF) check breaking --against $(HTTPS_GIT)#branch=main + TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc6/proto/tendermint GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master diff --git a/client/context.go b/client/context.go index 0378baa4e0..9d2e58a81d 100644 --- a/client/context.go +++ b/client/context.go @@ -1,6 +1,7 @@ package client import ( + "bufio" "encoding/json" "io" "os" @@ -61,7 +62,10 @@ func (ctx Context) WithKeyring(k keyring.Keyring) Context { // WithInput returns a copy of the context with an updated input. func (ctx Context) WithInput(r io.Reader) Context { - ctx.Input = r + // convert to a bufio.Reader to have a shared buffer between the keyring and the + // the Commands, ensuring a read from one advance the read pointer for the other. + // see https://github.com/cosmos/cosmos-sdk/issues/9566. + ctx.Input = bufio.NewReader(r) return ctx } diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 22594d81ec..0cbf8080ac 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -5251,7 +5251,7 @@ paths: format: boolean tags: - Query - '/lbm/bank/v1/balances/{address}/{denom}': + '/lbm/bank/v1/balances/{address}/by_denom': get: summary: Balance queries the balance of a single coin for a single account. operationId: Balance @@ -5309,8 +5309,8 @@ paths: type: string - name: denom description: denom is the coin denom to query balances for. - in: path - required: true + in: query + required: false type: string tags: - Query @@ -20911,6 +20911,53 @@ paths: For height == 1, it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + index: + type: boolean + format: boolean + description: >- + EventAttribute is a single key-value pair, + associated with an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx + and ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a + transaction. Note, + + these events include those emitted by processing all the + messages and those + + emitted from the ante handler. Whereas Logs contains the + events, with + + additional metadata, emitted only by processing the + messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 description: >- TxResponse defines a structure containing relevant tx data and metadata. The @@ -47026,6 +47073,51 @@ definitions: == 1, it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + index: + type: boolean + format: boolean + description: >- + EventAttribute is a single key-value pair, associated with an + event. + description: >- + Event allows application developers to attach additional information + to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, + + these events include those emitted by processing all the messages and + those + + emitted from the ante handler. Whereas Logs contains the events, with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 description: >- TxResponse defines a structure containing relevant tx data and metadata. The @@ -47465,6 +47557,52 @@ definitions: height == 1, it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + index: + type: boolean + format: boolean + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, + + these events include those emitted by processing all the messages + and those + + emitted from the ante handler. Whereas Logs contains the events, + with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 description: >- TxResponse defines a structure containing relevant tx data and metadata. The @@ -47792,6 +47930,52 @@ definitions: height == 1, it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + index: + type: boolean + format: boolean + description: >- + EventAttribute is a single key-value pair, associated with + an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a transaction. + Note, + + these events include those emitted by processing all the messages + and those + + emitted from the ante handler. Whereas Logs contains the events, + with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 description: >- TxResponse defines a structure containing relevant tx data and metadata. The @@ -48071,6 +48255,52 @@ definitions: height == 1, it's genesis time. + events: + type: array + items: + type: object + properties: + type: + type: string + attributes: + type: array + items: + type: object + properties: + key: + type: string + format: byte + value: + type: string + format: byte + index: + type: boolean + format: boolean + description: >- + EventAttribute is a single key-value pair, associated + with an event. + description: >- + Event allows application developers to attach additional + information to + + ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and + ResponseDeliverTx. + + Later, transactions may be queried using these events. + description: >- + Events defines all the events emitted by processing a + transaction. Note, + + these events include those emitted by processing all the + messages and those + + emitted from the ante handler. Whereas Logs contains the events, + with + + additional metadata, emitted only by processing the messages. + + + Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 description: >- TxResponse defines a structure containing relevant tx data and metadata. The diff --git a/client/grpc_query.go b/client/grpc_query.go index 4e5ebb78ae..bfd924a287 100644 --- a/client/grpc_query.go +++ b/client/grpc_query.go @@ -112,8 +112,9 @@ func RunGRPCQuery(ctx Context, grpcCtx gocontext.Context, method string, req int } abciReq := abci.RequestQuery{ - Path: method, - Data: reqBz, + Path: method, + Data: reqBz, + Height: ctx.Height, } abciRes, err := ctx.QueryABCI(abciReq) diff --git a/client/keys/add.go b/client/keys/add.go index b4179466eb..d596d00355 100644 --- a/client/keys/add.go +++ b/client/keys/add.go @@ -84,12 +84,12 @@ the flag --nosort is set. } func runAddCmdPrepare(cmd *cobra.Command, args []string) error { - buf := bufio.NewReader(cmd.InOrStdin()) clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } + buf := bufio.NewReader(clientCtx.Input) return RunAddCmd(clientCtx, cmd, args, buf) } diff --git a/client/keys/add_test.go b/client/keys/add_test.go index dcc2032c59..117c15c82a 100644 --- a/client/keys/add_test.go +++ b/client/keys/add_test.go @@ -9,6 +9,7 @@ import ( "github.com/line/ostracon/libs/cli" + bip39 "github.com/cosmos/go-bip39" "github.com/line/lbm-sdk/client" "github.com/line/lbm-sdk/client/flags" "github.com/line/lbm-sdk/crypto/hd" @@ -27,7 +28,7 @@ func Test_runAddCmdBasic(t *testing.T) { kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, kbHome, mockIn) require.NoError(t, err) - clientCtx := client.Context{}.WithKeyringDir(kbHome) + clientCtx := client.Context{}.WithKeyringDir(kbHome).WithInput(mockIn) ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) t.Cleanup(func() { @@ -114,3 +115,47 @@ func Test_runAddCmdBasic(t *testing.T) { mockIn.Reset("\n" + password + "\n" + "fail" + "\n") require.Error(t, cmd.ExecuteContext(ctx)) } + +func TestAddRecoverFileBackend(t *testing.T) { + cmd := AddKeyCommand() + cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + + mockIn := testutil.ApplyMockIODiscardOutErr(cmd) + kbHome := t.TempDir() + + clientCtx := client.Context{}.WithKeyringDir(kbHome).WithInput(mockIn) + ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) + + cmd.SetArgs([]string{ + "keyname1", + fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", cli.OutputFlag, OutputFormatText), + fmt.Sprintf("--%s=%s", flags.FlagKeyAlgorithm, string(hd.Secp256k1Type)), + fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendFile), + fmt.Sprintf("--%s", flagRecover), + }) + + keyringPassword := "12345678" + + entropySeed, err := bip39.NewEntropy(mnemonicEntropySize) + require.NoError(t, err) + + mnemonic, err := bip39.NewMnemonic(entropySeed) + require.NoError(t, err) + + mockIn.Reset(fmt.Sprintf("%s\n%s\n%s\n", mnemonic, keyringPassword, keyringPassword)) + require.NoError(t, cmd.ExecuteContext(ctx)) + + kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendFile, kbHome, mockIn) + require.NoError(t, err) + + t.Cleanup(func() { + mockIn.Reset(fmt.Sprintf("%s\n%s\n", keyringPassword, keyringPassword)) + _ = kb.Delete("keyname1") + }) + + mockIn.Reset(fmt.Sprintf("%s\n%s\n", keyringPassword, keyringPassword)) + info, err := kb.Key("keyname1") + require.NoError(t, err) + require.Equal(t, "keyname1", info.GetName()) +} diff --git a/client/keys/export.go b/client/keys/export.go index 461bbd5eca..748839faf7 100644 --- a/client/keys/export.go +++ b/client/keys/export.go @@ -31,11 +31,11 @@ FULLY AWARE OF THE RISKS. If you are unsure, you may want to do some research and export your keys in ASCII-armored encrypted format.`, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { - buf := bufio.NewReader(cmd.InOrStdin()) clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } + buf := bufio.NewReader(clientCtx.Input) unarmored, _ := cmd.Flags().GetBool(flagUnarmoredHex) unsafe, _ := cmd.Flags().GetBool(flagUnsafe) diff --git a/client/keys/export_test.go b/client/keys/export_test.go index 916afdafc4..d5c88175bb 100644 --- a/client/keys/export_test.go +++ b/client/keys/export_test.go @@ -1,6 +1,7 @@ package keys import ( + "bufio" "context" "fmt" "testing" @@ -17,55 +18,95 @@ import ( ) func Test_runExportCmd(t *testing.T) { - cmd := ExportKeyCommand() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) - mockIn := testutil.ApplyMockIODiscardOutErr(cmd) - - // Now add a temporary keybase - kbHome := t.TempDir() - - // create a key - kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, kbHome, mockIn) - require.NoError(t, err) - t.Cleanup(func() { - kb.Delete("keyname1") // nolint:errcheck - }) - - path := sdk.GetConfig().GetFullFundraiserPath() - _, err = kb.NewAccount("keyname1", testutil.TestMnemonic, "", path, hd.Secp256k1) - require.NoError(t, err) - - // Now enter password - args := []string{ - "keyname1", - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), - fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), + testCases := []struct { + name string + keyringBackend string + extraArgs []string + userInput string + mustFail bool + expectedOutput string + }{ + { + name: "--unsafe only must fail", + keyringBackend: keyring.BackendTest, + extraArgs: []string{"--unsafe"}, + mustFail: true, + }, + { + name: "--unarmored-hex must fail", + keyringBackend: keyring.BackendTest, + extraArgs: []string{"--unarmored-hex"}, + mustFail: true, + }, + { + name: "--unsafe --unarmored-hex fail with no user confirmation", + keyringBackend: keyring.BackendTest, + extraArgs: []string{"--unsafe", "--unarmored-hex"}, + userInput: "", + mustFail: true, + expectedOutput: "", + }, + { + name: "--unsafe --unarmored-hex succeed", + keyringBackend: keyring.BackendTest, + extraArgs: []string{"--unsafe", "--unarmored-hex"}, + userInput: "y\n", + mustFail: false, + expectedOutput: "2485e33678db4175dc0ecef2d6e1fc493d4a0d7f7ce83324b6ed70afe77f3485\n", + }, + { + name: "file keyring backend properly read password and user confirmation", + keyringBackend: keyring.BackendFile, + extraArgs: []string{"--unsafe", "--unarmored-hex"}, + // first 2 pass for creating the key, then unsafe export confirmation, then unlock keyring pass + userInput: "12345678\n12345678\ny\n12345678\n", + mustFail: false, + expectedOutput: "2485e33678db4175dc0ecef2d6e1fc493d4a0d7f7ce83324b6ed70afe77f3485\n", + }, } - mockIn.Reset("123456789\n123456789\n") - cmd.SetArgs(args) - - clientCtx := client.Context{}. - WithKeyringDir(kbHome). - WithKeyring(kb) - ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) - - require.NoError(t, cmd.ExecuteContext(ctx)) - - argsUnsafeOnly := append(args, "--unsafe") - cmd.SetArgs(argsUnsafeOnly) - require.Error(t, cmd.ExecuteContext(ctx)) - - argsUnarmoredHexOnly := append(args, "--unarmored-hex") - cmd.SetArgs(argsUnarmoredHexOnly) - require.Error(t, cmd.ExecuteContext(ctx)) - - argsUnsafeUnarmoredHex := append(args, "--unsafe", "--unarmored-hex") - cmd.SetArgs(argsUnsafeUnarmoredHex) - require.Error(t, cmd.ExecuteContext(ctx)) - - mockIn, mockOut := testutil.ApplyMockIO(cmd) - mockIn.Reset("y\n") - require.NoError(t, cmd.ExecuteContext(ctx)) - require.Equal(t, "d4bd5d54ee1b75abc6f5bab08e2e9d3a4b6dfbe6b50e2d6cf2426f3215633a1f\n", mockOut.String()) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + kbHome := t.TempDir() + defaultArgs := []string{ + "keyname1", + fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, tc.keyringBackend), + } + + cmd := ExportKeyCommand() + cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + + cmd.SetArgs(append(defaultArgs, tc.extraArgs...)) + mockIn, mockOut := testutil.ApplyMockIO(cmd) + + mockIn.Reset(tc.userInput) + mockInBuf := bufio.NewReader(mockIn) + + // create a key + kb, err := keyring.New(sdk.KeyringServiceName(), tc.keyringBackend, kbHome, bufio.NewReader(mockInBuf)) + require.NoError(t, err) + t.Cleanup(func() { + kb.Delete("keyname1") // nolint:errcheck + }) + + path := sdk.GetConfig().GetFullFundraiserPath() + _, err = kb.NewAccount("keyname1", testutil.TestMnemonic, "", path, hd.Secp256k1) + require.NoError(t, err) + + clientCtx := client.Context{}. + WithKeyringDir(kbHome). + WithKeyring(kb). + WithInput(mockInBuf) + ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) + + err = cmd.ExecuteContext(ctx) + if tc.mustFail { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tc.expectedOutput, mockOut.String()) + } + }) + } } diff --git a/client/keys/import.go b/client/keys/import.go index 380e1a69ed..04e551a425 100644 --- a/client/keys/import.go +++ b/client/keys/import.go @@ -18,11 +18,11 @@ func ImportKeyCommand() *cobra.Command { Long: "Import a ASCII armored private key into the local keybase.", Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { - buf := bufio.NewReader(cmd.InOrStdin()) clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } + buf := bufio.NewReader(clientCtx.Input) bz, err := ioutil.ReadFile(args[1]) if err != nil { diff --git a/client/keys/import_test.go b/client/keys/import_test.go index 6abacbc226..be0f68a370 100644 --- a/client/keys/import_test.go +++ b/client/keys/import_test.go @@ -3,6 +3,7 @@ package keys import ( "context" "io/ioutil" + "os" "path/filepath" "testing" @@ -15,25 +16,50 @@ import ( ) func Test_runImportCmd(t *testing.T) { - cmd := ImportKeyCommand() - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) - mockIn := testutil.ApplyMockIODiscardOutErr(cmd) + testCases := []struct { + name string + keyringBackend string + userInput string + expectError bool + }{ + { + name: "test backend success", + keyringBackend: keyring.BackendTest, + // key armor passphrase + userInput: "123456789\n", + }, + { + name: "test backend fail with wrong armor pass", + keyringBackend: keyring.BackendTest, + userInput: "987654321\n", + expectError: true, + }, + { + name: "file backend success", + keyringBackend: keyring.BackendFile, + // key armor passphrase + keyring password x2 + userInput: "123456789\n12345678\n12345678\n", + }, + { + name: "file backend fail with wrong armor pass", + keyringBackend: keyring.BackendFile, + userInput: "987654321\n12345678\n12345678\n", + expectError: true, + }, + { + name: "file backend fail with wrong keyring pass", + keyringBackend: keyring.BackendFile, + userInput: "123465789\n12345678\n87654321\n", + expectError: true, + }, + { + name: "file backend fail with no keyring pass", + keyringBackend: keyring.BackendFile, + userInput: "123465789\n", + expectError: true, + }, + } - // Now add a temporary keybase - kbHome := t.TempDir() - kb, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendTest, kbHome, mockIn) - - clientCtx := client.Context{}. - WithKeyringDir(kbHome). - WithKeyring(kb) - ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) - - require.NoError(t, err) - t.Cleanup(func() { - kb.Delete("keyname1") // nolint:errcheck - }) - - keyfile := filepath.Join(kbHome, "key.asc") armoredKey := `-----BEGIN OSTRACON PRIVATE KEY----- kdf: bcrypt salt: A278E4F0DC466EF58CC9FC3149688593 @@ -44,9 +70,48 @@ KNXMn0ZEeCZtbyNzPPdQUQBwcbueq9vx5NDqQCg= =wp9z -----END OSTRACON PRIVATE KEY----- ` - require.NoError(t, ioutil.WriteFile(keyfile, []byte(armoredKey), 0644)) - mockIn.Reset("123456789\n") - cmd.SetArgs([]string{"keyname1", keyfile}) - require.NoError(t, cmd.ExecuteContext(ctx)) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + cmd := ImportKeyCommand() + cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) + mockIn := testutil.ApplyMockIODiscardOutErr(cmd) + + // Now add a temporary keybase + kbHome := t.TempDir() + kb, err := keyring.New(sdk.KeyringServiceName(), tc.keyringBackend, kbHome, nil) + + clientCtx := client.Context{}. + WithKeyringDir(kbHome). + WithKeyring(kb). + WithInput(mockIn) + ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) + + require.NoError(t, err) + t.Cleanup(func() { + kb.Delete("keyname1") // nolint:errcheck + }) + + keyfile := filepath.Join(kbHome, "key.asc") + + require.NoError(t, ioutil.WriteFile(keyfile, []byte(armoredKey), 0644)) + + defer func() { + _ = os.RemoveAll(kbHome) + }() + + mockIn.Reset(tc.userInput) + cmd.SetArgs([]string{ + "keyname1", keyfile, + fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, tc.keyringBackend), + }) + + err = cmd.ExecuteContext(ctx) + if tc.expectError { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } } diff --git a/client/keys/list_test.go b/client/keys/list_test.go index 7f4a04c88c..c63c4f3f41 100644 --- a/client/keys/list_test.go +++ b/client/keys/list_test.go @@ -57,7 +57,6 @@ func Test_runListCmd(t *testing.T) { cmd.SetArgs([]string{ fmt.Sprintf("--%s=%s", flags.FlagHome, tt.kbDir), fmt.Sprintf("--%s=false", flagListNames), - fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) if err := cmd.ExecuteContext(ctx); (err != nil) != tt.wantErr { @@ -67,7 +66,6 @@ func Test_runListCmd(t *testing.T) { cmd.SetArgs([]string{ fmt.Sprintf("--%s=%s", flags.FlagHome, tt.kbDir), fmt.Sprintf("--%s=true", flagListNames), - fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) if err := cmd.ExecuteContext(ctx); (err != nil) != tt.wantErr { diff --git a/client/keys/show_test.go b/client/keys/show_test.go index 9c626da851..7334800b90 100644 --- a/client/keys/show_test.go +++ b/client/keys/show_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/line/ostracon/libs/cli" + ostcli "github.com/line/ostracon/libs/cli" "github.com/line/lbm-sdk/client" "github.com/line/lbm-sdk/client/flags" @@ -93,7 +93,7 @@ func TestShowCmdWithMultisigAccount(t *testing.T) { fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), fmt.Sprintf("--%s=%s", FlagBechPrefix, sdk.PrefixAccount), - fmt.Sprintf("--%s=json", cli.OutputFlag), + fmt.Sprintf("--%s=json", ostcli.OutputFlag), } var res keyring.KeyOutput @@ -124,7 +124,7 @@ func Test_runShowCmd(t *testing.T) { require.EqualError(t, cmd.ExecuteContext(ctx), "invalid is not a valid name or address: decoding bech32 failed: invalid bech32 string length 7") cmd.SetArgs([]string{"invalid1", "invalid2"}) - require.EqualError(t, cmd.ExecuteContext(ctx), "invalid1 is not a valid name or address: decoding bech32 failed: invalid index of 1") + require.EqualError(t, cmd.ExecuteContext(ctx), "invalid1 is not a valid name or address: decoding bech32 failed: invalid separator index 7") fakeKeyName1 := "runShowCmd_Key1" fakeKeyName2 := "runShowCmd_Key2" diff --git a/client/query.go b/client/query.go index cd23cd3e3c..e0c6180e55 100644 --- a/client/query.go +++ b/client/query.go @@ -50,7 +50,9 @@ func (ctx Context) QueryStore(key ostbytes.HexBytes, storeName string) ([]byte, } // QueryABCI performs a query to a Tendermint node with the provide RequestQuery. -// It returns the ResultQuery obtained from the query. +// It returns the ResultQuery obtained from the query. The height used to perform +// the query is the RequestQuery Height if it is non-zero, otherwise the context +// height is used. func (ctx Context) QueryABCI(req abci.RequestQuery) (abci.ResponseQuery, error) { return ctx.queryABCI(req) } @@ -76,8 +78,16 @@ func (ctx Context) queryABCI(req abci.RequestQuery) (abci.ResponseQuery, error) return abci.ResponseQuery{}, err } + var queryHeight int64 + if req.Height != 0 { + queryHeight = req.Height + } else { + // fallback on the context height + queryHeight = ctx.Height + } + opts := rpcclient.ABCIQueryOptions{ - Height: ctx.Height, + Height: queryHeight, Prove: req.Prove, } diff --git a/client/query_test.go b/client/query_test.go new file mode 100644 index 0000000000..07a62bc8b6 --- /dev/null +++ b/client/query_test.go @@ -0,0 +1,62 @@ +// +build norace + +package client_test + +import ( + "fmt" + + abci "github.com/line/ostracon/abci/types" + + banktypes "github.com/line/lbm-sdk/x/bank/types" +) + +func (s *IntegrationTestSuite) TestQueryABCIHeight() { + testCases := []struct { + name string + reqHeight int64 + ctxHeight int64 + expHeight int64 + }{ + { + name: "non zero request height", + reqHeight: 3, + ctxHeight: 1, // query at height 1 or 2 would cause an error + expHeight: 3, + }, + { + name: "empty request height - use context height", + reqHeight: 0, + ctxHeight: 3, + expHeight: 3, + }, + { + name: "empty request height and context height - use latest height", + reqHeight: 0, + ctxHeight: 0, + expHeight: 4, + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + s.network.WaitForHeight(tc.expHeight) + + val := s.network.Validators[0] + + clientCtx := val.ClientCtx + clientCtx = clientCtx.WithHeight(tc.ctxHeight) + + req := abci.RequestQuery{ + Path: fmt.Sprintf("store/%s/key", banktypes.StoreKey), + Height: tc.reqHeight, + Data: append(banktypes.BalancesPrefix, val.Address.Bytes()...), + Prove: true, + } + + res, err := clientCtx.QueryABCI(req) + s.Require().NoError(err) + + s.Require().Equal(tc.expHeight, res.Height) + }) + } +} diff --git a/crypto/keys/multisig/amino.go b/crypto/keys/multisig/amino.go index 853e5cb4c0..19299c1cb0 100644 --- a/crypto/keys/multisig/amino.go +++ b/crypto/keys/multisig/amino.go @@ -78,9 +78,28 @@ func (m *LegacyAminoPubKey) UnmarshalAminoJSON(tmPk tmMultisig) error { // Instead of just doing `*m = *protoPk`, we prefer to modify in-place the // existing Anys inside `m` (instead of allocating new Anys), as so not to // break the `.compat` fields in the existing Anys. + if m.PubKeys == nil { + m.PubKeys = make([]*types.Any, len(tmPk.PubKeys)) + } for i := range m.PubKeys { - m.PubKeys[i].TypeUrl = protoPk.PubKeys[i].TypeUrl - m.PubKeys[i].Value = protoPk.PubKeys[i].Value + if m.PubKeys[i] == nil { + // create the compat jsonBz value + bz, err := AminoCdc.MarshalJSON(tmPk.PubKeys[i]) + if err != nil { + return err + } + + m.PubKeys[i] = protoPk.PubKeys[i] + // UnmarshalJSON(): + // just sets the compat.jsonBz value. + // always succeeds: err == nil + if err := m.PubKeys[i].UnmarshalJSON(bz); err != nil { + return err + } + } else { + m.PubKeys[i].TypeUrl = protoPk.PubKeys[i].TypeUrl + m.PubKeys[i].Value = protoPk.PubKeys[i].Value + } } m.Threshold = protoPk.Threshold diff --git a/crypto/keys/multisig/multisig_test.go b/crypto/keys/multisig/multisig_test.go index e7a1ec95b6..d96cf98c18 100644 --- a/crypto/keys/multisig/multisig_test.go +++ b/crypto/keys/multisig/multisig_test.go @@ -17,6 +17,15 @@ import ( "github.com/line/lbm-sdk/x/auth/legacy/legacytx" ) +func generatePubKeys(n int) []cryptotypes.PubKey { + pks := make([]cryptotypes.PubKey, n) + for i := 0; i < n; i++ { + pks[i] = secp256k1.GenPrivKey().PubKey() + } + + return pks +} + func TestAddress(t *testing.T) { msg := []byte{1, 2, 3, 4} pubKeys, _ := generatePubKeysAndSignatures(5, msg) @@ -379,5 +388,32 @@ func TestAminoUnmarshalJSON(t *testing.T) { var pk cryptotypes.PubKey err := cdc.UnmarshalJSON([]byte(pkJSON), &pk) require.NoError(t, err) - require.Equal(t, uint32(3), pk.(*kmultisig.LegacyAminoPubKey).Threshold) + lpk := pk.(*kmultisig.LegacyAminoPubKey) + require.Equal(t, uint32(3), lpk.Threshold) + require.Equal(t, 5, len(pk.(*kmultisig.LegacyAminoPubKey).PubKeys)) + + for _, key := range pk.(*kmultisig.LegacyAminoPubKey).PubKeys { + require.NotNil(t, key) + pk := secp256k1.PubKey{} + err := pk.Unmarshal(key.Value) + require.NoError(t, err) + } +} + +func TestProtoMarshalJSON(t *testing.T) { + require := require.New(t) + pubkeys := generatePubKeys(3) + msig := kmultisig.NewLegacyAminoPubKey(2, pubkeys) + + registry := types.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(registry) + cdc := codec.NewProtoCodec(registry) + + bz, err := cdc.MarshalInterfaceJSON(msig) + require.NoError(err) + + var pk2 cryptotypes.PubKey + err = cdc.UnmarshalInterfaceJSON(bz, &pk2) + require.NoError(err) + require.True(pk2.Equals(msig)) } diff --git a/crypto/keys/secp256k1/secp256k1_test.go b/crypto/keys/secp256k1/secp256k1_test.go index ffd7e4c797..6a1b1a1bb2 100644 --- a/crypto/keys/secp256k1/secp256k1_test.go +++ b/crypto/keys/secp256k1/secp256k1_test.go @@ -8,7 +8,7 @@ import ( "testing" btcSecp256k1 "github.com/btcsuite/btcd/btcec" - "github.com/btcsuite/btcutil/base58" + "github.com/cosmos/btcutil/base58" "github.com/line/ostracon/crypto" ostsecp256k1 "github.com/line/ostracon/crypto/secp256k1" "github.com/stretchr/testify/assert" diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js new file mode 100644 index 0000000000..36cee6366f --- /dev/null +++ b/docs/.vuepress/enhanceApp.js @@ -0,0 +1,8 @@ +export default ({ router }) => { + router.addRoutes([ + { path: '/master/spec/*', redirect: '/master/modules/' }, + { path: '/master/spec/governance/', redirect: '/master/modules/gov/' }, + { path: '/v0.41/', redirect: '/v0.42/' }, + { path: '/v0.43/', redirect: '/v0.44/' }, + ]) +} diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 8fb484b248..4b4cf57859 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -4765,7 +4765,7 @@ Query defines the gRPC querier service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Balance` | [QueryBalanceRequest](#lbm.bank.v1.QueryBalanceRequest) | [QueryBalanceResponse](#lbm.bank.v1.QueryBalanceResponse) | Balance queries the balance of a single coin for a single account. | GET|/lbm/bank/v1/balances/{address}/{denom}| +| `Balance` | [QueryBalanceRequest](#lbm.bank.v1.QueryBalanceRequest) | [QueryBalanceResponse](#lbm.bank.v1.QueryBalanceResponse) | Balance queries the balance of a single coin for a single account. | GET|/lbm/bank/v1/balances/{address}/by_denom| | `AllBalances` | [QueryAllBalancesRequest](#lbm.bank.v1.QueryAllBalancesRequest) | [QueryAllBalancesResponse](#lbm.bank.v1.QueryAllBalancesResponse) | AllBalances queries the balance of all coins for a single account. | GET|/lbm/bank/v1/balances/{address}| | `TotalSupply` | [QueryTotalSupplyRequest](#lbm.bank.v1.QueryTotalSupplyRequest) | [QueryTotalSupplyResponse](#lbm.bank.v1.QueryTotalSupplyResponse) | TotalSupply queries the total supply of all coins. | GET|/lbm/bank/v1/supply| | `SupplyOf` | [QuerySupplyOfRequest](#lbm.bank.v1.QuerySupplyOfRequest) | [QuerySupplyOfResponse](#lbm.bank.v1.QuerySupplyOfResponse) | SupplyOf queries the supply of a single coin. | GET|/lbm/bank/v1/supply/{denom}| @@ -5070,6 +5070,9 @@ tags are stringified and the log is JSON decoded. | `gas_used` | [int64](#int64) | | Amount of gas consumed by transaction. | | `tx` | [google.protobuf.Any](#google.protobuf.Any) | | The request transaction bytes. | | `timestamp` | [string](#string) | | Time of the previous block. For heights > 1, it's the weighted median of the timestamps of the valid votes in the block.LastCommit. For height == 1, it's genesis time. | +| `events` | [ostracon.abci.Event](#ostracon.abci.Event) | repeated | Events defines all the events emitted by processing a transaction. Note, these events include those emitted by processing all the messages and those emitted from the ante handler. Whereas Logs contains the events, with additional metadata, emitted only by processing the messages. + +Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 | diff --git a/go.mod b/go.mod index d7cf469e1e..90a33e6eaf 100644 --- a/go.mod +++ b/go.mod @@ -9,16 +9,15 @@ require ( github.com/armon/go-metrics v0.3.10 github.com/bgentry/speakeasy v0.1.0 github.com/btcsuite/btcd v0.22.0-beta - github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce github.com/confio/ics23/go v0.6.6 github.com/coocood/freecache v1.2.0 + github.com/cosmos/btcutil v1.0.4 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/ledger-cosmos-go v0.11.1 github.com/dgraph-io/ristretto v0.1.0 github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b - github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 - github.com/go-kit/kit v0.12.0 + github.com/go-kit/kit v0.10.0 github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.3 github.com/golang/mock v1.6.0 @@ -35,6 +34,7 @@ require ( github.com/magiconair/properties v1.8.5 github.com/mailru/easyjson v0.7.7 github.com/mattn/go-isatty v0.0.14 + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/onsi/ginkgo v1.16.4 // indirect github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.0 diff --git a/go.sum b/go.sum index 1d3b3cb233..bd12eb570d 100644 --- a/go.sum +++ b/go.sum @@ -55,8 +55,6 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -85,7 +83,6 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb 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.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-metrics v0.3.10 h1:FR+drcQStOe+32sYyJYyZ7FIdgoGGBnwLl+flodp8Uo= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -93,12 +90,7 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI 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.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= -github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -126,9 +118,7 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= @@ -141,7 +131,6 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 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/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= @@ -168,6 +157,8 @@ 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/cosmos/btcutil v1.0.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44= +github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU= 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= @@ -182,7 +173,6 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -209,8 +199,6 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m 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 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.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= @@ -225,7 +213,6 @@ github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpm github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -234,7 +221,6 @@ github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzP github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -250,28 +236,23 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0 h1:dXFJfIHVvUcpSgDOV+Ne6t7jXri8Tfv2uOLHUZ2XNuo= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= -github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= -github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0 h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= 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-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/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= 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/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -390,7 +371,6 @@ github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uM github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -401,7 +381,6 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= @@ -439,19 +418,15 @@ github.com/herumi/bls-eth-go-binary v0.0.0-20200923072303-32b29e5d8cbf h1:Lw7EOM github.com/herumi/bls-eth-go-binary v0.0.0-20200923072303-32b29e5d8cbf/go.mod h1:luAnRm3OsMQeokhGzpYmc0ZKwawY7o87PUEP11Z7r7U= 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/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= 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/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -478,9 +453,6 @@ github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNr 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.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= 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= @@ -488,9 +460,8 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= 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/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 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= @@ -518,7 +489,6 @@ github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= @@ -535,12 +505,10 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= +github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz/0= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -550,7 +518,6 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4 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.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -564,16 +531,10 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 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/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= -github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats-server/v2 v2.5.0/go.mod h1:Kj86UtrXAL6LwYRA6H4RqzkHhK0Vcv2ZnKD5WbQ1t3g= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nats.go v1.12.1/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= 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/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= -github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= @@ -588,26 +549,22 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W 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/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= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= 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/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= 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= @@ -618,7 +575,6 @@ github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= 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/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= @@ -662,7 +618,6 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b 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/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -710,7 +665,6 @@ 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.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= @@ -747,9 +701,7 @@ github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk= github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= 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/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= -github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= @@ -799,13 +751,9 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -820,17 +768,13 @@ 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= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= 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= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= 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= @@ -844,16 +788,11 @@ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3 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-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/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-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e h1:1SzTfNOXwIS2oWiMF+6qu0OUDKb0dauo6MoDUQyu+yU= golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -951,14 +890,11 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v 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-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210917221730-978cfadd31cf h1:R150MpwJIv1MpS0N/pc+NhTM8ajzvlmxlY5OYsrevXQ= -golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/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= @@ -1072,7 +1008,6 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210917161153-d61c044b1678/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1097,8 +1032,6 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1275,7 +1208,6 @@ google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEc google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= @@ -1306,7 +1238,6 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= @@ -1345,5 +1276,4 @@ 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= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/proto/lbm/bank/v1/query.proto b/proto/lbm/bank/v1/query.proto index 83fde1490d..5c60803107 100644 --- a/proto/lbm/bank/v1/query.proto +++ b/proto/lbm/bank/v1/query.proto @@ -13,7 +13,7 @@ option go_package = "github.com/line/lbm-sdk/x/bank/types"; service Query { // Balance queries the balance of a single coin for a single account. rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/lbm/bank/v1/balances/{address}/{denom}"; + option (google.api.http).get = "/lbm/bank/v1/balances/{address}/by_denom"; } // AllBalances queries the balance of all coins for a single account. diff --git a/proto/lbm/base/abci/v1/abci.proto b/proto/lbm/base/abci/v1/abci.proto index 86b0829f0f..f8cbef9813 100644 --- a/proto/lbm/base/abci/v1/abci.proto +++ b/proto/lbm/base/abci/v1/abci.proto @@ -39,6 +39,13 @@ message TxResponse { // the timestamps of the valid votes in the block.LastCommit. For height == 1, // it's genesis time. string timestamp = 12; + // Events defines all the events emitted by processing a transaction. Note, + // these events include those emitted by processing all the messages and those + // emitted from the ante handler. Whereas Logs contains the events, with + // additional metadata, emitted only by processing the messages. + // + // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + repeated ostracon.abci.Event events = 13 [(gogoproto.nullable) = false]; } // ABCIMessageLog defines a structure containing an indexed tx ABCI message log. diff --git a/simapp/ante_handler.go b/simapp/ante_handler.go new file mode 100644 index 0000000000..e14b6b6bba --- /dev/null +++ b/simapp/ante_handler.go @@ -0,0 +1,36 @@ +package simapp + +import ( + sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/x/auth/ante" + "github.com/line/lbm-sdk/x/auth/signing" + "github.com/line/lbm-sdk/x/gov/types" + channelkeeper "github.com/line/lbm-sdk/x/ibc/core/04-channel/keeper" + ibcante "github.com/line/lbm-sdk/x/ibc/core/ante" +) + +func NewAnteHandler( + ak ante.AccountKeeper, + bankKeeper types.BankKeeper, //nolint:interfacer + sigGasConsumer ante.SignatureVerificationGasConsumer, + signModeHandler signing.SignModeHandler, + channelKeeper channelkeeper.Keeper, +) sdk.AnteHandler { + return sdk.ChainAnteDecorators( + ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first + ante.NewRejectExtensionOptionsDecorator(), + ante.NewMempoolFeeDecorator(), + ante.NewValidateBasicDecorator(), + ante.TxTimeoutHeightDecorator{}, + ante.NewValidateMemoDecorator(ak), + ante.NewConsumeGasForTxSizeDecorator(ak), + ante.NewRejectFeeGranterDecorator(), + ante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators + ante.NewValidateSigCountDecorator(ak), + ante.NewDeductFeeDecorator(ak, bankKeeper), + ante.NewSigGasConsumeDecorator(ak, sigGasConsumer), + ante.NewSigVerificationDecorator(ak, signModeHandler), + ante.NewIncrementSequenceDecorator(ak), + ibcante.NewAnteDecorator(channelKeeper), + ) +} diff --git a/simapp/app.go b/simapp/app.go index ee02883f60..c2ed354685 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -435,9 +435,15 @@ func NewSimApp( app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) app.SetAnteHandler( +<<<<<<< HEAD ante.NewAnteHandler( app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, ante.DefaultSigVerificationGasConsumer, encodingConfig.TxConfig.SignModeHandler(), +======= + NewAnteHandler( + app.AccountKeeper, app.BankKeeper, ante.DefaultSigVerificationGasConsumer, + encodingConfig.TxConfig.SignModeHandler(), app.IBCKeeper.ChannelKeeper, +>>>>>>> v0.42.11 ), ) app.SetEndBlocker(app.EndBlocker) diff --git a/simapp/simd/cmd/genaccounts.go b/simapp/simd/cmd/genaccounts.go index 9597e3c87e..c093851fc3 100644 --- a/simapp/simd/cmd/genaccounts.go +++ b/simapp/simd/cmd/genaccounts.go @@ -48,23 +48,26 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa config.SetRoot(clientCtx.HomeDir) + var kr keyring.Keyring addr := sdk.AccAddress(args[0]) err := sdk.ValidateAccAddress(args[0]) if err != nil { inBuf := bufio.NewReader(cmd.InOrStdin()) keyringBackend, _ := cmd.Flags().GetString(flags.FlagKeyringBackend) - - // 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 + if keyringBackend != "" && clientCtx.Keyring == nil { + var err error + kr, err = keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf) + if err != nil { + return err + } + } else { + kr = clientCtx.Keyring } - info, err := kb.Key(args[0]) + info, err := kr.Key(args[0]) if err != nil { - return fmt.Errorf("failed to get address from Keybase: %w", err) + return fmt.Errorf("failed to get address from Keyring: %w", err) } - addr = info.GetAddress() } @@ -149,7 +152,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa appState[authtypes.ModuleName] = authGenStateBz - bankGenState := banktypes.GetGenesisStateFromAppState(depCdc, appState) + bankGenState := banktypes.GetGenesisStateFromAppState(cdc, appState) bankGenState.Balances = append(bankGenState.Balances, balances) bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) bankGenState.Supply = bankGenState.Supply.Add(balances.Coins...) diff --git a/simapp/simd/cmd/genaccounts_test.go b/simapp/simd/cmd/genaccounts_test.go index 333190ecae..51a1527881 100644 --- a/simapp/simd/cmd/genaccounts_test.go +++ b/simapp/simd/cmd/genaccounts_test.go @@ -3,6 +3,9 @@ package cmd_test import ( "context" "fmt" + "github.com/line/lbm-sdk/crypto/hd" + "github.com/line/lbm-sdk/crypto/keyring" + sdk "github.com/line/lbm-sdk/types" "testing" "github.com/line/ostracon/libs/log" @@ -25,28 +28,39 @@ var testMbm = module.NewBasicManager(genutil.AppModuleBasic{}) func TestAddGenesisAccountCmd(t *testing.T) { _, _, addr1 := testdata.KeyTestPubAddr() tests := []struct { - name string - addr string - denom string - expectErr bool + name string + addr string + denom string + withKeyring bool + expectErr bool }{ { - name: "invalid address", - addr: "", - denom: "1000atom", - expectErr: true, + name: "invalid address", + addr: "", + denom: "1000atom", + withKeyring: false, + expectErr: true, }, { - name: "valid address", - addr: addr1.String(), - denom: "1000atom", - expectErr: false, + name: "valid address", + addr: addr1.String(), + denom: "1000atom", + withKeyring: false, + expectErr: false, }, { - name: "multiple denoms", - addr: addr1.String(), - denom: "1000atom, 2000stake", - expectErr: false, + name: "multiple denoms", + addr: addr1.String(), + denom: "1000atom, 2000stake", + withKeyring: false, + expectErr: false, + }, + { + name: "with keyring", + addr: "ser", + denom: "1000atom", + withKeyring: true, + expectErr: false, }, } @@ -65,6 +79,15 @@ func TestAddGenesisAccountCmd(t *testing.T) { serverCtx := server.NewContext(viper.New(), cfg, logger) clientCtx := client.Context{}.WithJSONMarshaler(appCodec).WithHomeDir(home) + if tc.withKeyring { + path := hd.CreateHDPath(118, 0, 0).String() + kr, err := keyring.New(sdk.KeyringServiceName(), keyring.BackendMemory, home, nil) + require.NoError(t, err) + _, _, err = kr.NewMnemonic(tc.addr, keyring.English, path, hd.Secp256k1) + require.NoError(t, err) + clientCtx = clientCtx.WithKeyring(kr) + } + ctx := context.Background() ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) ctx = context.WithValue(ctx, server.ServerContextKey, serverCtx) diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index 554a6043c9..347a02b65d 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -54,9 +54,16 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) { Use: "simd", Short: "simulation app", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { - initClientCtx = client.ReadHomeFlag(initClientCtx, cmd) + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) - initClientCtx, err := config.ReadFromClientConfig(initClientCtx) + initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) + if err != nil { + return err + } + + initClientCtx, err = config.ReadFromClientConfig(initClientCtx) if err != nil { return err } diff --git a/store/cachekv/memiterator.go b/store/cachekv/memiterator.go index 4f01812543..cbdd0b1299 100644 --- a/store/cachekv/memiterator.go +++ b/store/cachekv/memiterator.go @@ -1,116 +1,50 @@ package cachekv import ( - "bytes" - "errors" + tmdb "github.com/line/tm-db/v2" - "github.com/line/lbm-sdk/types/kv" + "github.com/line/lbm-sdk/store/types" ) // Iterates over iterKVCache items. // if key is nil, means it was deleted. // Implements Iterator. type memIterator struct { - start, end []byte - items []*kv.Pair - ascending bool -} + types.Iterator -func IsKeyInDomain(key, start, end []byte) bool { - if bytes.Compare(key, start) < 0 { - return false - } - if end != nil && bytes.Compare(end, key) <= 0 { - return false - } - return true + deleted map[string]struct{} } -func newMemIterator(start, end []byte, items *kv.List, ascending bool) *memIterator { - itemsInDomain := make([]*kv.Pair, 0, items.Len()) - - var entered bool - - for e := items.Front(); e != nil; e = e.Next() { - item := e.Value - if !IsKeyInDomain(item.Key, start, end) { - if entered { - break - } - - continue - } - - itemsInDomain = append(itemsInDomain, item) - entered = true - } +func newMemIterator(start, end []byte, items *tmdb.MemDB, deleted map[string]struct{}, ascending bool) *memIterator { + var iter types.Iterator + var err error - return &memIterator{ - start: start, - end: end, - items: itemsInDomain, - ascending: ascending, + if ascending { + iter, err = items.Iterator(start, end) + } else { + iter, err = items.ReverseIterator(start, end) } -} - -func (mi *memIterator) Domain() ([]byte, []byte) { - return mi.start, mi.end -} - -func (mi *memIterator) Valid() bool { - return len(mi.items) > 0 -} -func (mi *memIterator) assertValid() { - if err := mi.Error(); err != nil { + if err != nil { panic(err) } -} - -func (mi *memIterator) Next() { - mi.assertValid() - if mi.ascending { - mi.items = mi.items[1:] - } else { - mi.items = mi.items[:len(mi.items)-1] + newDeleted := make(map[string]struct{}) + for k, v := range deleted { + newDeleted[k] = v } -} -func (mi *memIterator) Key() []byte { - mi.assertValid() + return &memIterator{ + Iterator: iter, - if mi.ascending { - return mi.items[0].Key + deleted: newDeleted, } - - return mi.items[len(mi.items)-1].Key } func (mi *memIterator) Value() []byte { - mi.assertValid() - - if mi.ascending { - return mi.items[0].Value + key := mi.Iterator.Key() + if _, ok := mi.deleted[string(key)]; ok { + return nil } - - return mi.items[len(mi.items)-1].Value -} - -func (mi *memIterator) Close() error { - mi.start = nil - mi.end = nil - mi.items = nil - - return nil -} - -// Error returns an error if the memIterator is invalid defined by the Valid -// method. -func (mi *memIterator) Error() error { - if !mi.Valid() { - return errors.New("invalid memIterator") - } - - return nil + return mi.Iterator.Value() } diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 869eded92a..1019136738 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -9,6 +9,8 @@ import ( "time" "unsafe" + tmdb "github.com/line/tm-db/v2" + "github.com/line/lbm-sdk/store/tracekv" "github.com/line/lbm-sdk/store/types" "github.com/line/lbm-sdk/telemetry" @@ -18,9 +20,8 @@ import ( // If value is nil but deleted is false, it means the parent doesn't have the // key. (No need to delete upon Write()) type cValue struct { - value []byte - deleted bool - dirty bool + value []byte + dirty bool } // Store wraps an in-memory cache around an underlying types.KVStore. @@ -28,8 +29,9 @@ type cValue struct { type Store struct { mtx sync.RWMutex cache sync.Map + deleted sync.Map unsortedCache sync.Map - sortedCache *kv.List // always ascending sorted + sortedCache *tmdb.MemDB // always ascending sorted parent types.KVStore } @@ -39,8 +41,9 @@ var _ types.CacheKVStore = (*Store)(nil) func NewStore(parent types.KVStore) *Store { return &Store{ cache: sync.Map{}, + deleted: sync.Map{}, unsortedCache: sync.Map{}, - sortedCache: kv.NewList(), + sortedCache: tmdb.NewMemDB(), parent: parent, } } @@ -51,8 +54,7 @@ func (store *Store) GetStoreType() types.StoreType { } // Get implements types.KVStore. -func (store *Store) Get(key []byte) []byte { - defer telemetry.MeasureSince(time.Now(), "store", "cachekv", "get") +func (store *Store) Get(key []byte) (value []byte) { types.AssertValidKey(key) store.mtx.RLock() @@ -62,14 +64,13 @@ func (store *Store) Get(key []byte) []byte { return cacheValue.(*cValue).value } - value := store.parent.Get(key) + value = store.parent.Get(key) store.setCacheValue(key, value, false, false) return value } // Set implements types.KVStore. func (store *Store) Set(key []byte, value []byte) { - defer telemetry.MeasureSince(time.Now(), "store", "cachekv", "set") types.AssertValidKey(key) types.AssertValidValue(value) @@ -129,7 +130,7 @@ func (store *Store) Write() { cacheValue := v.(*cValue) switch { - case cacheValue.deleted: + case store.isDeleted(key): store.parent.Delete([]byte(key)) case cacheValue.value == nil: // Skip, it already doesn't exist in parent. @@ -140,8 +141,9 @@ func (store *Store) Write() { // Clear the cache store.cache = sync.Map{} + store.deleted = sync.Map{} store.unsortedCache = sync.Map{} - store.sortedCache = kv.NewList() + store.sortedCache = tmdb.NewMemDB() } // CacheWrap implements CacheWrapper. @@ -180,7 +182,7 @@ func (store *Store) iterator(start, end []byte, ascending bool) types.Iterator { } store.dirtyItems(start, end) - cache = newMemIterator(start, end, store.sortedCache, ascending) + cache = newMemIterator(start, end, store.sortedCache, store.deleted, ascending) return newCacheMergeIterator(parent, cache, ascending) } @@ -189,7 +191,7 @@ func (store *Store) iterator(start, end []byte, ascending bool) types.Iterator { // from string -> []byte to speed up operations, it is not meant // to be used generally, but for a specific pattern to check for available // keys within a domain. -func strToByte(s string) []byte { +func strToBytes(s string) []byte { var b []byte hdr := (*reflect.SliceHeader)(unsafe.Pointer(&b)) hdr.Cap = len(s) @@ -209,48 +211,59 @@ func byteSliceToStr(b []byte) string { // Constructs a slice of dirty items, to use w/ memIterator. func (store *Store) dirtyItems(start, end []byte) { + n := len(store.unsortedCache) unsorted := make([]*kv.Pair, 0) - + // If the unsortedCache is too big, its costs too much to determine + // whats in the subset we are concerned about. + // If you are interleaving iterator calls with writes, this can easily become an + // O(N^2) overhead. + // Even without that, too many range checks eventually becomes more expensive + // than just not having the cache. store.unsortedCache.Range(func(k, _ interface{}) bool { key := k.(string) - if IsKeyInDomain(strToByte(key), start, end) { + if n >= 1024 { cacheValue, ok := store.cache.Load(key) if ok { unsorted = append(unsorted, &kv.Pair{Key: []byte(key), Value: cacheValue.(*cValue).value}) } + } else { + if tmdb.IsKeyInDomain(strToByte(key), start, end) { + cacheValue, ok := store.cache.Load(key) + if ok { + unsorted = append(unsorted, &kv.Pair{Key: []byte(key), Value: cacheValue.(*cValue).value}) + } + } } - return true }) + store.clearUnsortedCacheSubset(unsorted) +} - for _, kv := range unsorted { - store.unsortedCache.Delete(byteSliceToStr(kv.Key)) +func (store *Store) clearUnsortedCacheSubset(unsorted []*kv.Pair) { + n := len(store.unsortedCache) + if len(unsorted) == n { // This pattern allows the Go compiler to emit the map clearing idiom for the entire map. + for key := range store.unsortedCache { + delete(store.unsortedCache, key) + } + } else { // Otherwise, normally delete the unsorted keys from the map. + for _, kv := range unsorted { + delete(store.unsortedCache, byteSliceToStr(kv.Key)) + } } - sort.Slice(unsorted, func(i, j int) bool { return bytes.Compare(unsorted[i].Key, unsorted[j].Key) < 0 }) - for e := store.sortedCache.Front(); e != nil && len(unsorted) != 0; { - uitem := unsorted[0] - sitem := e.Value - comp := bytes.Compare(uitem.Key, sitem.Key) - - switch comp { - case -1: - unsorted = unsorted[1:] - - store.sortedCache.InsertBefore(uitem, e) - case 1: - e = e.Next() - case 0: - unsorted = unsorted[1:] - e.Value = uitem - e = e.Next() + for _, item := range unsorted { + if item.Value == nil { + // deleted element, tracked by store.deleted + // setting arbitrary value + store.sortedCache.Set(item.Key, []byte{}) + continue + } + err := store.sortedCache.Set(item.Key, item.Value) + if err != nil { + panic(err) } - } - - for _, kvp := range unsorted { - store.sortedCache.PushBack(kvp) } } @@ -259,12 +272,22 @@ func (store *Store) dirtyItems(start, end []byte) { // Only entrypoint to mutate store.cache. func (store *Store) setCacheValue(key, value []byte, deleted bool, dirty bool) { - store.cache.Store(string(key), &cValue{ - value: value, - deleted: deleted, - dirty: dirty, + keyStr := byteSliceToStr(key) + store.cache.Store(keyStr, &cValue{ + value: value, + dirty: dirty, }) + if deleted { + store.deleted.Store(keyStr, struct{}{}) + } else { + store.deleted.Delete(keyStr) + } if dirty { store.unsortedCache.Store(string(key), struct{}{}) } } + +func (store *Store) isDeleted(key string) bool { + _, ok := store.deleted[key] + return ok +} diff --git a/store/gaskv/store.go b/store/gaskv/store.go index 84ddad442b..07cbdfe81c 100644 --- a/store/gaskv/store.go +++ b/store/gaskv/store.go @@ -35,8 +35,6 @@ func (gs *Store) GetStoreType() types.StoreType { // Implements KVStore. func (gs *Store) Get(key []byte) (value []byte) { - defer telemetry.MeasureSince(time.Now(), "store", "gaskv", "get") - gs.gasMeter.ConsumeGas(gs.gasConfig.ReadCostFlat, types.GasReadCostFlatDesc) value = gs.parent.Get(key) @@ -48,8 +46,6 @@ func (gs *Store) Get(key []byte) (value []byte) { // Implements KVStore. func (gs *Store) Set(key []byte, value []byte) { - defer telemetry.MeasureSince(time.Now(), "store", "gaskv", "set") - types.AssertValidKey(key) types.AssertValidValue(value) gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostFlat, types.GasWriteCostFlatDesc) diff --git a/store/iavl/store.go b/store/iavl/store.go index 0c289f2968..cb18e12d6d 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -5,7 +5,6 @@ import ( "fmt" "io" "os" - "sync" "time" ics23 "github.com/confio/ics23/go" @@ -18,7 +17,6 @@ import ( "github.com/line/lbm-sdk/store/tracekv" "github.com/line/lbm-sdk/store/types" "github.com/line/lbm-sdk/telemetry" - sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" "github.com/line/lbm-sdk/types/kv" ) @@ -451,29 +449,7 @@ func getProofFromTree(tree *iavl.MutableTree, key []byte, exists bool) *occrypto // Implements types.Iterator. type iavlIterator struct { - // Domain - start, end []byte - - key []byte // The current key (mutable) - value []byte // The current value (mutable) - - // Underlying store - tree *iavl.ImmutableTree - - // Channel to push iteration values. - iterCh chan kv.Pair - - // Close this to release goroutine. - quitCh chan struct{} - - // Close this to signal that state is initialized. - initCh chan struct{} - - mtx sync.Mutex - - ascending bool // Iteration order - - invalid bool // True once, true forever (mutable) + *iavl.Iterator } var _ types.Iterator = (*iavlIterator)(nil) @@ -483,140 +459,7 @@ var _ types.Iterator = (*iavlIterator)(nil) // goroutine. func newIAVLIterator(tree *iavl.ImmutableTree, start, end []byte, ascending bool) *iavlIterator { iter := &iavlIterator{ - tree: tree, - start: sdk.CopyBytes(start), - end: sdk.CopyBytes(end), - ascending: ascending, - iterCh: make(chan kv.Pair), // Set capacity > 0? - quitCh: make(chan struct{}), - initCh: make(chan struct{}), + Iterator: tree.Iterator(start, end, ascending), } - go iter.iterateRoutine() - go iter.initRoutine() return iter } - -// Run this to funnel items from the tree to iterCh. -func (iter *iavlIterator) iterateRoutine() { - iter.tree.IterateRange( - iter.start, iter.end, iter.ascending, - func(key, value []byte) bool { - select { - case <-iter.quitCh: - return true // done with iteration. - case iter.iterCh <- kv.Pair{Key: key, Value: value}: - return false // yay. - } - }, - ) - close(iter.iterCh) // done. -} - -// Run this to fetch the first item. -func (iter *iavlIterator) initRoutine() { - iter.receiveNext() - close(iter.initCh) -} - -// Implements types.Iterator. -func (iter *iavlIterator) Domain() (start, end []byte) { - return iter.start, iter.end -} - -// Implements types.Iterator. -func (iter *iavlIterator) Valid() bool { - iter.waitInit() - iter.mtx.Lock() - - validity := !iter.invalid - iter.mtx.Unlock() - return validity -} - -// Implements types.Iterator. -func (iter *iavlIterator) Next() { - iter.waitInit() - iter.mtx.Lock() - iter.assertIsValid(true) - - iter.receiveNext() - iter.mtx.Unlock() -} - -// Implements types.Iterator. -func (iter *iavlIterator) Key() []byte { - iter.waitInit() - iter.mtx.Lock() - iter.assertIsValid(true) - - key := iter.key - iter.mtx.Unlock() - return key -} - -// Implements types.Iterator. -func (iter *iavlIterator) Value() []byte { - iter.waitInit() - iter.mtx.Lock() - iter.assertIsValid(true) - - val := iter.value - iter.mtx.Unlock() - return val -} - -// Close closes the IAVL iterator by closing the quit channel and waiting for -// the iterCh to finish/close. -func (iter *iavlIterator) Close() error { - close(iter.quitCh) - // wait iterCh to close - for range iter.iterCh { - } - - return nil -} - -// Error performs a no-op. -func (iter *iavlIterator) Error() error { - return nil -} - -//---------------------------------------- - -func (iter *iavlIterator) setNext(key, value []byte) { - iter.assertIsValid(false) - - iter.key = key - iter.value = value -} - -func (iter *iavlIterator) setInvalid() { - iter.assertIsValid(false) - - iter.invalid = true -} - -func (iter *iavlIterator) waitInit() { - <-iter.initCh -} - -func (iter *iavlIterator) receiveNext() { - kvPair, ok := <-iter.iterCh - if ok { - iter.setNext(kvPair.Key, kvPair.Value) - } else { - iter.setInvalid() - } -} - -// assertIsValid panics if the iterator is invalid. If unlockMutex is true, -// it also unlocks the mutex before panicing, to prevent deadlocks in code that -// recovers from panics -func (iter *iavlIterator) assertIsValid(unlockMutex bool) { - if iter.invalid { - if unlockMutex { - iter.mtx.Unlock() - } - panic("invalid iterator") - } -} diff --git a/types/abci.pb.go b/types/abci.pb.go index 8f24285e58..3e2951f094 100644 --- a/types/abci.pb.go +++ b/types/abci.pb.go @@ -57,6 +57,13 @@ type TxResponse struct { // the timestamps of the valid votes in the block.LastCommit. For height == 1, // it's genesis time. Timestamp string `protobuf:"bytes,12,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Events defines all the events emitted by processing a transaction. Note, + // these events include those emitted by processing all the messages and those + // emitted from the ante handler. Whereas Logs contains the events, with + // additional metadata, emitted only by processing the messages. + // + // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 + Events []types1.Event `protobuf:"bytes,13,rep,name=events,proto3" json:"events"` } func (m *TxResponse) Reset() { *m = TxResponse{} } @@ -607,65 +614,65 @@ func init() { func init() { proto.RegisterFile("lbm/base/abci/v1/abci.proto", fileDescriptor_87b37a07529c6d46) } var fileDescriptor_87b37a07529c6d46 = []byte{ - // 914 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x55, 0xcd, 0x6e, 0xdb, 0x46, - 0x10, 0x16, 0x25, 0x85, 0xb2, 0x46, 0x4e, 0x9d, 0x6e, 0xd5, 0x86, 0x8e, 0x63, 0x51, 0x60, 0x5b, - 0x40, 0x97, 0x50, 0x8d, 0xd3, 0x93, 0x0b, 0x04, 0x35, 0xd3, 0x3f, 0xa3, 0x71, 0x0f, 0x6b, 0x15, - 0x05, 0x7a, 0x11, 0x96, 0xd2, 0x66, 0xc5, 0x86, 0xe4, 0x0a, 0xda, 0x95, 0x2d, 0xdd, 0x7a, 0x2a, - 0x7a, 0x2a, 0x8a, 0x3e, 0x41, 0xcf, 0x7d, 0x91, 0xe6, 0xe8, 0x63, 0x0e, 0x85, 0xda, 0xda, 0xb7, - 0x1c, 0xfd, 0x04, 0xc1, 0x0e, 0x29, 0x89, 0x8e, 0x72, 0xd2, 0xcc, 0x37, 0xb3, 0x33, 0x3b, 0xdf, - 0x37, 0x5c, 0xc1, 0x5e, 0x1c, 0x26, 0xdd, 0x90, 0x29, 0xde, 0x65, 0xe1, 0x20, 0xea, 0x9e, 0x3d, - 0xc4, 0x5f, 0x7f, 0x3c, 0x91, 0x5a, 0x92, 0x3b, 0x71, 0x98, 0xf8, 0x26, 0xe8, 0x23, 0x78, 0xf6, - 0xf0, 0x5e, 0x53, 0x48, 0x21, 0x31, 0xd8, 0x35, 0x56, 0x96, 0x77, 0x6f, 0x57, 0x2a, 0x3d, 0x61, - 0x03, 0x99, 0x66, 0x45, 0xf4, 0x7c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0x47, 0xd3, 0xd0, 0x1f, - 0xc8, 0xa4, 0x1b, 0x47, 0x29, 0xef, 0xc6, 0x61, 0xf2, 0x40, 0x0d, 0x9f, 0x67, 0x7f, 0x2a, 0xa1, - 0x8d, 0x0f, 0xdb, 0xa3, 0xd7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x96, 0xf6, 0x44, 0x67, 0xb7, 0x06, - 0x00, 0x00, + // 920 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0xcd, 0x72, 0x1b, 0x45, + 0x10, 0xd6, 0x4a, 0xca, 0xca, 0x6a, 0xd9, 0x38, 0x0c, 0x86, 0xac, 0xe3, 0x58, 0xab, 0x5a, 0xa0, + 0x4a, 0x97, 0xac, 0x88, 0xc2, 0x29, 0x54, 0xa5, 0xb0, 0xc2, 0x9f, 0x8b, 0x98, 0xc3, 0x58, 0x14, + 0x55, 0x5c, 0x54, 0xb3, 0xd2, 0x64, 0xb4, 0x64, 0x77, 0x47, 0xa5, 0x19, 0xd9, 0xd2, 0x8d, 0x13, + 0xc5, 0x91, 0xe2, 0x09, 0x38, 0xf3, 0x18, 0x5c, 0xc8, 0xd1, 0xc7, 0x1c, 0x28, 0x01, 0xf6, 0x2d, + 0x47, 0x3f, 0x01, 0x35, 0xbd, 0x2b, 0xed, 0x3a, 0xca, 0x81, 0x93, 0xba, 0xbf, 0xee, 0xe9, 0x9e, + 0xfe, 0xfa, 0xd3, 0x2c, 0x1c, 0x44, 0x41, 0xdc, 0x09, 0x98, 0xe2, 0x1d, 0x16, 0x0c, 0xc3, 0xce, + 0xd9, 0x03, 0xfc, 0xf5, 0x27, 0x53, 0xa9, 0x25, 0xb9, 0x1d, 0x05, 0xb1, 0x6f, 0x82, 0x3e, 0x82, + 0x67, 0x0f, 0xee, 0xee, 0x09, 0x29, 0x24, 0x06, 0x3b, 0xc6, 0x4a, 0xf3, 0xee, 0xee,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 0x96, 0x2e, 0xae, 0x9a, 0xa5, 0x97, 0x57, 0xcd, 0xd2, 0xf7, 0x87, + 0x22, 0xd4, 0xe3, 0x59, 0xe0, 0x0f, 0x65, 0xdc, 0x89, 0xc2, 0x84, 0x77, 0xa2, 0x20, 0xbe, 0xaf, + 0x46, 0xcf, 0xd3, 0x0f, 0x51, 0x60, 0xe3, 0x63, 0xf8, 0xf0, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x94, 0x8a, 0x81, 0x94, 0xeb, 0x06, 0x00, 0x00, } func (m *TxResponse) Marshal() (dAtA []byte, err error) { @@ -688,6 +695,20 @@ func (m *TxResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x6a + } + } if len(m.Timestamp) > 0 { i -= len(m.Timestamp) copy(dAtA[i:], m.Timestamp) @@ -1237,6 +1258,12 @@ func (m *TxResponse) Size() (n int) { if l > 0 { n += 1 + l + sovAbci(uint64(l)) } + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } return n } @@ -1873,6 +1900,40 @@ func (m *TxResponse) Unmarshal(dAtA []byte) error { } m.Timestamp = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, types1.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAbci(dAtA[iNdEx:]) diff --git a/types/address_test.go b/types/address_test.go index 5d9d5f4347..2a8f2fb145 100644 --- a/types/address_test.go +++ b/types/address_test.go @@ -398,12 +398,12 @@ func (s *addressTestSuite) TestBech32ifyAddressBytes() { want string wantErr bool }{ - {"empty address", args{"prefixA", []byte{}}, "", false}, + {"empty address", args{"prefixa", []byte{}}, "", false}, {"empty prefix", args{"", addr20byte}, "", true}, - {"10-byte address", args{"prefixA", addr10byte}, "prefixA1qqqsyqcyq5rqwzqfwvmuzx", false}, - {"10-byte address", args{"prefixB", addr10byte}, "prefixB1qqqsyqcyq5rqwzqf4xftmx", false}, - {"20-byte address", args{"prefixA", addr20byte}, "prefixA1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn6j4npq", false}, - {"20-byte address", args{"prefixB", addr20byte}, "prefixB1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn8e9wka", false}, + {"10-byte address", args{"prefixa", addr10byte}, "prefixa1qqqsyqcyq5rqwzqf3953cc", false}, + {"10-byte address", args{"prefixb", addr10byte}, "prefixb1qqqsyqcyq5rqwzqf20xxpc", false}, + {"20-byte address", args{"prefixa", addr20byte}, "prefixa1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn7hzdtn", false}, + {"20-byte address", args{"prefixb", addr20byte}, "prefixb1qqqsyqcyq5rqwzqfpg9scrgwpugpzysnrujsuw", false}, } for _, tt := range tests { tt := tt @@ -431,12 +431,12 @@ func (s *addressTestSuite) TestMustBech32ifyAddressBytes() { want string wantPanic bool }{ - {"empty address", args{"prefixA", []byte{}}, "", false}, + {"empty address", args{"prefixa", []byte{}}, "", false}, {"empty prefix", args{"", addr20byte}, "", true}, - {"10-byte address", args{"prefixA", addr10byte}, "prefixA1qqqsyqcyq5rqwzqfwvmuzx", false}, - {"10-byte address", args{"prefixB", addr10byte}, "prefixB1qqqsyqcyq5rqwzqf4xftmx", false}, - {"20-byte address", args{"prefixA", addr20byte}, "prefixA1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn6j4npq", false}, - {"20-byte address", args{"prefixB", addr20byte}, "prefixB1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn8e9wka", false}, + {"10-byte address", args{"prefixa", addr10byte}, "prefixa1qqqsyqcyq5rqwzqf3953cc", false}, + {"10-byte address", args{"prefixb", addr10byte}, "prefixb1qqqsyqcyq5rqwzqf20xxpc", false}, + {"20-byte address", args{"prefixa", addr20byte}, "prefixa1qqqsyqcyq5rqwzqfpg9scrgwpugpzysn7hzdtn", false}, + {"20-byte address", args{"prefixb", addr20byte}, "prefixb1qqqsyqcyq5rqwzqfpg9scrgwpugpzysnrujsuw", false}, } for _, tt := range tests { tt := tt diff --git a/types/bech32/bech32.go b/types/bech32/bech32.go index 22a177663e..59bd8b9541 100644 --- a/types/bech32/bech32.go +++ b/types/bech32/bech32.go @@ -3,7 +3,7 @@ package bech32 import ( "fmt" - "github.com/enigmampc/btcutil/bech32" + "github.com/cosmos/btcutil/bech32" ) // ConvertAndEncode converts from a base64 encoded byte string to base32 encoded byte string and then to bech32. diff --git a/types/coin.go b/types/coin.go index b86cff5186..bcc8cd78ee 100644 --- a/types/coin.go +++ b/types/coin.go @@ -129,6 +129,11 @@ func (coin Coin) IsNegative() bool { return coin.Amount.Sign() == -1 } +// IsNil returns true if the coin amount is nil and false otherwise. +func (coin Coin) IsNil() bool { + return coin.Amount.i == nil +} + //----------------------------------------------------------------------------- // Coins @@ -543,6 +548,19 @@ func (coins Coins) IsAnyNegative() bool { return false } +// IsAnyNil returns true if there is at least one coin whose amount +// is nil; returns false otherwise. It returns false if the coin set +// is empty too. +func (coins Coins) IsAnyNil() bool { + for _, coin := range coins { + if coin.IsNil() { + return true + } + } + + return false +} + // negative returns a set of coins with all amount negative. // // TODO: Remove once unsigned integers are used. @@ -561,7 +579,18 @@ func (coins Coins) negative() Coins { // removeZeroCoins removes all zero coins from the given coin set in-place. func removeZeroCoins(coins Coins) Coins { - result := make([]Coin, 0, len(coins)) + for i := 0; i < len(coins); i++ { + if coins[i].IsZero() { + break + } else if i == len(coins)-1 { + return coins + } + } + + var result []Coin + if len(coins) > 0 { + result = make([]Coin, 0, len(coins)-1) + } for _, coin := range coins { if !coin.IsZero() { diff --git a/types/coin_test.go b/types/coin_test.go index 2027f564bc..6f6527a8d0 100644 --- a/types/coin_test.go +++ b/types/coin_test.go @@ -237,6 +237,20 @@ func (s *coinTestSuite) TestCoinIsZero() { s.Require().False(res) } +func (s *coinTestSuite) TestCoinIsNil() { + coin := sdk.Coin{} + res := coin.IsNil() + s.Require().True(res) + + coin = sdk.Coin{Denom: "uatom"} + res = coin.IsNil() + s.Require().True(res) + + coin = sdk.NewInt64Coin(testDenom1, 1) + res = coin.IsNil() + s.Require().False(res) +} + func (s *coinTestSuite) TestFilteredZeroCoins() { cases := []struct { name string @@ -902,6 +916,19 @@ func (s *coinTestSuite) TestCoinsIsAnyGT() { } } +func (s *coinTestSuite) TestCoinsIsAnyNil() { + twoAtom := sdk.NewInt64Coin("atom", 2) + fiveAtom := sdk.NewInt64Coin("atom", 5) + threeEth := sdk.NewInt64Coin("eth", 3) + nilAtom := sdk.Coin{Denom: "atom"} + + s.Require().True(sdk.Coins{twoAtom, fiveAtom, threeEth, nilAtom}.IsAnyNil()) + s.Require().True(sdk.Coins{twoAtom, nilAtom, fiveAtom, threeEth}.IsAnyNil()) + s.Require().True(sdk.Coins{nilAtom, twoAtom, fiveAtom, threeEth}.IsAnyNil()) + s.Require().False(sdk.Coins{twoAtom, fiveAtom, threeEth}.IsAnyNil()) + +} + func (s *coinTestSuite) TestMarshalJSONCoins() { cdc := codec.NewLegacyAmino() sdk.RegisterLegacyAminoCodec(cdc) diff --git a/types/result.go b/types/result.go index 54ff1d8321..6c2dd38605 100644 --- a/types/result.go +++ b/types/result.go @@ -3,27 +3,24 @@ package types import ( "encoding/hex" "encoding/json" - "fmt" "math" "strings" "github.com/gogo/protobuf/proto" - - "gopkg.in/yaml.v2" - abci "github.com/line/ostracon/abci/types" ctypes "github.com/line/ostracon/rpc/core/types" + "github.com/line/lbm-sdk/codec" codectypes "github.com/line/lbm-sdk/codec/types" ) func (gi GasInfo) String() string { - bz, _ := yaml.Marshal(gi) + bz, _ := codec.MarshalYAML(codec.NewProtoCodec(nil), &gi) return string(bz) } func (r Result) String() string { - bz, _ := yaml.Marshal(r) + bz, _ := codec.MarshalYAML(codec.NewProtoCodec(nil), &r) return string(bz) } @@ -81,6 +78,7 @@ func NewResponseResultTx(res *ctypes.ResultTx, anyTx *codectypes.Any, timestamp GasUsed: res.TxResult.GasUsed, Tx: anyTx, Timestamp: timestamp, + Events: res.TxResult.Events, } } @@ -121,6 +119,7 @@ func newTxResponseCheckTx(res *ctypes.ResultBroadcastTxCommit) *TxResponse { Info: res.CheckTx.Info, GasWanted: res.CheckTx.GasWanted, GasUsed: res.CheckTx.GasUsed, + Events: res.CheckTx.Events, } } @@ -147,6 +146,7 @@ func newTxResponseDeliverTx(res *ctypes.ResultBroadcastTxCommit) *TxResponse { Info: res.DeliverTx.Info, GasWanted: res.DeliverTx.GasWanted, GasUsed: res.DeliverTx.GasUsed, + Events: res.DeliverTx.Events, } } @@ -169,44 +169,8 @@ func NewResponseFormatBroadcastTx(res *ctypes.ResultBroadcastTx) *TxResponse { } func (r TxResponse) String() string { - var sb strings.Builder - sb.WriteString("Response:\n") - - if r.Height > 0 { - sb.WriteString(fmt.Sprintf(" Height: %d\n", r.Height)) - } - if r.TxHash != "" { - sb.WriteString(fmt.Sprintf(" TxHash: %s\n", r.TxHash)) - } - if r.Code > 0 { - sb.WriteString(fmt.Sprintf(" Code: %d\n", r.Code)) - } - if r.Data != "" { - sb.WriteString(fmt.Sprintf(" Data: %s\n", r.Data)) - } - if r.RawLog != "" { - sb.WriteString(fmt.Sprintf(" Raw Log: %s\n", r.RawLog)) - } - if r.Logs != nil { - sb.WriteString(fmt.Sprintf(" Logs: %s\n", r.Logs)) - } - if r.Info != "" { - sb.WriteString(fmt.Sprintf(" Info: %s\n", r.Info)) - } - if r.GasWanted != 0 { - sb.WriteString(fmt.Sprintf(" GasWanted: %d\n", r.GasWanted)) - } - if r.GasUsed != 0 { - sb.WriteString(fmt.Sprintf(" GasUsed: %d\n", r.GasUsed)) - } - if r.Codespace != "" { - sb.WriteString(fmt.Sprintf(" Codespace: %s\n", r.Codespace)) - } - if r.Timestamp != "" { - sb.WriteString(fmt.Sprintf(" Timestamp: %s\n", r.Timestamp)) - } - - return strings.TrimSpace(sb.String()) + bz, _ := codec.MarshalYAML(codec.NewProtoCodec(nil), &r) + return string(bz) } // Empty returns true if the response is empty diff --git a/types/result_test.go b/types/result_test.go index 7cfa523129..01114850ac 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -7,7 +7,6 @@ import ( "testing" "github.com/golang/protobuf/proto" - "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -165,18 +164,20 @@ func (s *resultTestSuite) TestResponseResultTx() { s.Require().Equal(want, sdk.NewResponseResultTx(resultTx, nil, "timestamp")) s.Require().Equal((*sdk.TxResponse)(nil), sdk.NewResponseResultTx(nil, nil, "timestamp")) - s.Require().Equal(`Response: - Height: 10 - TxHash: 74657374 - Code: 1 - Data: 64617461 - Raw Log: [] - Logs: [] - Info: info - GasWanted: 100 - GasUsed: 90 - Codespace: codespace - Timestamp: timestamp`, sdk.NewResponseResultTx(resultTx, nil, "timestamp").String()) + s.Require().Equal(`code: 1 +codespace: codespace +data: "64617461" +events: [] +gas_used: "90" +gas_wanted: "100" +height: "10" +info: info +logs: [] +raw_log: '[]' +timestamp: timestamp +tx: null +txhash: "74657374" +`, sdk.NewResponseResultTx(resultTx, nil, "timestamp").String()) s.Require().True(sdk.TxResponse{}.Empty()) s.Require().False(want.Empty()) @@ -218,6 +219,18 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() { GasWanted: 99, GasUsed: 100, Codespace: "codespace", + Events: []abci.Event{ + { + Type: "message", + Attributes: []abci.EventAttribute{ + { + Key: []byte("action"), + Value: []byte("foo"), + Index: true, + }, + }, + }, + }, }, } deliverTxResult := &ctypes.ResultBroadcastTxCommit{ @@ -231,6 +244,18 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() { GasWanted: 99, GasUsed: 100, Codespace: "codespace", + Events: []abci.Event{ + { + Type: "message", + Attributes: []abci.EventAttribute{ + { + Key: []byte("action"), + Value: []byte("foo"), + Index: true, + }, + }, + }, + }, }, } want := &sdk.TxResponse{ @@ -244,6 +269,18 @@ func (s *resultTestSuite) TestResponseFormatBroadcastTxCommit() { Info: "info", GasWanted: 99, GasUsed: 100, + Events: []abci.Event{ + { + Type: "message", + Attributes: []abci.EventAttribute{ + { + Key: []byte("action"), + Value: []byte("foo"), + Index: true, + }, + }, + }, + }, } s.Require().Equal(want, sdk.NewResponseFormatBroadcastTxCommit(checkTxResult)) diff --git a/types/tx/types.go b/types/tx/types.go index 57b70e5545..5c330df838 100644 --- a/types/tx/types.go +++ b/types/tx/types.go @@ -72,6 +72,13 @@ func (t *Tx) ValidateBasic() error { ) } + if fee.Amount.IsAnyNil() { + return sdkerrors.Wrapf( + sdkerrors.ErrInsufficientFee, + "invalid fee provided: null", + ) + } + if fee.Amount.IsAnyNegative() { return sdkerrors.Wrapf( sdkerrors.ErrInsufficientFee, diff --git a/x/auth/client/cli/cli_test.go b/x/auth/client/cli/cli_test.go index 78f1666291..4b5e39166b 100644 --- a/x/auth/client/cli/cli_test.go +++ b/x/auth/client/cli/cli_test.go @@ -1288,87 +1288,6 @@ func (s *IntegrationTestSuite) createBankMsg(val *network.Validator, toAddr sdk. return bankcli.MsgSendExec(val.ClientCtx, val.Address, toAddr, amount, flags...) } -func (s *IntegrationTestSuite) TestNewEmptyTxCmd() { - val := s.network.Validators[0] - - testCases := []struct { - name string - from sdk.AccAddress - args []string - expectErr bool - respType proto.Message - expectedCode uint32 - }{ - { - "valid transaction", - val.Address, - []string{ - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - }, - false, - &sdk.TxResponse{}, - 0, - }, - { - "not enough fees", - val.Address, - []string{ - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(1))).String()), - }, - false, - &sdk.TxResponse{}, - sdkerrors.ErrInsufficientFee.ABCICode(), - }, - { - "not enough gas", - val.Address, - []string{ - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - "--gas=10", - }, - false, - &sdk.TxResponse{}, - sdkerrors.ErrOutOfGas.ABCICode(), - }, - { - "no from", - sdk.AccAddress(""), - []string{ - fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), - fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), - fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), - }, - true, - &sdk.TxResponse{}, - 0, - }, - } - - for _, tc := range testCases { - tc := tc - - s.Run(tc.name, func() { - bz, err := clitestutil.ExecTestCLICmd(val.ClientCtx, authcli.NewEmptyTxCmd(), - append([]string{tc.from.String()}, tc.args...)) - if tc.expectErr { - s.Require().Error(err) - } else { - s.Require().NoError(err) - - s.Require().NoError(val.ClientCtx.JSONMarshaler.UnmarshalJSON(bz.Bytes(), tc.respType), bz.String()) - txResp := tc.respType.(*sdk.TxResponse) - s.Require().Equal(tc.expectedCode, txResp.Code) - } - }) - } -} - func TestIntegrationTestSuite(t *testing.T) { suite.Run(t, new(IntegrationTestSuite)) } diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 909b617eb7..9204dbe740 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -186,12 +186,12 @@ $ %s query txs --%s 'message.sender=cosmos1...&message.action=withdraw_delegator func QueryTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: "tx --type=[hash|acc_seq|signature] [hash|acc_seq|signature]", - Short: "Query for a transaction by hash, addr++seq combination or signature in a committed block", + Short: "Query for a transaction by hash, \"/\" combination or comma-separated signatures in a committed block", Long: strings.TrimSpace(fmt.Sprintf(` Example: $ %s query tx -$ %s query tx --%s=%s : -$ %s query tx --%s=%s +$ %s query tx --%s=%s / +$ %s query tx --%s=%s , `, version.AppName, version.AppName, flagType, typeAccSeq, diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index bc52099443..731a1f25da 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -64,7 +64,7 @@ func (s txServer) GetTxsEvent(ctx context.Context, req *txtypes.GetTxsEventReque } } - result, err := queryTxsByEvents(ctx, s.clientCtx, req.Events, req.Prove, page, limit, orderBy) + result, err := queryTxsByEvents(ctx, s.clientCtx, req.Events, page, limit, orderBy) if err != nil { return nil, err } diff --git a/x/auth/tx/service_test.go b/x/auth/tx/service_test.go index 403ab832b7..15d75f280f 100644 --- a/x/auth/tx/service_test.go +++ b/x/auth/tx/service_test.go @@ -268,6 +268,18 @@ func (s IntegrationTestSuite) TestGetTxEvents_GRPCGateway() { false, "", }, + { + "valid request: order by asc", + fmt.Sprintf("%s/lbm/tx/v1/txs?events=%s&events=%s&order_by=ORDER_BY_ASC", val.APIAddress, "message.action='send'", "message.module='bank'"), + false, + "", + }, + { + "valid request: order by desc", + fmt.Sprintf("%s/lbm/tx/v1/txs?events=%s&events=%s&order_by=ORDER_BY_DESC", val.APIAddress, "message.action='send'", "message.module='bank'"), + false, + "", + }, { "invalid request: invalid order by", fmt.Sprintf("%s/lbm/tx/v1/txs?events=%s&events=%s&order_by=invalid_order", val.APIAddress, "message.action='send'", "message.module='bank'"), diff --git a/x/bank/client/rest/grpc_query_test.go b/x/bank/client/rest/grpc_query_test.go index 43e5b4374b..33e43bef93 100644 --- a/x/bank/client/rest/grpc_query_test.go +++ b/x/bank/client/rest/grpc_query_test.go @@ -227,7 +227,7 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() { }, { "gPRC account balance of a denom", - fmt.Sprintf("%s/lbm/bank/v1/balances/%s/%s", baseURL, val.Address.String(), s.cfg.BondDenom), + fmt.Sprintf("%s/lbm/bank/v1/balances/%s/by_denom?denom=%s", baseURL, val.Address.String(), s.cfg.BondDenom), &types.QueryBalanceResponse{}, &types.QueryBalanceResponse{ Balance: &sdk.Coin{ @@ -238,7 +238,7 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() { }, { "gPRC account balance of a bogus denom", - fmt.Sprintf("%s/lbm/bank/v1/balances/%s/foobar", baseURL, val.Address.String()), + fmt.Sprintf("%s/lbm/bank/v1/balances/%s/by_denom?denom=foobar", baseURL, val.Address.String()), &types.QueryBalanceResponse{}, &types.QueryBalanceResponse{ Balance: &sdk.Coin{ diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index 57208d3562..67ede715f0 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -690,58 +690,58 @@ func init() { func init() { proto.RegisterFile("lbm/bank/v1/query.proto", fileDescriptor_6855f2fb4415a4b9) } var fileDescriptor_6855f2fb4415a4b9 = []byte{ - // 812 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x4f, 0xdb, 0x48, - 0x14, 0x8e, 0xd9, 0x25, 0x09, 0x2f, 0xda, 0x95, 0x76, 0x08, 0x4b, 0x30, 0xac, 0x03, 0x43, 0x16, - 0x58, 0xc1, 0x7a, 0x14, 0xf6, 0xb0, 0xda, 0x3d, 0x50, 0x35, 0xf4, 0xc0, 0xa5, 0x82, 0xa6, 0x3f, - 0x0e, 0xa8, 0x52, 0x35, 0x21, 0x6e, 0x88, 0xb0, 0x3d, 0x26, 0xe3, 0xa4, 0x45, 0x08, 0x55, 0x6a, - 0xa5, 0xaa, 0xbd, 0x54, 0x95, 0x7a, 0xea, 0x8d, 0x73, 0xff, 0x81, 0xfe, 0x0b, 0x1c, 0x91, 0x7a, - 0xe9, 0xa9, 0xad, 0xa0, 0x87, 0xfe, 0x19, 0x55, 0x66, 0xc6, 0x89, 0x9d, 0x38, 0x89, 0xaa, 0xf6, - 0x16, 0x3f, 0x7f, 0xf3, 0xbd, 0xef, 0x7b, 0xf3, 0xde, 0x73, 0x60, 0xda, 0xae, 0x38, 0xa4, 0x42, - 0xdd, 0x03, 0xd2, 0x2a, 0x92, 0xc3, 0xa6, 0xd5, 0x38, 0x32, 0xbd, 0x06, 0xf3, 0x19, 0xca, 0xd8, - 0x15, 0xc7, 0x6c, 0xbf, 0x30, 0x5b, 0x45, 0x1d, 0x4b, 0x14, 0xb7, 0x24, 0xa4, 0x8d, 0xf5, 0x68, - 0xad, 0xee, 0x52, 0xbf, 0xce, 0x5c, 0x79, 0x40, 0xcf, 0xd6, 0x58, 0x8d, 0x89, 0x9f, 0xa4, 0xfd, - 0x4b, 0x45, 0xe7, 0x6a, 0x8c, 0xd5, 0x6c, 0x8b, 0x50, 0xaf, 0x4e, 0xa8, 0xeb, 0x32, 0x5f, 0x1c, - 0xe1, 0xea, 0xed, 0xef, 0x1d, 0xde, 0x56, 0x91, 0xec, 0xb1, 0xba, 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0x42, 0x3a, 0x90, 0xa7, 0x4a, 0x35, 0xd4, 0x4b, 0x07, 0xbc, 0xfe, - 0x34, 0x05, 0xe3, 0x82, 0x17, 0x3d, 0x82, 0x94, 0x9a, 0x52, 0x34, 0x1f, 0x39, 0x1b, 0xb3, 0xd9, - 0xf4, 0x85, 0x21, 0x08, 0x29, 0x09, 0x93, 0xc7, 0xef, 0x3e, 0xbf, 0x1a, 0xfb, 0x0b, 0x2d, 0x93, - 0xe8, 0xd2, 0x94, 0x43, 0x4a, 0x8e, 0xd5, 0xc2, 0x39, 0x21, 0xc7, 0xc2, 0xe0, 0x09, 0x7a, 0xa2, - 0x41, 0x26, 0xb4, 0x2a, 0x50, 0xa1, 0x3f, 0x47, 0xff, 0x26, 0xd3, 0xff, 0x1c, 0x81, 0x52, 0x6a, - 0x96, 0x85, 0x9a, 0x05, 0x94, 0x1f, 0xa1, 0x06, 0x3d, 0x80, 0x4c, 0x68, 0xb6, 0xe3, 0x44, 0xf4, - 0x6f, 0x85, 0x38, 0x11, 0x31, 0x0b, 0x02, 0xcf, 0x0a, 0x11, 0x53, 0x68, 0x32, 0x22, 0x42, 0x4e, - 0x39, 0x6a, 0x41, 0x3a, 0x18, 0x59, 0x14, 0x53, 0xde, 0x9e, 0xe1, 0xd7, 0xf1, 0x30, 0x88, 0xca, - 0xb7, 0x28, 0xf2, 0xfd, 0x81, 0x66, 0x63, 0xf2, 0x75, 0xca, 0xbe, 0x0f, 0x49, 0x39, 0x9d, 0x28, - 0xdf, 0x4f, 0x19, 0x19, 0x7d, 0x7d, 0x7e, 0x30, 0x60, 0xa8, 0x43, 0x39, 0xef, 0xe8, 0x85, 0x06, - 0xbf, 0x44, 0xda, 0x17, 0x2d, 0xf5, 0x13, 0xc6, 0x8d, 0x84, 0xbe, 0x3c, 0x12, 0xa7, 0xf2, 0xaf, - 0x89, 0xfc, 0x4b, 0xa8, 0x10, 0xc9, 0x2f, 0x9c, 0xf2, 0x7b, 0x41, 0xd3, 0x77, 0xac, 0x3f, 0xd7, - 0xe0, 0xd7, 0xe8, 0x76, 0x40, 0x83, 0x32, 0xf5, 0xae, 0x27, 0x7d, 0x65, 0x34, 0x50, 0x69, 0x2a, - 0x08, 0x4d, 0x06, 0x9a, 0x1b, 0xa6, 0xa9, 0xb4, 0x71, 0x76, 0x61, 0x68, 0xe7, 0x17, 0x86, 0xf6, - 0xe9, 0xc2, 0xd0, 0x5e, 0x5e, 0x1a, 0x89, 0xf3, 0x4b, 0x23, 0xf1, 0xfe, 0xd2, 0x48, 0xec, 0x16, - 0x06, 0x7d, 0x2b, 0x1e, 0x4a, 0x32, 0xf1, 0xc9, 0xa8, 0x24, 0xc5, 0x3f, 0x91, 0x7f, 0xbe, 0x06, - 0x00, 0x00, 0xff, 0xff, 0xb5, 0x9f, 0xe5, 0x4d, 0x39, 0x09, 0x00, 0x00, + // 815 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x6f, 0xd3, 0x4a, + 0x14, 0x8d, 0xfb, 0x5e, 0x93, 0x74, 0xa2, 0xf7, 0xa4, 0x37, 0x4d, 0x5f, 0x53, 0xb7, 0x38, 0xed, + 0x34, 0xb4, 0x15, 0x2d, 0x1e, 0x52, 0x16, 0x08, 0x16, 0x45, 0xa4, 0x2c, 0xba, 0x41, 0x2d, 0xe1, + 0x63, 0x51, 0x21, 0x55, 0xe3, 0xc6, 0xa4, 0x51, 0x6d, 0x8f, 0x9b, 0x71, 0x02, 0x51, 0x55, 0x09, + 0xc1, 0xa6, 0x6c, 0x10, 0x12, 0x2b, 0x76, 0x5d, 0xf3, 0x07, 0xf8, 0x0b, 0x5d, 0x56, 0x62, 0xc3, + 0x0a, 0x50, 0xcb, 0x82, 0x9f, 0x81, 0x32, 0x33, 0x4e, 0xec, 0xd8, 0x49, 0x84, 0x60, 0x17, 0x5f, + 0x9f, 0x39, 0xf7, 0x9c, 0x3b, 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x5c, 0xc4, 0x04, 0x1c, 0x0f, 0x89, 0x10, 0x73, + 0x0e, 0x9b, 0x20, 0xed, 0x0f, 0x2d, 0x8c, 0xa9, 0x6f, 0xcf, 0xf8, 0xab, 0x68, 0x10, 0x44, 0xe6, + 0x9b, 0xe7, 0xf9, 0x2e, 0xc1, 0xe9, 0x98, 0x7c, 0xf8, 0x90, 0x57, 0xfd, 0x08, 0xee, 0x81, 0xa4, + 0x98, 0x4f, 0x98, 0x8f, 0x52, 0x86, 0x86, 0x5f, 0x9d, 0xed, 0x0f, 0x18, 0xe8, 0x50, 0x4c, 0x3c, + 0x7c, 0xa3, 0x80, 0x7f, 0x42, 0x0d, 0x0c, 0x17, 0xa2, 0x84, 0x71, 0x43, 0xa1, 0x2e, 0x0e, 0xc5, + 0xc9, 0xfc, 0x2b, 0x3c, 0xff, 0x02, 0x2c, 0x84, 0xf2, 0x73, 0xa7, 0x6c, 0xc7, 0x6f, 0xfb, 0x8e, + 0xf5, 0xd7, 0x0a, 0xf8, 0x37, 0xbc, 0x1f, 0x60, 0xbf, 0x4c, 0xbd, 0x0b, 0x4a, 0x5d, 0x1a, 0x0e, + 0x94, 0x9a, 0x0a, 0x5c, 0x93, 0x06, 0x67, 0x06, 0x69, 0x2a, 0xad, 0x9d, 0x9e, 0x6b, 0xca, 0xd9, + 0xb9, 0xa6, 0x7c, 0x3b, 0xd7, 0x94, 0xb7, 0x17, 0x5a, 0xe2, 0xec, 0x42, 0x4b, 0x7c, 0xbe, 0xd0, + 0x12, 0xdb, 0x85, 0x7e, 0x5f, 0x8b, 0xe7, 0x82, 0x8c, 0x7f, 0x34, 0x8c, 0x24, 0xff, 0x2f, 0x72, + 0xfd, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x46, 0xce, 0xc7, 0x3b, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/bank/types/query.pb.gw.go b/x/bank/types/query.pb.gw.go index ac8e2efed6..1f738096de 100644 --- a/x/bank/types/query.pb.gw.go +++ b/x/bank/types/query.pb.gw.go @@ -31,6 +31,10 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var ( + filter_Query_Balance_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_Query_Balance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryBalanceRequest var metadata runtime.ServerMetadata @@ -53,15 +57,11 @@ func request_Query_Balance_0(ctx context.Context, marshaler runtime.Marshaler, c return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Balance_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Balance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -91,15 +91,11 @@ func local_request_Query_Balance_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Balance_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.Balance(ctx, &protoReq) @@ -690,7 +686,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Balance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"lbm", "bank", "v1", "balances", "address", "denom"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_Balance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"lbm", "bank", "v1", "balances", "address", "by_denom"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_AllBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"lbm", "bank", "v1", "balances", "address"}, "", runtime.AssumeColonVerbOpt(true))) diff --git a/x/capability/module.go b/x/capability/module.go index 48cc8fe46d..7b7cc778c6 100644 --- a/x/capability/module.go +++ b/x/capability/module.go @@ -143,9 +143,6 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json return cdc.MustMarshalJSON(genState) } -// ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } - // BeginBlocker will call InitMemStore to initialize the memory stores in the case // that this is the first time the node is executing a block since restarting (wiping memory). // In this case, the BeginBlocker method will reinitialize the memory stores locally, so that subsequent diff --git a/x/genutil/client/cli/init.go b/x/genutil/client/cli/init.go index 0ba858fab1..71d910dfc3 100644 --- a/x/genutil/client/cli/init.go +++ b/x/genutil/client/cli/init.go @@ -76,7 +76,6 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { serverCtx := server.GetServerContextFromCmd(cmd) config := serverCtx.Config - config.SetRoot(clientCtx.HomeDir) chainID, _ := cmd.Flags().GetString(flags.FlagChainID) diff --git a/x/gov/client/testutil/helpers.go b/x/gov/client/testutil/helpers.go index 6a64ec4642..aba61b20a9 100644 --- a/x/gov/client/testutil/helpers.go +++ b/x/gov/client/testutil/helpers.go @@ -55,3 +55,15 @@ func MsgDeposit(clientCtx client.Context, from, id, deposit string, extraArgs .. return clitestutil.ExecTestCLICmd(clientCtx, govcli.NewCmdDeposit(), args) } + +func MsgDeposit(clientCtx client.Context, from, id, deposit string, extraArgs ...string) (testutil.BufferWriter, error) { + args := append([]string{ + id, + deposit, + fmt.Sprintf("--%s=%s", flags.FlagFrom, from), + }, commonArgs...) + + args = append(args, extraArgs...) + + return clitestutil.ExecTestCLICmd(clientCtx, govcli.NewCmdDeposit(), args) +} diff --git a/x/gov/client/utils/utils.go b/x/gov/client/utils/utils.go index d875b9430c..ba7f160e02 100644 --- a/x/gov/client/utils/utils.go +++ b/x/gov/client/utils/utils.go @@ -26,20 +26,6 @@ func NormalizeVoteOption(option string) string { } } -// NormalizeWeightedVoteOptions - normalize vote options param string -func NormalizeWeightedVoteOptions(options string) string { - newOptions := []string{} - for _, option := range strings.Split(options, ",") { - fields := strings.Split(option, "=") - fields[0] = NormalizeVoteOption(fields[0]) - if len(fields) < 2 { - fields = append(fields, "1") - } - newOptions = append(newOptions, strings.Join(fields, "=")) - } - return strings.Join(newOptions, ",") -} - // NormalizeProposalType - normalize user specified proposal type func NormalizeProposalType(proposalType string) string { switch proposalType { diff --git a/x/ibc/core/04-channel/types/errors.go b/x/ibc/core/04-channel/types/errors.go index 7f8c4c4254..b349f7df33 100644 --- a/x/ibc/core/04-channel/types/errors.go +++ b/x/ibc/core/04-channel/types/errors.go @@ -25,4 +25,7 @@ var ( ErrPacketReceived = sdkerrors.Register(SubModuleName, 18, "packet already received") ErrAcknowledgementExists = sdkerrors.Register(SubModuleName, 19, "acknowledgement for packet already exists") ErrInvalidChannelIdentifier = sdkerrors.Register(SubModuleName, 20, "invalid channel identifier") + + // Antehandler error + ErrRedundantTx = sdkerrors.Register(SubModuleName, 22, "packet messages are redundant") ) diff --git a/x/ibc/core/ante/ante.go b/x/ibc/core/ante/ante.go new file mode 100644 index 0000000000..f874b2bb74 --- /dev/null +++ b/x/ibc/core/ante/ante.go @@ -0,0 +1,72 @@ +package ante + +import ( + sdk "github.com/line/lbm-sdk/types" + clienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" + channelkeeper "github.com/line/lbm-sdk/x/ibc/core/04-channel/keeper" + channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" +) + +type Decorator struct { + k channelkeeper.Keeper +} + +func NewAnteDecorator(k channelkeeper.Keeper) Decorator { + return Decorator{k: k} +} + +// AnteDecorator returns an error if a multiMsg tx only contains packet messages (Recv, Ack, Timeout) and additional update messages and all packet messages +// are redundant. If the transaction is just a single UpdateClient message, or the multimsg transaction contains some other message type, then the antedecorator returns no error +// and continues processing to ensure these transactions are included. +// This will ensure that relayers do not waste fees on multiMsg transactions when another relayer has already submitted all packets, by rejecting the tx at the mempool layer. +func (ad Decorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + // do not run redundancy check on DeliverTx or simulate + if (ctx.IsCheckTx() || ctx.IsReCheckTx()) && !simulate { + // keep track of total packet messages and number of redundancies across `RecvPacket`, `AcknowledgePacket`, and `TimeoutPacket/OnClose` + redundancies := 0 + packetMsgs := 0 + for _, m := range tx.GetMsgs() { + switch msg := m.(type) { + case *channeltypes.MsgRecvPacket: + if _, found := ad.k.GetPacketReceipt(ctx, msg.Packet.GetDestPort(), msg.Packet.GetDestChannel(), msg.Packet.GetSequence()); found { + redundancies++ + } + packetMsgs++ + + case *channeltypes.MsgAcknowledgement: + if commitment := ad.k.GetPacketCommitment(ctx, msg.Packet.GetSourcePort(), msg.Packet.GetSourceChannel(), msg.Packet.GetSequence()); len(commitment) == 0 { + redundancies++ + } + packetMsgs++ + + case *channeltypes.MsgTimeout: + if commitment := ad.k.GetPacketCommitment(ctx, msg.Packet.GetSourcePort(), msg.Packet.GetSourceChannel(), msg.Packet.GetSequence()); len(commitment) == 0 { + redundancies++ + } + packetMsgs++ + + case *channeltypes.MsgTimeoutOnClose: + if commitment := ad.k.GetPacketCommitment(ctx, msg.Packet.GetSourcePort(), msg.Packet.GetSourceChannel(), msg.Packet.GetSequence()); len(commitment) == 0 { + redundancies++ + } + packetMsgs++ + + case *clienttypes.MsgUpdateClient: + // do nothing here, as we want to avoid updating clients if it is batched with only redundant messages + + default: + // if the multiMsg tx has a msg that is not a packet msg or update msg, then we will not return error + // regardless of if all packet messages are redundant. This ensures that non-packet messages get processed + // even if they get batched with redundant packet messages. + return next(ctx, tx, simulate) + } + + } + + // only return error if all packet messages are redundant + if redundancies == packetMsgs && packetMsgs > 0 { + return ctx, channeltypes.ErrRedundantTx + } + } + return next(ctx, tx, simulate) +} From 7cd4a707ecb06d28d98aee75eaee6a92f7d80301 Mon Sep 17 00:00:00 2001 From: "Steve H. Jung" Date: Mon, 14 Feb 2022 19:35:07 +0900 Subject: [PATCH 2/6] chore: fixed test errors --- client/keys/export_test.go | 4 ++-- client/keys/import_test.go | 2 ++ go.mod | 4 +--- go.sum | 10 +++------ simapp/ante_handler.go | 11 +++++++--- simapp/app.go | 9 ++------ store/cachekv/memiterator.go | 24 ++++++++++++++++----- store/cachekv/store.go | 36 ++++++++++---------------------- x/auth/client/cli/cli_test.go | 2 -- x/auth/tx/service.go | 2 +- x/capability/module.go | 3 +++ x/gov/client/testutil/helpers.go | 12 ----------- x/gov/client/utils/utils.go | 14 +++++++++++++ x/gov/types/expected_keepers.go | 1 + 14 files changed, 67 insertions(+), 67 deletions(-) diff --git a/client/keys/export_test.go b/client/keys/export_test.go index d5c88175bb..cc40a9ce3f 100644 --- a/client/keys/export_test.go +++ b/client/keys/export_test.go @@ -52,7 +52,7 @@ func Test_runExportCmd(t *testing.T) { extraArgs: []string{"--unsafe", "--unarmored-hex"}, userInput: "y\n", mustFail: false, - expectedOutput: "2485e33678db4175dc0ecef2d6e1fc493d4a0d7f7ce83324b6ed70afe77f3485\n", + expectedOutput: "d4bd5d54ee1b75abc6f5bab08e2e9d3a4b6dfbe6b50e2d6cf2426f3215633a1f\n", }, { name: "file keyring backend properly read password and user confirmation", @@ -61,7 +61,7 @@ func Test_runExportCmd(t *testing.T) { // first 2 pass for creating the key, then unsafe export confirmation, then unlock keyring pass userInput: "12345678\n12345678\ny\n12345678\n", mustFail: false, - expectedOutput: "2485e33678db4175dc0ecef2d6e1fc493d4a0d7f7ce83324b6ed70afe77f3485\n", + expectedOutput: "d4bd5d54ee1b75abc6f5bab08e2e9d3a4b6dfbe6b50e2d6cf2426f3215633a1f\n", }, } diff --git a/client/keys/import_test.go b/client/keys/import_test.go index be0f68a370..f511a16e7e 100644 --- a/client/keys/import_test.go +++ b/client/keys/import_test.go @@ -2,6 +2,7 @@ package keys import ( "context" + "fmt" "io/ioutil" "os" "path/filepath" @@ -10,6 +11,7 @@ import ( "github.com/stretchr/testify/require" "github.com/line/lbm-sdk/client" + "github.com/line/lbm-sdk/client/flags" "github.com/line/lbm-sdk/crypto/keyring" "github.com/line/lbm-sdk/testutil" sdk "github.com/line/lbm-sdk/types" diff --git a/go.mod b/go.mod index 90a33e6eaf..c496b44be7 100644 --- a/go.mod +++ b/go.mod @@ -27,14 +27,13 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/line/iavl/v2 v2.0.0-init.1.0.20220204054249-bc24184afa8c + github.com/line/iavl/v2 v2.0.0-init.1.0.20220126182233-76c57efa2e11 github.com/line/ostracon v1.0.2 github.com/line/tm-db/v2 v2.0.0-init.1.0.20220121012851-61d2bc1d9486 github.com/line/wasmvm v0.14.0-0.8.0 github.com/magiconair/properties v1.8.5 github.com/mailru/easyjson v0.7.7 github.com/mattn/go-isatty v0.0.14 - github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect github.com/onsi/ginkgo v1.16.4 // indirect github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.0 @@ -55,7 +54,6 @@ require ( google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa google.golang.org/grpc v1.43.0 google.golang.org/protobuf v1.27.1 - gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index bd12eb570d..f16734534e 100644 --- a/go.sum +++ b/go.sum @@ -353,7 +353,6 @@ github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0U github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 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.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= @@ -468,8 +467,8 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55 h1:cXVtMiJkvQ4kn0pxM2svH1ncJbFgQsLHtnFC9qJj2VM= github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55/go.mod h1:DHRJroSL7NaRkpvocRx3OtRsleXVsYSxBI9SfHFlTQ0= -github.com/line/iavl/v2 v2.0.0-init.1.0.20220204054249-bc24184afa8c h1:KvXWdlzWP2ttG8AREn6NDI/mlkr/W8Ekmqc/SEjpwG4= -github.com/line/iavl/v2 v2.0.0-init.1.0.20220204054249-bc24184afa8c/go.mod h1:rchB/g/7tqt2uHeiPlhz8X1APwIWaEdWZWiGG3I9uj8= +github.com/line/iavl/v2 v2.0.0-init.1.0.20220126182233-76c57efa2e11 h1:ALOY7ur7HJabVF/g6k8QIzttru0uLxHRK0+ZGaM3PU4= +github.com/line/iavl/v2 v2.0.0-init.1.0.20220126182233-76c57efa2e11/go.mod h1:uK2CYRdukSVRGhc5Q8zoDUnm/zAbfnZATbFXrfCrQKA= github.com/line/ostracon v0.34.9-0.20210429084710-ef4fe0a40c7d/go.mod h1:ttnbq+yQJMQ9a2MT5SEisOoa/+pOgh2KenTiK/rVdiw= github.com/line/ostracon v1.0.2 h1:sbZtNrLYFKDP74tXYgMVkrzKJKk2Sqn1Oczl1+f7sgI= github.com/line/ostracon v1.0.2/go.mod h1:elTiUFLvBz6Yaze+ZZLlbUnhqKWLJ7cMy/P9rSabafQ= @@ -808,9 +807,8 @@ golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 h1:FR+oGxGfbQu1d+jglI3rCkjAjUnhRSZcUxr+DqlDLNo= -golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -871,7 +869,6 @@ golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 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= golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= @@ -967,7 +964,6 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/simapp/ante_handler.go b/simapp/ante_handler.go index e14b6b6bba..60f104a451 100644 --- a/simapp/ante_handler.go +++ b/simapp/ante_handler.go @@ -3,7 +3,10 @@ package simapp import ( sdk "github.com/line/lbm-sdk/types" "github.com/line/lbm-sdk/x/auth/ante" + keeper2 "github.com/line/lbm-sdk/x/auth/keeper" "github.com/line/lbm-sdk/x/auth/signing" + feegrantkeeper "github.com/line/lbm-sdk/x/feegrant/keeper" + types2 "github.com/line/lbm-sdk/x/feegrant/types" "github.com/line/lbm-sdk/x/gov/types" channelkeeper "github.com/line/lbm-sdk/x/ibc/core/04-channel/keeper" ibcante "github.com/line/lbm-sdk/x/ibc/core/ante" @@ -12,6 +15,7 @@ import ( func NewAnteHandler( ak ante.AccountKeeper, bankKeeper types.BankKeeper, //nolint:interfacer + feegrantKeeper feegrantkeeper.Keeper, sigGasConsumer ante.SignatureVerificationGasConsumer, signModeHandler signing.SignModeHandler, channelKeeper channelkeeper.Keeper, @@ -21,16 +25,17 @@ func NewAnteHandler( ante.NewRejectExtensionOptionsDecorator(), ante.NewMempoolFeeDecorator(), ante.NewValidateBasicDecorator(), + ante.NewTxSigBlockHeightDecorator(ak), ante.TxTimeoutHeightDecorator{}, ante.NewValidateMemoDecorator(ak), ante.NewConsumeGasForTxSizeDecorator(ak), - ante.NewRejectFeeGranterDecorator(), + ante.NewDeductGrantedFeeDecorator(ak.(keeper2.AccountKeeper), bankKeeper.(types2.BankKeeper), feegrantKeeper), ante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators ante.NewValidateSigCountDecorator(ak), - ante.NewDeductFeeDecorator(ak, bankKeeper), + // ante.NewDeductFeeDecorator(ak, bankKeeper), ante.NewSigGasConsumeDecorator(ak, sigGasConsumer), ante.NewSigVerificationDecorator(ak, signModeHandler), - ante.NewIncrementSequenceDecorator(ak), + ante.NewIncrementSequenceDecorator(ak, bankKeeper), ibcante.NewAnteDecorator(channelKeeper), ) } diff --git a/simapp/app.go b/simapp/app.go index c2ed354685..4edf273784 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -435,15 +435,10 @@ func NewSimApp( app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) app.SetAnteHandler( -<<<<<<< HEAD - ante.NewAnteHandler( - app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, ante.DefaultSigVerificationGasConsumer, - encodingConfig.TxConfig.SignModeHandler(), -======= NewAnteHandler( - app.AccountKeeper, app.BankKeeper, ante.DefaultSigVerificationGasConsumer, + app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, + ante.DefaultSigVerificationGasConsumer, encodingConfig.TxConfig.SignModeHandler(), app.IBCKeeper.ChannelKeeper, ->>>>>>> v0.42.11 ), ) app.SetEndBlocker(app.EndBlocker) diff --git a/store/cachekv/memiterator.go b/store/cachekv/memiterator.go index cbdd0b1299..26f9d2e2d4 100644 --- a/store/cachekv/memiterator.go +++ b/store/cachekv/memiterator.go @@ -1,7 +1,10 @@ package cachekv import ( - tmdb "github.com/line/tm-db/v2" + "bytes" + "sync" + + memdb "github.com/line/tm-db/v2/memdb" "github.com/line/lbm-sdk/store/types" ) @@ -15,7 +18,17 @@ type memIterator struct { deleted map[string]struct{} } -func newMemIterator(start, end []byte, items *tmdb.MemDB, deleted map[string]struct{}, ascending bool) *memIterator { +func IsKeyInDomain(key, start, end []byte) bool { + if bytes.Compare(key, start) < 0 { + return false + } + if end != nil && bytes.Compare(end, key) <= 0 { + return false + } + return true +} + +func newMemIterator(start, end []byte, items *memdb.MemDB, deleted *sync.Map, ascending bool) *memIterator { var iter types.Iterator var err error @@ -30,9 +43,10 @@ func newMemIterator(start, end []byte, items *tmdb.MemDB, deleted map[string]str } newDeleted := make(map[string]struct{}) - for k, v := range deleted { - newDeleted[k] = v - } + deleted.Range(func(key, value interface{}) bool { + newDeleted[key.(string)] = value.(struct{}) + return true + }) return &memIterator{ Iterator: iter, diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 1019136738..6bb07e113c 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -9,7 +9,7 @@ import ( "time" "unsafe" - tmdb "github.com/line/tm-db/v2" + memdb "github.com/line/tm-db/v2/memdb" "github.com/line/lbm-sdk/store/tracekv" "github.com/line/lbm-sdk/store/types" @@ -31,7 +31,7 @@ type Store struct { cache sync.Map deleted sync.Map unsortedCache sync.Map - sortedCache *tmdb.MemDB // always ascending sorted + sortedCache *memdb.MemDB // always ascending sorted parent types.KVStore } @@ -43,7 +43,7 @@ func NewStore(parent types.KVStore) *Store { cache: sync.Map{}, deleted: sync.Map{}, unsortedCache: sync.Map{}, - sortedCache: tmdb.NewMemDB(), + sortedCache: memdb.NewDB(), parent: parent, } } @@ -143,7 +143,7 @@ func (store *Store) Write() { store.cache = sync.Map{} store.deleted = sync.Map{} store.unsortedCache = sync.Map{} - store.sortedCache = tmdb.NewMemDB() + store.sortedCache = memdb.NewDB() } // CacheWrap implements CacheWrapper. @@ -182,12 +182,12 @@ func (store *Store) iterator(start, end []byte, ascending bool) types.Iterator { } store.dirtyItems(start, end) - cache = newMemIterator(start, end, store.sortedCache, store.deleted, ascending) + cache = newMemIterator(start, end, store.sortedCache, &store.deleted, ascending) return newCacheMergeIterator(parent, cache, ascending) } -// strToByte is meant to make a zero allocation conversion +// strToBytes is meant to make a zero allocation conversion // from string -> []byte to speed up operations, it is not meant // to be used generally, but for a specific pattern to check for available // keys within a domain. @@ -211,7 +211,6 @@ func byteSliceToStr(b []byte) string { // Constructs a slice of dirty items, to use w/ memIterator. func (store *Store) dirtyItems(start, end []byte) { - n := len(store.unsortedCache) unsorted := make([]*kv.Pair, 0) // If the unsortedCache is too big, its costs too much to determine // whats in the subset we are concerned about. @@ -221,33 +220,20 @@ func (store *Store) dirtyItems(start, end []byte) { // than just not having the cache. store.unsortedCache.Range(func(k, _ interface{}) bool { key := k.(string) - if n >= 1024 { + if IsKeyInDomain(strToBytes(key), start, end) { cacheValue, ok := store.cache.Load(key) if ok { unsorted = append(unsorted, &kv.Pair{Key: []byte(key), Value: cacheValue.(*cValue).value}) } - } else { - if tmdb.IsKeyInDomain(strToByte(key), start, end) { - cacheValue, ok := store.cache.Load(key) - if ok { - unsorted = append(unsorted, &kv.Pair{Key: []byte(key), Value: cacheValue.(*cValue).value}) - } - } } + return true }) store.clearUnsortedCacheSubset(unsorted) } func (store *Store) clearUnsortedCacheSubset(unsorted []*kv.Pair) { - n := len(store.unsortedCache) - if len(unsorted) == n { // This pattern allows the Go compiler to emit the map clearing idiom for the entire map. - for key := range store.unsortedCache { - delete(store.unsortedCache, key) - } - } else { // Otherwise, normally delete the unsorted keys from the map. - for _, kv := range unsorted { - delete(store.unsortedCache, byteSliceToStr(kv.Key)) - } + for _, kv := range unsorted { + store.unsortedCache.Delete(byteSliceToStr(kv.Key)) } sort.Slice(unsorted, func(i, j int) bool { return bytes.Compare(unsorted[i].Key, unsorted[j].Key) < 0 @@ -288,6 +274,6 @@ func (store *Store) setCacheValue(key, value []byte, deleted bool, dirty bool) { } func (store *Store) isDeleted(key string) bool { - _, ok := store.deleted[key] + _, ok := store.deleted.Load(key) return ok } diff --git a/x/auth/client/cli/cli_test.go b/x/auth/client/cli/cli_test.go index 4b5e39166b..caa42313fe 100644 --- a/x/auth/client/cli/cli_test.go +++ b/x/auth/client/cli/cli_test.go @@ -12,8 +12,6 @@ import ( "strings" "testing" - "github.com/gogo/protobuf/proto" - sdkerrors "github.com/line/lbm-sdk/types/errors" ostcli "github.com/line/ostracon/libs/cli" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index 731a1f25da..bc52099443 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -64,7 +64,7 @@ func (s txServer) GetTxsEvent(ctx context.Context, req *txtypes.GetTxsEventReque } } - result, err := queryTxsByEvents(ctx, s.clientCtx, req.Events, page, limit, orderBy) + result, err := queryTxsByEvents(ctx, s.clientCtx, req.Events, req.Prove, page, limit, orderBy) if err != nil { return nil, err } diff --git a/x/capability/module.go b/x/capability/module.go index 7b7cc778c6..48cc8fe46d 100644 --- a/x/capability/module.go +++ b/x/capability/module.go @@ -143,6 +143,9 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json return cdc.MustMarshalJSON(genState) } +// ConsensusVersion implements AppModule/ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 1 } + // BeginBlocker will call InitMemStore to initialize the memory stores in the case // that this is the first time the node is executing a block since restarting (wiping memory). // In this case, the BeginBlocker method will reinitialize the memory stores locally, so that subsequent diff --git a/x/gov/client/testutil/helpers.go b/x/gov/client/testutil/helpers.go index aba61b20a9..6a64ec4642 100644 --- a/x/gov/client/testutil/helpers.go +++ b/x/gov/client/testutil/helpers.go @@ -55,15 +55,3 @@ func MsgDeposit(clientCtx client.Context, from, id, deposit string, extraArgs .. return clitestutil.ExecTestCLICmd(clientCtx, govcli.NewCmdDeposit(), args) } - -func MsgDeposit(clientCtx client.Context, from, id, deposit string, extraArgs ...string) (testutil.BufferWriter, error) { - args := append([]string{ - id, - deposit, - fmt.Sprintf("--%s=%s", flags.FlagFrom, from), - }, commonArgs...) - - args = append(args, extraArgs...) - - return clitestutil.ExecTestCLICmd(clientCtx, govcli.NewCmdDeposit(), args) -} diff --git a/x/gov/client/utils/utils.go b/x/gov/client/utils/utils.go index ba7f160e02..d875b9430c 100644 --- a/x/gov/client/utils/utils.go +++ b/x/gov/client/utils/utils.go @@ -26,6 +26,20 @@ func NormalizeVoteOption(option string) string { } } +// NormalizeWeightedVoteOptions - normalize vote options param string +func NormalizeWeightedVoteOptions(options string) string { + newOptions := []string{} + for _, option := range strings.Split(options, ",") { + fields := strings.Split(option, "=") + fields[0] = NormalizeVoteOption(fields[0]) + if len(fields) < 2 { + fields = append(fields, "1") + } + newOptions = append(newOptions, strings.Join(fields, "=")) + } + return strings.Join(newOptions, ",") +} + // NormalizeProposalType - normalize user specified proposal type func NormalizeProposalType(proposalType string) string { switch proposalType { diff --git a/x/gov/types/expected_keepers.go b/x/gov/types/expected_keepers.go index aa6f44a511..f1c2797740 100644 --- a/x/gov/types/expected_keepers.go +++ b/x/gov/types/expected_keepers.go @@ -48,4 +48,5 @@ type BankKeeper interface { SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error + Prefetch(ctx sdk.Context, tx sdk.Tx) } From 595028b9a619ea9ac541f7c578c9a316409aa027 Mon Sep 17 00:00:00 2001 From: "Steve H. Jung" Date: Wed, 16 Feb 2022 09:39:12 +0900 Subject: [PATCH 3/6] chore: bumped up iavl --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c496b44be7..89c275ae2c 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/line/iavl/v2 v2.0.0-init.1.0.20220126182233-76c57efa2e11 + github.com/line/iavl/v2 v2.0.0-init.1.0.20220215225951-cb11c91d8857 github.com/line/ostracon v1.0.2 github.com/line/tm-db/v2 v2.0.0-init.1.0.20220121012851-61d2bc1d9486 github.com/line/wasmvm v0.14.0-0.8.0 diff --git a/go.sum b/go.sum index f16734534e..a11f0a1a10 100644 --- a/go.sum +++ b/go.sum @@ -467,8 +467,8 @@ github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-b github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55 h1:cXVtMiJkvQ4kn0pxM2svH1ncJbFgQsLHtnFC9qJj2VM= github.com/line/gorocksdb v0.0.0-20210406043732-d4bea34b6d55/go.mod h1:DHRJroSL7NaRkpvocRx3OtRsleXVsYSxBI9SfHFlTQ0= -github.com/line/iavl/v2 v2.0.0-init.1.0.20220126182233-76c57efa2e11 h1:ALOY7ur7HJabVF/g6k8QIzttru0uLxHRK0+ZGaM3PU4= -github.com/line/iavl/v2 v2.0.0-init.1.0.20220126182233-76c57efa2e11/go.mod h1:uK2CYRdukSVRGhc5Q8zoDUnm/zAbfnZATbFXrfCrQKA= +github.com/line/iavl/v2 v2.0.0-init.1.0.20220215225951-cb11c91d8857 h1:8kWqbLNeb37357e4U/7uLMVCRF3K9bxwTGb6JmRUKpI= +github.com/line/iavl/v2 v2.0.0-init.1.0.20220215225951-cb11c91d8857/go.mod h1:uK2CYRdukSVRGhc5Q8zoDUnm/zAbfnZATbFXrfCrQKA= github.com/line/ostracon v0.34.9-0.20210429084710-ef4fe0a40c7d/go.mod h1:ttnbq+yQJMQ9a2MT5SEisOoa/+pOgh2KenTiK/rVdiw= github.com/line/ostracon v1.0.2 h1:sbZtNrLYFKDP74tXYgMVkrzKJKk2Sqn1Oczl1+f7sgI= github.com/line/ostracon v1.0.2/go.mod h1:elTiUFLvBz6Yaze+ZZLlbUnhqKWLJ7cMy/P9rSabafQ= From f188cb2a6a350c15b7c05172ec5f8e80bc0b734d Mon Sep 17 00:00:00 2001 From: "Steve H. Jung" Date: Fri, 18 Feb 2022 07:56:58 +0900 Subject: [PATCH 4/6] style: removed blank line and unnecessary aliases --- Makefile | 1 - store/cachekv/memiterator.go | 2 +- store/cachekv/store.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index caa55ecf5f..a393615c0b 100644 --- a/Makefile +++ b/Makefile @@ -451,7 +451,6 @@ proto-check-breaking: @$(DOCKER_BUF) check breaking --against $(HTTPS_GIT)#branch=main - TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc6/proto/tendermint GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master diff --git a/store/cachekv/memiterator.go b/store/cachekv/memiterator.go index 26f9d2e2d4..e378991260 100644 --- a/store/cachekv/memiterator.go +++ b/store/cachekv/memiterator.go @@ -4,7 +4,7 @@ import ( "bytes" "sync" - memdb "github.com/line/tm-db/v2/memdb" + "github.com/line/tm-db/v2/memdb" "github.com/line/lbm-sdk/store/types" ) diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 6bb07e113c..6c199ea161 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -9,7 +9,7 @@ import ( "time" "unsafe" - memdb "github.com/line/tm-db/v2/memdb" + "github.com/line/tm-db/v2/memdb" "github.com/line/lbm-sdk/store/tracekv" "github.com/line/lbm-sdk/store/types" From 1fba941acc83351fe3013645c8c69e10af305b76 Mon Sep 17 00:00:00 2001 From: "Steve H. Jung" Date: Sat, 19 Feb 2022 08:07:00 +0900 Subject: [PATCH 5/6] test: fixed query height case and pruning case --- .github/workflows/release-sims.yml | 12 ++++++++++++ client/query_test.go | 3 ++- store/rootmulti/store_test.go | 9 +++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-sims.yml b/.github/workflows/release-sims.yml index 348df80e8d..108748c93f 100644 --- a/.github/workflows/release-sims.yml +++ b/.github/workflows/release-sims.yml @@ -46,6 +46,10 @@ jobs: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary - name: test-sim-multi-seed-long-part1 + env: + USE_PREFETCH: NO + USE_PRELOAD: 1,4 + SAVE_BRANCH_LAUNCH_DEPTH: 1 run: | make test-sim-multi-seed-long-part1 @@ -59,6 +63,10 @@ jobs: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary - name: test-sim-multi-seed-long-part2 + env: + USE_PREFETCH: NO + USE_PRELOAD: 1,4 + SAVE_BRANCH_LAUNCH_DEPTH: 1 run: | make test-sim-multi-seed-long-part2 @@ -72,5 +80,9 @@ jobs: path: ~/go/bin key: ${{ runner.os }}-go-runsim-binary - name: test-sim-multi-seed-long-part3 + env: + USE_PREFETCH: NO + USE_PRELOAD: 1,4 + SAVE_BRANCH_LAUNCH_DEPTH: 1 run: | make test-sim-multi-seed-long-part3 diff --git a/client/query_test.go b/client/query_test.go index 07a62bc8b6..f869ea2601 100644 --- a/client/query_test.go +++ b/client/query_test.go @@ -56,7 +56,8 @@ func (s *IntegrationTestSuite) TestQueryABCIHeight() { res, err := clientCtx.QueryABCI(req) s.Require().NoError(err) - s.Require().Equal(tc.expHeight, res.Height) + // Line: block height could be higher if execution gets slowed down + s.Require().GreaterOrEqual(tc.expHeight, res.Height) }) } } diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index a530dd17a6..167ab86e65 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -505,6 +505,15 @@ func TestMultiStore_Pruning(t *testing.T) { for _, v := range tc.deleted { _, err := ms.CacheMultiStoreWithVersion(v) + // Line: Pruning is async. store/iavl/store.GetImmutable + // returns an empty tree when the version doesn't exist. + // However, when it gets caught in between, i.e. version + // checking is done before, but iavl.GetImmutable is done + // after pruning, it fails with 'version not exist' error. + // Simply retry would do. + if err != nil { + _, err = ms.CacheMultiStoreWithVersion(v) + } require.NoError(t, err, "expected error when loading height: %d", v) } }) From 73d8d14e46c7d18bc85bbb7a5f5fbbca36575dfd Mon Sep 17 00:00:00 2001 From: "Steve H. Jung" Date: Sat, 19 Feb 2022 08:18:25 +0900 Subject: [PATCH 6/6] test: fixed query height case again --- client/query_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/query_test.go b/client/query_test.go index f869ea2601..d26b4befca 100644 --- a/client/query_test.go +++ b/client/query_test.go @@ -57,7 +57,7 @@ func (s *IntegrationTestSuite) TestQueryABCIHeight() { s.Require().NoError(err) // Line: block height could be higher if execution gets slowed down - s.Require().GreaterOrEqual(tc.expHeight, res.Height) + s.Require().LessOrEqual(tc.expHeight, res.Height) }) } }