tendermint: update to rc3 (#6892)

* modify light imports

* change abci.header to tmproto.header

* use rc

* rc

* fix import

* Merge PR #6893: fix key imports

* fix rc2

* tendermint: update 3 (#6899)

* tendermint: update 4 (#6919)

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>

* tendermint: update 5 (#6923)

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* bump to latest master

* tendermint: update (#6972)

Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: Cory Levinson <cjlevinson@gmail.com>

* Update x/ibc/07-tendermint/types/test_utils.go

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>

* address comment

* go mod

* bring back things

* fix test

* update tm proto files

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <aleks.bezobchuk@gmail.com>
Co-authored-by: Cory Levinson <cjlevinson@gmail.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
This commit is contained in:
Marko 2020-08-14 19:58:53 +02:00 committed by GitHub
parent f87624e9de
commit 8de96d16f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
215 changed files with 2611 additions and 2329 deletions

View File

@ -335,14 +335,17 @@ proto-check-breaking-docker:
@$(DOCKER_BUF) check breaking --against-input $(HTTPS_GIT)#branch=master
.PHONY: proto-check-breaking-ci
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.33.1
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc3/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
CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/master
CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.6.2
TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto
TM_ABCI_TYPES = third_party/proto/tendermint/abci
TM_TYPES = third_party/proto/tendermint/types
TM_VERSION = third_party/proto/tendermint/version
TM_LIBS = third_party/proto/tendermint/libs/bits
TM_KV_TYPES = third_party/proto/tendermint/libs/kv
TM_MERKLE_TYPES = third_party/proto/tendermint/crypto/merkle
TM_ABCI_TYPES = third_party/proto/tendermint/abci/types
GOGO_PROTO_TYPES = third_party/proto/gogoproto
COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto
CONFIO_TYPES = third_party/proto/confio
@ -359,18 +362,22 @@ proto-update-deps:
## (which is the standard Buf.build FILE_LAYOUT)
## Issue link: https://github.com/tendermint/tendermint/issues/5021
@mkdir -p $(TM_ABCI_TYPES)
@curl -sSL $(TM_URL)/abci/types/types.proto > $(TM_ABCI_TYPES)/types.proto
@sed -i '' '7 s|third_party/proto/||g' $(TM_ABCI_TYPES)/types.proto
@sed -i '' '8 s|crypto/merkle/merkle.proto|tendermint/crypto/merkle/merkle.proto|g' $(TM_ABCI_TYPES)/types.proto
@sed -i '' '9 s|libs/kv/types.proto|tendermint/libs/kv/types.proto|g' $(TM_ABCI_TYPES)/types.proto
@curl -sSL $(TM_URL)/abci/types.proto > $(TM_ABCI_TYPES)/types.proto
@mkdir -p $(TM_KV_TYPES)
@curl -sSL $(TM_URL)/libs/kv/types.proto > $(TM_KV_TYPES)/types.proto
@sed -i '' '5 s|third_party/proto/||g' $(TM_KV_TYPES)/types.proto
@mkdir -p $(TM_VERSION)
@curl -sSL $(TM_URL)/version/types.proto > $(TM_VERSION)/types.proto
@mkdir -p $(TM_MERKLE_TYPES)
@curl -sSL $(TM_URL)/crypto/merkle/merkle.proto > $(TM_MERKLE_TYPES)/merkle.proto
@sed -i '' '7 s|third_party/proto/||g' $(TM_MERKLE_TYPES)/merkle.proto
@mkdir -p $(TM_TYPES)
@curl -sSL $(TM_URL)/types/types.proto > $(TM_TYPES)/types.proto
@curl -sSL $(TM_URL)/types/evidence.proto > $(TM_TYPES)/evidence.proto
@curl -sSL $(TM_URL)/types/params.proto > $(TM_TYPES)/params.proto
@mkdir -p $(TM_CRYPTO_TYPES)
@curl -sSL $(TM_URL)/crypto/proof.proto > $(TM_CRYPTO_TYPES)/proof.proto
@curl -sSL $(TM_URL)/crypto/keys.proto > $(TM_CRYPTO_TYPES)/keys.proto
@mkdir -p $(TM_LIBS)
@curl -sSL $(TM_URL)/libs/bits/types.proto > $(TM_LIBS)/types.proto
@mkdir -p $(CONFIO_TYPES)
@curl -sSL $(CONFIO_URL)/proofs.proto > $(CONFIO_TYPES)/proofs.proto

View File

@ -8,7 +8,9 @@ import (
"syscall"
"time"
"github.com/gogo/protobuf/proto"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/telemetry"
@ -19,7 +21,7 @@ import (
// InitChain implements the ABCI interface. It runs the initialization logic
// directly on the CommitMultiStore.
func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) {
initHeader := abci.Header{ChainID: req.ChainId, Time: req.Time}
initHeader := tmproto.Header{ChainID: req.ChainId, Time: req.Time}
// initialize the deliver state and check state with a correct header
app.setDeliverState(initHeader)
@ -55,8 +57,8 @@ func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitC
sort.Sort(abci.ValidatorUpdates(req.Validators))
sort.Sort(abci.ValidatorUpdates(res.Validators))
for i, val := range res.Validators {
if !val.Equal(req.Validators[i]) {
for i := range res.Validators {
if proto.Equal(&res.Validators[i], &req.Validators[i]) {
panic(fmt.Errorf("genesisValidators[%d] != req.Validators[%d] ", i, i))
}
}
@ -554,3 +556,19 @@ func splitPath(requestPath string) (path []string) {
return path
}
func (app *BaseApp) ListSnapshots(abci.RequestListSnapshots) abci.ResponseListSnapshots {
return abci.ResponseListSnapshots{}
}
func (app *BaseApp) OfferSnapshot(abci.RequestOfferSnapshot) abci.ResponseOfferSnapshot {
return abci.ResponseOfferSnapshot{}
}
func (app *BaseApp) LoadSnapshotChunk(abci.RequestLoadSnapshotChunk) abci.ResponseLoadSnapshotChunk {
return abci.ResponseLoadSnapshotChunk{}
}
func (app *BaseApp) ApplySnapshotChunk(abci.RequestApplySnapshotChunk) abci.ResponseApplySnapshotChunk {
return abci.ResponseApplySnapshotChunk{}
}

View File

@ -6,10 +6,10 @@ import (
"strings"
"github.com/gogo/protobuf/proto"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/store"
@ -257,7 +257,7 @@ func (app *BaseApp) init() error {
}
// needed for the export command which inits from store but never calls initchain
app.setCheckState(abci.Header{})
app.setCheckState(tmproto.Header{})
app.Seal()
return nil
@ -307,7 +307,7 @@ func (app *BaseApp) IsSealed() bool { return app.sealed }
// (i.e. a CacheMultiStore) and a new Context with the cache-wrapped multi-store,
// provided header, and minimum gas prices set. It is set on InitChain and reset
// on Commit.
func (app *BaseApp) setCheckState(header abci.Header) {
func (app *BaseApp) setCheckState(header tmproto.Header) {
ms := app.cms.CacheMultiStore()
app.checkState = &state{
ms: ms,
@ -319,7 +319,7 @@ func (app *BaseApp) setCheckState(header abci.Header) {
// (i.e. a CacheMultiStore) and a new Context with the cache-wrapped multi-store,
// and provided header. It is set on InitChain and BeginBlock and set to nil on
// Commit.
func (app *BaseApp) setDeliverState(header abci.Header) {
func (app *BaseApp) setDeliverState(header tmproto.Header) {
ms := app.cms.CacheMultiStore()
app.deliverState = &state{
ms: ms,
@ -344,14 +344,14 @@ func (app *BaseApp) GetConsensusParams(ctx sdk.Context) *abci.ConsensusParams {
}
if app.paramStore.Has(ctx, ParamStoreKeyEvidenceParams) {
var ep abci.EvidenceParams
var ep tmproto.EvidenceParams
app.paramStore.Get(ctx, ParamStoreKeyEvidenceParams, &ep)
cp.Evidence = &ep
}
if app.paramStore.Has(ctx, ParamStoreKeyValidatorParams) {
var vp abci.ValidatorParams
var vp tmproto.ValidatorParams
app.paramStore.Get(ctx, ParamStoreKeyValidatorParams, &vp)
cp.Validator = &vp

View File

@ -10,18 +10,18 @@ import (
"sync"
"testing"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
"github.com/gogo/protobuf/jsonpb"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/store/rootmulti"
store "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
@ -137,13 +137,13 @@ func TestLoadVersion(t *testing.T) {
require.Equal(t, emptyCommitID, lastID)
// execute a block, collect commit ID
header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
res := app.Commit()
commitID1 := sdk.CommitID{Version: 1, Hash: res.Data}
// execute a block, collect commit ID
header = abci.Header{Height: 2}
header = tmproto.Header{Height: 2}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
res = app.Commit()
commitID2 := sdk.CommitID{Version: 2, Hash: res.Data}
@ -242,7 +242,7 @@ func TestSetLoader(t *testing.T) {
require.Nil(t, err)
// "execute" one block
app.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{Height: 2}})
app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: 2}})
res := app.Commit()
require.NotNil(t, res.Data)
@ -287,7 +287,7 @@ func TestLoadVersionInvalid(t *testing.T) {
err = app.LoadVersion(-1)
require.Error(t, err)
header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
res := app.Commit()
commitID1 := sdk.CommitID{Version: 1, Hash: res.Data}
@ -337,7 +337,7 @@ func TestLoadVersionPruning(t *testing.T) {
// Commit seven blocks, of which 7 (latest) is kept in addition to 6, 5
// (keep recent) and 3 (keep every).
for i := int64(1); i <= 7; i++ {
app.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{Height: i}})
app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: i}})
res := app.Commit()
lastCommitID = sdk.CommitID{Version: i, Hash: res.Data}
}
@ -527,7 +527,7 @@ func TestInitChainer(t *testing.T) {
require.Equal(t, value, res.Value)
// commit and ensure we can still query
header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
app.Commit()
@ -783,7 +783,7 @@ func TestCheckTx(t *testing.T) {
require.Equal(t, nTxs, storedCounter)
// If a block is committed, CheckTx state should be reset.
header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
app.EndBlock(abci.RequestEndBlock{})
app.Commit()
@ -818,7 +818,7 @@ func TestDeliverTx(t *testing.T) {
txPerHeight := 5
for blockN := 0; blockN < nBlocks; blockN++ {
header := abci.Header{Height: int64(blockN) + 1}
header := tmproto.Header{Height: int64(blockN) + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
for i := 0; i < txPerHeight; i++ {
@ -872,7 +872,7 @@ func TestMultiMsgDeliverTx(t *testing.T) {
// run a multi-msg tx
// with all msgs the same route
header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
tx := newTxCounter(0, 0, 1, 2)
txBytes, err := codec.MarshalBinaryBare(tx)
@ -953,7 +953,7 @@ func TestSimulateTx(t *testing.T) {
nBlocks := 3
for blockN := 0; blockN < nBlocks; blockN++ {
count := int64(blockN + 1)
header := abci.Header{Height: count}
header := tmproto.Header{Height: count}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
tx := newTxCounter(count, count)
@ -1008,7 +1008,7 @@ func TestRunInvalidTransaction(t *testing.T) {
app := setupBaseApp(t, anteOpt, routerOpt)
header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
// transaction with no messages
@ -1136,7 +1136,7 @@ func TestTxGasLimits(t *testing.T) {
app := setupBaseApp(t, anteOpt, routerOpt)
header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
testCases := []struct {
@ -1250,7 +1250,7 @@ func TestMaxBlockGasLimits(t *testing.T) {
tx := tc.tx
// reset the block gas
header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
// execute the transaction multiple times
@ -1304,7 +1304,7 @@ func TestCustomRunTxPanicHandler(t *testing.T) {
app := setupBaseApp(t, anteOpt, routerOpt)
header := abci.Header{Height: 1}
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
app.AddRunTxRecoveryHandler(func(recoveryObj interface{}) error {
@ -1346,7 +1346,7 @@ func TestBaseAppAnteHandler(t *testing.T) {
app.InitChain(abci.RequestInitChain{})
registerTestCodec(cdc)
header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
// execute a tx that will fail ante handler execution
@ -1454,7 +1454,7 @@ func TestGasConsumptionBadTx(t *testing.T) {
app.InitChain(abci.RequestInitChain{})
header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
tx := newTxCounter(5, 0)
@ -1519,7 +1519,7 @@ func TestQuery(t *testing.T) {
require.Equal(t, 0, len(res.Value))
// query is still empty after a DeliverTx before we commit
header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
_, resTx, err = app.Deliver(tx)
@ -1545,7 +1545,7 @@ func TestGRPCQuery(t *testing.T) {
app := setupBaseApp(t, grpcQueryOpt)
app.InitChain(abci.RequestInitChain{})
header := abci.Header{Height: app.LastBlockHeight() + 1}
header := tmproto.Header{Height: app.LastBlockHeight() + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
app.Commit()
@ -1602,7 +1602,7 @@ func TestP2PQuery(t *testing.T) {
func TestGetMaximumBlockGas(t *testing.T) {
app := setupBaseApp(t)
app.InitChain(abci.RequestInitChain{})
ctx := app.NewContext(true, abci.Header{})
ctx := app.NewContext(true, tmproto.Header{})
app.StoreConsensusParams(ctx, &abci.ConsensusParams{Block: &abci.BlockParams{MaxGas: 0}})
require.Equal(t, uint64(0), app.getMaximumBlockGas(ctx))
@ -1660,7 +1660,7 @@ func TestWithRouter(t *testing.T) {
txPerHeight := 5
for blockN := 0; blockN < nBlocks; blockN++ {
header := abci.Header{Height: int64(blockN) + 1}
header := tmproto.Header{Height: int64(blockN) + 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
for i := 0; i < txPerHeight; i++ {

View File

@ -1,7 +1,7 @@
package baseapp
import (
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
@ -19,7 +19,7 @@ func (app *BaseApp) Deliver(tx sdk.Tx) (sdk.GasInfo, *sdk.Result, error) {
}
// Context with current {check, deliver}State of the app used by tests.
func (app *BaseApp) NewContext(isCheckTx bool, header abci.Header) sdk.Context {
func (app *BaseApp) NewContext(isCheckTx bool, header tmproto.Header) sdk.Context {
if isCheckTx {
return sdk.NewContext(app.checkState.ms, header, true, app.logger).
WithMinGasPrices(app.minGasPrices)
@ -28,6 +28,6 @@ func (app *BaseApp) NewContext(isCheckTx bool, header abci.Header) sdk.Context {
return sdk.NewContext(app.deliverState.ms, header, false, app.logger)
}
func (app *BaseApp) NewUncachedContext(isCheckTx bool, header abci.Header) sdk.Context {
func (app *BaseApp) NewUncachedContext(isCheckTx bool, header tmproto.Header) sdk.Context {
return sdk.NewContext(app.cms, header, isCheckTx, app.logger)
}

View File

@ -5,6 +5,7 @@ import (
"fmt"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
@ -49,7 +50,7 @@ func ValidateBlockParams(i interface{}) error {
// ValidateEvidenceParams defines a stateless validation on EvidenceParams. This
// function is called whenever the parameters are updated or stored.
func ValidateEvidenceParams(i interface{}) error {
v, ok := i.(abci.EvidenceParams)
v, ok := i.(tmproto.EvidenceParams)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
@ -62,13 +63,21 @@ func ValidateEvidenceParams(i interface{}) error {
return fmt.Errorf("evidence maximum age time duration must be positive: %v", v.MaxAgeDuration)
}
if v.MaxNum <= 0 {
return fmt.Errorf("evidence maximum number of evidence must be positive: %v", v.MaxAgeDuration)
}
if v.ProofTrialPeriod <= 0 {
return fmt.Errorf("proof of trial period must be greater than 0: %v", v.MaxAgeDuration)
}
return nil
}
// ValidateValidatorParams defines a stateless validation on ValidatorParams. This
// function is called whenever the parameters are updated or stored.
func ValidateValidatorParams(i interface{}) error {
v, ok := i.(abci.ValidatorParams)
v, ok := i.(tmproto.ValidatorParams)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}

View File

@ -5,6 +5,7 @@ import (
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
)
@ -33,11 +34,11 @@ func TestValidateEvidenceParams(t *testing.T) {
expectErr bool
}{
{nil, true},
{&abci.EvidenceParams{}, true},
{abci.EvidenceParams{}, true},
{abci.EvidenceParams{MaxAgeNumBlocks: -1, MaxAgeDuration: 18004000}, true},
{abci.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: -1}, true},
{abci.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000}, false},
{&tmproto.EvidenceParams{}, true},
{tmproto.EvidenceParams{}, true},
{tmproto.EvidenceParams{MaxAgeNumBlocks: -1, MaxAgeDuration: 18004000, MaxNum: 50, ProofTrialPeriod: 10_000}, true},
{tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxNum: 50, ProofTrialPeriod: -1}, true},
{tmproto.EvidenceParams{MaxAgeNumBlocks: 360000, MaxAgeDuration: 18004000, MaxNum: 50, ProofTrialPeriod: 50_0000}, false},
}
for _, tc := range testCases {
@ -51,10 +52,10 @@ func TestValidateValidatorParams(t *testing.T) {
expectErr bool
}{
{nil, true},
{&abci.ValidatorParams{}, true},
{abci.ValidatorParams{}, true},
{abci.ValidatorParams{PubKeyTypes: []string{}}, true},
{abci.ValidatorParams{PubKeyTypes: []string{"secp256k1"}}, false},
{&tmproto.ValidatorParams{}, true},
{tmproto.ValidatorParams{}, true},
{tmproto.ValidatorParams{PubKeyTypes: []string{}}, true},
{tmproto.ValidatorParams{PubKeyTypes: []string{"secp256k1"}}, false},
}
for _, tc := range testCases {

View File

@ -34,7 +34,7 @@ func Cmd() *cobra.Command {
// to decode the pubkey string from hex, base64, and finally bech32. If all
// encodings fail, an error is returned.
func getPubKeyFromString(pkstr string) (crypto.PubKey, error) {
var pubKey ed25519.PubKeyEd25519
pubKey := make(ed25519.PubKey, ed25519.PubKeySize)
bz, err := hex.DecodeString(pkstr)
if err == nil {
@ -85,7 +85,7 @@ $ %s debug pubkey cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg
return err
}
edPK, ok := pk.(ed25519.PubKeyEd25519)
edPK, ok := pk.(ed25519.PubKey)
if !ok {
return fmt.Errorf("invalid pubkey type; expected ED25519")
}

View File

@ -18,7 +18,7 @@ import (
)
func Test_multiSigKey_Properties(t *testing.T) {
tmpKey1 := secp256k1.GenPrivKeySecp256k1([]byte("mySecret"))
tmpKey1 := secp256k1.GenPrivKeyFromSecret([]byte("mySecret"))
pk := multisig.NewPubKeyMultisigThreshold(1, []crypto.PubKey{tmpKey1.PubKey()})
tmp := keyring.NewMultiInfo("myMultisig", pk)

View File

@ -45,7 +45,7 @@ func ValidatorCommand() *cobra.Command {
page, _ := cmd.Flags().GetInt(flags.FlagPage)
limit, _ := cmd.Flags().GetInt(flags.FlagLimit)
result, err := GetValidators(clientCtx, height, page, limit)
result, err := GetValidators(clientCtx, height, &page, &limit)
if err != nil {
return err
}
@ -112,7 +112,7 @@ func bech32ValidatorOutput(validator *tmtypes.Validator) (ValidatorOutput, error
}
// GetValidators from client
func GetValidators(clientCtx client.Context, height *int64, page, limit int) (ResultValidatorsOutput, error) {
func GetValidators(clientCtx client.Context, height *int64, page, limit *int) (ResultValidatorsOutput, error) {
// get the node
node, err := clientCtx.GetNode()
if err != nil {
@ -167,7 +167,7 @@ func ValidatorSetRequestHandlerFn(clientCtx client.Context) http.HandlerFunc {
return
}
output, err := GetValidators(clientCtx, &height, page, limit)
output, err := GetValidators(clientCtx, &height, &page, &limit)
if rest.CheckInternalServerError(w, err) {
return
}
@ -184,7 +184,7 @@ func LatestValidatorSetRequestHandlerFn(clientCtx client.Context) http.HandlerFu
return
}
output, err := GetValidators(clientCtx, nil, page, limit)
output, err := GetValidators(clientCtx, nil, &page, &limit)
if rest.CheckInternalServerError(w, err) {
return
}

View File

@ -32,7 +32,12 @@ func New() *LegacyAmino {
// RegisterEvidences registers Tendermint evidence types with the provided Amino
// codec.
func RegisterEvidences(cdc *LegacyAmino) {
tmtypes.RegisterEvidences(cdc.Amino)
cdc.Amino.RegisterInterface((*tmtypes.Evidence)(nil), nil)
cdc.Amino.RegisterConcrete(&tmtypes.DuplicateVoteEvidence{}, "tendermint/DuplicateVoteEvidence", nil)
cdc.Amino.RegisterConcrete(&tmtypes.ConflictingHeadersEvidence{}, "tendermint/ConflictingHeadersEvidence", nil)
cdc.Amino.RegisterConcrete(&tmtypes.LunaticValidatorEvidence{}, "tendermint/LunaticValidatorEvidence", nil)
cdc.Amino.RegisterConcrete(&tmtypes.PotentialAmnesiaEvidence{}, "tendermint/PotentialAmnesiaEvidence", nil)
cdc.Amino.RegisterConcrete(&tmtypes.AmnesiaEvidence{}, "tendermint/AmnesiaEvidence", nil)
}
// MarshalJSONIndent provides a utility for indented JSON encoding of an object

View File

@ -9,6 +9,7 @@ import (
"github.com/tendermint/tendermint/crypto/armor"
"github.com/tendermint/tendermint/crypto/xsalsa20symmetric"
"github.com/cosmos/cosmos-sdk/codec/legacy"
cryptoAmino "github.com/cosmos/cosmos-sdk/crypto/codec"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
@ -151,7 +152,7 @@ func encryptPrivKey(privKey crypto.PrivKey, passphrase string) (saltBytes []byte
}
key = crypto.Sha256(key) // get 32 bytes
privKeyBytes := privKey.Bytes()
privKeyBytes := legacy.Cdc.Amino.MustMarshalBinaryBare(privKey)
return saltBytes, xsalsa20symmetric.EncryptSymmetric(privKeyBytes, key)
}

View File

@ -14,6 +14,7 @@ import (
"github.com/tendermint/tendermint/crypto/secp256k1"
"github.com/tendermint/tendermint/crypto/xsalsa20symmetric"
"github.com/cosmos/cosmos-sdk/codec/legacy"
"github.com/cosmos/cosmos-sdk/crypto"
cryptoAmino "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/crypto/hd"
@ -50,7 +51,7 @@ func TestArmorUnarmorPrivKey(t *testing.T) {
key, err := bcrypt.GenerateFromPassword(saltBytes, []byte(passphrase), crypto.BcryptSecurityParameter)
require.NoError(t, err)
key = tmcrypto.Sha256(key) // get 32 bytes
privKeyBytes := privKey.Bytes()
privKeyBytes := legacy.Cdc.Amino.MustMarshalBinaryBare(privKey)
return saltBytes, xsalsa20symmetric.EncryptSymmetric(privKeyBytes, key)
}
saltBytes, encBytes := encryptPrivKeyFn(priv, "passphrase")
@ -74,7 +75,7 @@ func TestArmorUnarmorPubKey(t *testing.T) {
// Add keys and see they return in alphabetical order
info, _, err := cstore.NewMnemonic("Bob", keyring.English, types.FullFundraiserPath, hd.Secp256k1)
require.NoError(t, err)
armored := crypto.ArmorPubKeyBytes(info.GetPubKey().Bytes(), "")
armored := crypto.ArmorPubKeyBytes(legacy.Cdc.Amino.MustMarshalBinaryBare(info.GetPubKey()), "")
pubBytes, algo, err := crypto.UnarmorPubKeyBytes(armored)
require.NoError(t, err)
pub, err := cryptoAmino.PubKeyFromBytes(pubBytes)
@ -82,7 +83,7 @@ func TestArmorUnarmorPubKey(t *testing.T) {
require.Equal(t, string(hd.Secp256k1Type), algo)
require.True(t, pub.Equals(info.GetPubKey()))
armored = crypto.ArmorPubKeyBytes(info.GetPubKey().Bytes(), "unknown")
armored = crypto.ArmorPubKeyBytes(legacy.Cdc.Amino.MustMarshalBinaryBare(info.GetPubKey()), "unknown")
pubBytes, algo, err = crypto.UnarmorPubKeyBytes(armored)
require.NoError(t, err)
pub, err = cryptoAmino.PubKeyFromBytes(pubBytes)

View File

@ -21,22 +21,22 @@ func init() {
// codec.
func RegisterCrypto(cdc *codec.LegacyAmino) {
cdc.RegisterInterface((*crypto.PubKey)(nil), nil)
cdc.RegisterConcrete(ed25519.PubKeyEd25519{},
ed25519.PubKeyAminoName, nil)
cdc.RegisterConcrete(sr25519.PubKeySr25519{},
sr25519.PubKeyAminoName, nil)
cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{},
secp256k1.PubKeyAminoName, nil)
cdc.RegisterConcrete(ed25519.PubKey{},
ed25519.PubKeyName, nil)
cdc.RegisterConcrete(sr25519.PubKey{},
sr25519.PubKeyName, nil)
cdc.RegisterConcrete(secp256k1.PubKey{},
secp256k1.PubKeyName, nil)
cdc.RegisterConcrete(multisig.PubKeyMultisigThreshold{},
multisig.PubKeyAminoRoute, nil)
cdc.RegisterInterface((*crypto.PrivKey)(nil), nil)
cdc.RegisterConcrete(ed25519.PrivKeyEd25519{},
ed25519.PrivKeyAminoName, nil)
cdc.RegisterConcrete(sr25519.PrivKeySr25519{},
sr25519.PrivKeyAminoName, nil)
cdc.RegisterConcrete(secp256k1.PrivKeySecp256k1{},
secp256k1.PrivKeyAminoName, nil)
cdc.RegisterConcrete(ed25519.PrivKey{},
ed25519.PrivKeyName, nil)
cdc.RegisterConcrete(sr25519.PrivKey{},
sr25519.PrivKeyName, nil)
cdc.RegisterConcrete(secp256k1.PrivKey{},
secp256k1.PrivKeyName, nil)
}
// PrivKeyFromBytes unmarshals private key bytes and returns a PrivKey

View File

@ -54,15 +54,17 @@ func (s secp256k1Algo) Derive() DeriveFn {
return masterPriv[:], nil
}
derivedKey, err := DerivePrivateKeyForPath(masterPriv, ch, hdPath)
return derivedKey[:], err
return derivedKey, err
}
}
// Generate generates a secp256k1 private key from the given bytes.
func (s secp256k1Algo) Generate() GenerateFn {
return func(bz []byte) crypto.PrivKey {
var bzArr [32]byte
copy(bzArr[:], bz)
return secp256k1.PrivKeySecp256k1(bzArr)
var bzArr = make([]byte, secp256k1.PrivKeySize)
copy(bzArr, bz)
return secp256k1.PrivKey(bzArr)
}
}

View File

@ -65,7 +65,7 @@ func TestFundraiserCompatibility(t *testing.T) {
master, ch := hd.ComputeMastersFromSeed(seed)
priv, err := hd.DerivePrivateKeyForPath(master, ch, "44'/118'/0'/0/0")
require.NoError(t, err)
pub := secp256k1.PrivKeySecp256k1(priv).PubKey()
pub := secp256k1.PrivKey(priv).PubKey()
t.Log("\tNODEJS GOLANG\n")
t.Logf("SEED \t%X %X\n", seedB, seed)
@ -76,9 +76,9 @@ func TestFundraiserCompatibility(t *testing.T) {
require.Equal(t, seedB, seed)
require.Equal(t, master[:], masterB, fmt.Sprintf("Expected masters to match for %d", i))
require.Equal(t, priv[:], privB, "Expected priv keys to match")
var pubBFixed [33]byte
copy(pubBFixed[:], pubB)
require.Equal(t, pub, secp256k1.PubKeySecp256k1(pubBFixed), fmt.Sprintf("Expected pub keys to match for %d", i))
pubBFixed := make([]byte, secp256k1.PubKeySize)
copy(pubBFixed, pubB)
require.Equal(t, pub, secp256k1.PubKey(pubBFixed), fmt.Sprintf("Expected pub keys to match for %d", i))
addr := pub.Address()
t.Logf("ADDR \t%X %X\n", addrB, addr)

View File

@ -166,7 +166,7 @@ func ComputeMastersFromSeed(seed []byte) (secret [32]byte, chainCode [32]byte) {
// DerivePrivateKeyForPath derives the private key by following the BIP 32/44 path from privKeyBytes,
// using the given chainCode.
func DerivePrivateKeyForPath(privKeyBytes [32]byte, chainCode [32]byte, path string) ([32]byte, error) {
func DerivePrivateKeyForPath(privKeyBytes, chainCode [32]byte, path string) ([]byte, error) {
data := privKeyBytes
parts := strings.Split(path, "/")
@ -181,21 +181,21 @@ func DerivePrivateKeyForPath(privKeyBytes [32]byte, chainCode [32]byte, path str
idx, err := strconv.Atoi(part)
if err != nil {
return [32]byte{}, fmt.Errorf("invalid BIP 32 path: %s", err)
return []byte{}, fmt.Errorf("invalid BIP 32 path: %s", err)
}
if idx < 0 {
return [32]byte{}, errors.New("invalid BIP 32 path: index negative ot too large")
return []byte{}, errors.New("invalid BIP 32 path: index negative ot too large")
}
data, chainCode = derivePrivateKey(data, chainCode, uint32(idx), harden)
}
var derivedKey [32]byte
n := copy(derivedKey[:], data[:])
derivedKey := make([]byte, 32)
n := copy(derivedKey, data[:])
if n != 32 || len(data) != 32 {
return [32]byte{}, fmt.Errorf("expected a (secp256k1) key of length 32, got length: %v", len(data))
return []byte{}, fmt.Errorf("expected a (secp256k1) key of length 32, got length: %v", len(data))
}
return derivedKey, nil

View File

@ -16,10 +16,10 @@ import (
"github.com/pkg/errors"
"github.com/tendermint/crypto/bcrypt"
tmcrypto "github.com/tendermint/tendermint/crypto"
cryptoamino "github.com/tendermint/tendermint/crypto/encoding/amino"
"github.com/cosmos/cosmos-sdk/client/input"
"github.com/cosmos/cosmos-sdk/crypto"
cryptoamino "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/ledger"
sdk "github.com/cosmos/cosmos-sdk/types"
@ -197,7 +197,7 @@ func (ks keystore) ExportPubKeyArmor(uid string) (string, error) {
return "", fmt.Errorf("no key to export with name: %s", uid)
}
return crypto.ArmorPubKeyBytes(bz.GetPubKey().Bytes(), string(bz.GetAlgo())), nil
return crypto.ArmorPubKeyBytes(CryptoCdc.MustMarshalBinaryBare(bz.GetPubKey()), string(bz.GetAlgo())), nil
}
func (ks keystore) ExportPubKeyArmorByAddress(address sdk.Address) (string, error) {
@ -687,7 +687,7 @@ func (ks keystore) writeLocalKey(name string, priv tmcrypto.PrivKey, algo hd.Pub
// encrypt private key using keyring
pub := priv.PubKey()
info := newLocalInfo(name, pub, string(priv.Bytes()), algo)
info := newLocalInfo(name, pub, string(CryptoCdc.MustMarshalBinaryBare(priv)), algo)
if err := ks.writeInfo(info); err != nil {
return nil, err
}

View File

@ -77,8 +77,8 @@ func TestSignVerifyKeyRingWithLedger(t *testing.T) {
require.Equal(t, i1.GetPubKey(), pub1)
require.Equal(t, i1.GetPubKey(), pub2)
require.True(t, pub1.VerifyBytes(d1, s1))
require.True(t, i1.GetPubKey().VerifyBytes(d1, s1))
require.True(t, pub1.VerifySignature(d1, s1))
require.True(t, i1.GetPubKey().VerifySignature(d1, s1))
require.True(t, bytes.Equal(s1, s2))
localInfo, _, err := kb.NewMnemonic("test", English, types.FullFundraiserPath, hd.Secp256k1)

View File

@ -188,7 +188,7 @@ func TestSignVerifyKeyRing(t *testing.T) {
}
for i, tc := range cases {
valid := tc.key.VerifyBytes(tc.data, tc.sig)
valid := tc.key.VerifySignature(tc.data, tc.sig)
require.Equal(t, tc.valid, valid, "%d", i)
}
@ -549,7 +549,7 @@ func TestInMemorySignVerify(t *testing.T) {
}
for i, tc := range cases {
valid := tc.key.VerifyBytes(tc.data, tc.sig)
valid := tc.key.VerifySignature(tc.data, tc.sig)
require.Equal(t, tc.valid, valid, "%d", i)
}
@ -788,7 +788,7 @@ func ExampleNew() {
if pub.Equals(binfo.GetPubKey()) {
fmt.Println("signed by Bob")
}
if !pub.VerifyBytes(tx, sig) {
if !pub.VerifySignature(tx, sig) {
fmt.Println("invalid signature")
}
@ -1008,7 +1008,7 @@ func TestAltKeyring_Sign(t *testing.T) {
sign, key, err := keyring.Sign(uid, msg)
require.NoError(t, err)
require.True(t, key.VerifyBytes(msg, sign))
require.True(t, key.VerifySignature(msg, sign))
}
func TestAltKeyring_SignByAddress(t *testing.T) {
@ -1027,7 +1027,7 @@ func TestAltKeyring_SignByAddress(t *testing.T) {
sign, key, err := keyring.SignByAddress(mnemonic.GetAddress(), msg)
require.NoError(t, err)
require.True(t, key.VerifyBytes(msg, sign))
require.True(t, key.VerifySignature(msg, sign))
}
func TestAltKeyring_ImportExportPrivKey(t *testing.T) {

View File

@ -12,7 +12,7 @@ import (
)
func Test_writeReadLedgerInfo(t *testing.T) {
var tmpKey secp256k1.PubKeySecp256k1
tmpKey := make(secp256k1.PubKey, secp256k1.PubKeySize)
bz, _ := hex.DecodeString("035AD6810A47F073553FF30D2FCC7E0D3B1C0B74B61A1AAA2582344037151E143A")
copy(tmpKey[:], bz)

View File

@ -7,31 +7,12 @@ import (
"github.com/stretchr/testify/require"
tcrypto "github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/crypto/secp256k1"
)
type byter interface {
Bytes() []byte
}
func checkAminoBinary(t *testing.T, src, dst interface{}, size int) {
// Marshal to binary bytes.
bz, err := cdc.MarshalBinaryBare(src)
require.Nil(t, err, "%+v", err)
if byterSrc, ok := src.(byter); ok {
// Make sure this is compatible with current (Bytes()) encoding.
require.Equal(t, byterSrc.Bytes(), bz, "Amino binary vs Bytes() mismatch")
}
// Make sure we have the expected length.
if size != -1 {
require.Equal(t, size, len(bz), "Amino binary size mismatch")
}
// Unmarshal.
err = cdc.UnmarshalBinaryBare(bz, dst)
require.Nil(t, err, "%+v", err)
}
func checkAminoJSON(t *testing.T, src interface{}, dst interface{}, isNil bool) {
// Marshal to JSON bytes.
js, err := cdc.MarshalJSON(src)
@ -50,59 +31,16 @@ func checkAminoJSON(t *testing.T, src interface{}, dst interface{}, isNil bool)
// nolint: govet
func ExamplePrintRegisteredTypes() {
cdc.PrintTypes(os.Stdout)
// Output: | Type | Name | Prefix | Length | Notes |
//| ---- | ---- | ------ | ----- | ------ |
//| PrivKeyLedgerSecp256k1 | tendermint/PrivKeyLedgerSecp256k1 | 0x10CAB393 | variable | |
//| PubKeyEd25519 | tendermint/PubKeyEd25519 | 0x1624DE64 | 0x20 | |
//| PubKeySr25519 | tendermint/PubKeySr25519 | 0x0DFB1005 | 0x20 | |
//| PubKeySecp256k1 | tendermint/PubKeySecp256k1 | 0xEB5AE987 | 0x21 | |
//| PubKeyMultisigThreshold | tendermint/PubKeyMultisigThreshold | 0x22C1F7E2 | variable | |
//| PrivKeyEd25519 | tendermint/PrivKeyEd25519 | 0xA3288910 | 0x40 | |
//| PrivKeySr25519 | tendermint/PrivKeySr25519 | 0x2F82D78B | 0x20 | |
//| PrivKeySecp256k1 | tendermint/PrivKeySecp256k1 | 0xE1B0F79B | 0x20 | |
}
func TestKeyEncodings(t *testing.T) {
cases := []struct {
privKey tcrypto.PrivKey
privSize, pubSize int // binary sizes with the amino overhead
}{
{
privKey: ed25519.GenPrivKey(),
privSize: 69,
pubSize: 37,
},
{
privKey: secp256k1.GenPrivKey(),
privSize: 37,
pubSize: 38,
},
}
for _, tc := range cases {
// Check (de/en)codings of PrivKeys.
var priv2, priv3 tcrypto.PrivKey
checkAminoBinary(t, tc.privKey, &priv2, tc.privSize)
require.EqualValues(t, tc.privKey, priv2)
checkAminoJSON(t, tc.privKey, &priv3, false) // TODO also check Prefix bytes.
require.EqualValues(t, tc.privKey, priv3)
// Check (de/en)codings of Signatures.
var sig1, sig2 []byte
sig1, err := tc.privKey.Sign([]byte("something"))
require.NoError(t, err)
checkAminoBinary(t, sig1, &sig2, -1) // Signature size changes for Secp anyways.
require.EqualValues(t, sig1, sig2)
// Check (de/en)codings of PubKeys.
pubKey := tc.privKey.PubKey()
var pub2, pub3 tcrypto.PubKey
checkAminoBinary(t, pubKey, &pub2, tc.pubSize)
require.EqualValues(t, pubKey, pub2)
checkAminoJSON(t, pubKey, &pub3, false) // TODO also check Prefix bytes.
require.EqualValues(t, pubKey, pub3)
}
// | Type | Name | Prefix | Length | Notes |
// | ---- | ---- | ------ | ----- | ------ |
// | PrivKeyLedgerSecp256k1 | tendermint/PrivKeyLedgerSecp256k1 | 0x10CAB393 | variable | |
// | PubKey | tendermint/PubKeyEd25519 | 0x1624DE64 | variable | |
// | PubKey | tendermint/PubKeySr25519 | 0x0DFB1005 | variable | |
// | PubKey | tendermint/PubKeySecp256k1 | 0xEB5AE987 | variable | |
// | PubKeyMultisigThreshold | tendermint/PubKeyMultisigThreshold | 0x22C1F7E2 | variable | |
// | PrivKey | tendermint/PrivKeyEd25519 | 0xA3288910 | variable | |
// | PrivKey | tendermint/PrivKeySr25519 | 0x2F82D78B | variable | |
// | PrivKey | tendermint/PrivKeySecp256k1 | 0xE1B0F79B | variable | |
}
func TestNilEncodings(t *testing.T) {

View File

@ -77,8 +77,8 @@ func (mock LedgerSECP256K1Mock) GetAddressPubKeySECP256K1(derivationPath []uint3
return nil, "", fmt.Errorf("error parsing public key: %v", err)
}
var compressedPublicKey tmsecp256k1.PubKeySecp256k1
copy(compressedPublicKey[:], cmp.SerializeCompressed())
compressedPublicKey := make(tmsecp256k1.PubKey, tmsecp256k1.PubKeySize)
copy(compressedPublicKey, cmp.SerializeCompressed())
// Generate the bech32 addr using existing tmcrypto/etc.
addr := sdk.AccAddress(compressedPublicKey.Address()).String()

View File

@ -115,7 +115,7 @@ func ShowAddress(path hd.BIP44Params, expectedPubKey tmcrypto.PubKey,
return err
}
if pubKey != expectedPubKey {
if !pubKey.Equals(expectedPubKey) {
return fmt.Errorf("the key's pubkey does not match with the one retrieved from Ledger. Check that the HD path and device are the correct ones")
}
@ -124,7 +124,7 @@ func ShowAddress(path hd.BIP44Params, expectedPubKey tmcrypto.PubKey,
return err
}
if pubKey2 != expectedPubKey {
if !pubKey2.Equals(expectedPubKey) {
return fmt.Errorf("the key's pubkey does not match with the one retrieved from Ledger. Check that the HD path and device are the correct ones")
}
@ -161,6 +161,8 @@ func (pkl PrivKeyLedgerSecp256k1) Equals(other tmcrypto.PrivKey) bool {
return false
}
func (pkl PrivKeyLedgerSecp256k1) Type() string { return "PrivKeyLedgerSecp256k1" }
// warnIfErrors wraps a function and writes a warning to stderr. This is required
// to avoid ignoring errors when defer is used. Using defer may result in linter warnings.
func warnIfErrors(f func() error) {
@ -244,8 +246,8 @@ func getPubKeyUnsafe(device SECP256K1, path hd.BIP44Params) (tmcrypto.PubKey, er
return nil, fmt.Errorf("error parsing public key: %v", err)
}
var compressedPublicKey tmsecp256k1.PubKeySecp256k1
copy(compressedPublicKey[:], cmp.SerializeCompressed())
compressedPublicKey := make(tmsecp256k1.PubKey, tmsecp256k1.PubKeySize)
copy(compressedPublicKey, cmp.SerializeCompressed())
return compressedPublicKey, nil
}
@ -268,8 +270,8 @@ func getPubKeyAddrSafe(device SECP256K1, path hd.BIP44Params, hrp string) (tmcry
return nil, "", fmt.Errorf("error parsing public key: %v", err)
}
var compressedPublicKey tmsecp256k1.PubKeySecp256k1
copy(compressedPublicKey[:], cmp.SerializeCompressed())
compressedPublicKey := make(tmsecp256k1.PubKey, tmsecp256k1.PubKeySize)
copy(compressedPublicKey, cmp.SerializeCompressed())
return compressedPublicKey, addr, nil
}

View File

@ -29,7 +29,7 @@ func TestPublicKeyUnsafe(t *testing.T) {
require.NotNil(t, priv)
require.Equal(t, "eb5ae98721034fef9cd7c4c63588d3b03feb5281b9d232cba34d6f3d71aee59211ffbfe1fe87",
fmt.Sprintf("%x", priv.PubKey().Bytes()),
fmt.Sprintf("%x", cdc.Amino.MustMarshalBinaryBare(priv.PubKey())),
"Is your device using test mnemonic: %s ?", testutil.TestMnemonic)
pubKeyAddr, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, priv.PubKey())
@ -107,7 +107,7 @@ func TestPublicKeySafe(t *testing.T) {
require.Nil(t, ShowAddress(path, priv.PubKey(), sdk.GetConfig().GetBech32AccountAddrPrefix()))
require.Equal(t, "eb5ae98721034fef9cd7c4c63588d3b03feb5281b9d232cba34d6f3d71aee59211ffbfe1fe87",
fmt.Sprintf("%x", priv.PubKey().Bytes()),
fmt.Sprintf("%x", cdc.Amino.MustMarshalBinaryBare(priv.PubKey())),
"Is your device using test mnemonic: %s ?", testutil.TestMnemonic)
pubKeyAddr, err := sdk.Bech32ifyPubKey(sdk.Bech32PubKeyTypeAccPub, priv.PubKey())
@ -219,7 +219,7 @@ func TestSignaturesHD(t *testing.T) {
sig, err := priv.Sign(msg)
require.Nil(t, err)
valid := pub.VerifyBytes(msg, sig)
valid := pub.VerifySignature(msg, sig)
require.True(t, valid, "Is your device using test mnemonic: %s ?", testutil.TestMnemonic)
}
}
@ -234,11 +234,11 @@ func TestRealDeviceSecp256k1(t *testing.T) {
sig, err := priv.Sign(msg)
require.Nil(t, err)
valid := pub.VerifyBytes(msg, sig)
valid := pub.VerifySignature(msg, sig)
require.True(t, valid)
// now, let's serialize the public key and make sure it still works
bs := priv.PubKey().Bytes()
bs := cdc.Amino.MustMarshalBinaryBare(priv.PubKey())
pub2, err := cryptoAmino.PubKeyFromBytes(bs)
require.Nil(t, err, "%+v", err)
@ -248,11 +248,11 @@ func TestRealDeviceSecp256k1(t *testing.T) {
// signing with the loaded key should match the original pubkey
sig, err = priv.Sign(msg)
require.Nil(t, err)
valid = pub.VerifyBytes(msg, sig)
valid = pub.VerifySignature(msg, sig)
require.True(t, valid)
// make sure pubkeys serialize properly as well
bs = pub.Bytes()
bs = cdc.Amino.MustMarshalBinaryBare(pub)
bpub, err := cryptoAmino.PubKeyFromBytes(bs)
require.NoError(t, err)
require.Equal(t, pub, bpub)

View File

@ -21,10 +21,10 @@ func init() {
Cdc.RegisterInterface((*crypto.PubKey)(nil), nil)
Cdc.RegisterConcrete(PubKeyMultisigThreshold{},
PubKeyAminoRoute, nil)
Cdc.RegisterConcrete(ed25519.PubKeyEd25519{},
ed25519.PubKeyAminoName, nil)
Cdc.RegisterConcrete(sr25519.PubKeySr25519{},
sr25519.PubKeyAminoName, nil)
Cdc.RegisterConcrete(secp256k1.PubKeySecp256k1{},
secp256k1.PubKeyAminoName, nil)
Cdc.RegisterConcrete(ed25519.PubKey{},
ed25519.PubKeyName, nil)
Cdc.RegisterConcrete(sr25519.PubKey{},
sr25519.PubKeyName, nil)
Cdc.RegisterConcrete(secp256k1.PubKey{},
secp256k1.PubKeyName, nil)
}

View File

@ -42,7 +42,7 @@ func NewPubKeyMultisigThreshold(k int, pubkeys []crypto.PubKey) PubKey {
//
// NOTE: VerifyMultisignature should preferred to VerifyBytes which only works
// with amino multisignatures.
func (pk PubKeyMultisigThreshold) VerifyBytes(msg []byte, marshalledSig []byte) bool {
func (pk PubKeyMultisigThreshold) VerifySignature(msg []byte, marshalledSig []byte) bool {
var sig AminoMultisignature
err := Cdc.UnmarshalBinaryBare(marshalledSig, &sig)
if err != nil {
@ -65,7 +65,7 @@ func (pk PubKeyMultisigThreshold) VerifyBytes(msg []byte, marshalledSig []byte)
sigIndex := 0
for i := 0; i < size; i++ {
if sig.BitArray.GetIndex(i) {
if !pk.PubKeys[i].VerifyBytes(msg, sig.Sigs[sigIndex]) {
if !pk.PubKeys[i].VerifySignature(msg, sig.Sigs[sigIndex]) {
return false
}
sigIndex++
@ -102,7 +102,7 @@ func (pk PubKeyMultisigThreshold) VerifyMultisignature(getSignBytes GetSignBytes
if err != nil {
return err
}
if !pk.PubKeys[i].VerifyBytes(msg, si.Signature) {
if !pk.PubKeys[i].VerifySignature(msg, si.Signature) {
return err
}
case *signing.MultiSignatureData:
@ -159,3 +159,5 @@ func (pk PubKeyMultisigThreshold) Equals(other crypto.PubKey) bool {
func (pk PubKeyMultisigThreshold) GetThreshold() uint {
return pk.K
}
func (pk PubKeyMultisigThreshold) Type() string { return "PubKeyMultisigThreshold" }

View File

@ -19,7 +19,7 @@ The SDK `Context` is a custom data structure that contains Go's stdlib [`context
type Context struct {
ctx context.Context
ms MultiStore
header abci.Header
header tmproto.Header
chainID string
txBytes []byte
logger log.Logger

13
go.mod
View File

@ -7,13 +7,13 @@ require (
github.com/armon/go-metrics v0.3.4
github.com/bgentry/speakeasy v0.1.0
github.com/btcsuite/btcd v0.20.1-beta
github.com/confio/ics23-iavl v0.6.0
github.com/confio/ics23/go v0.0.0-20200804135649-a9fbc744ca3d
github.com/confio/ics23/go v0.0.0-20200804135932-65ad804e8539
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d
github.com/cosmos/iavl v0.15.0-rc1
github.com/cosmos/ledger-cosmos-go v0.11.1
github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25
github.com/gogo/protobuf v1.3.1
github.com/golang/mock v1.4.4
github.com/golang/mock v1.4.3
github.com/golang/protobuf v1.4.2
github.com/gorilla/handlers v1.4.2
github.com/gorilla/mux v1.7.4
@ -30,16 +30,15 @@ require (
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cast v1.3.1
github.com/spf13/cobra v1.0.0
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect; indirects
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.6.1
github.com/tendermint/btcd v0.1.1
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15
github.com/tendermint/go-amino v0.15.1
github.com/tendermint/iavl v0.14.0
github.com/tendermint/tendermint v0.33.8
github.com/tendermint/tm-db v0.5.1
github.com/tendermint/tendermint v0.34.0-rc3
github.com/tendermint/tm-db v0.6.1
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013
google.golang.org/grpc v1.31.0
google.golang.org/protobuf v1.25.0

118
go.sum
View File

@ -16,12 +16,13 @@ github.com/99designs/keyring v1.1.5/go.mod h1:7hsVvt2qXgtadGevGJ4ujg+u8m6SpJ5TpH
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f h1:4O1om+UVU+Hfcihr1timk8YNXHxzZWgCo7ofnrZRApw=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200102211924-4bcbc698314f/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM=
github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
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=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
@ -85,14 +86,13 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/confio/ics23-iavl v0.6.0 h1:vVRCuVaP38FCw1kTeEdFuGuiY+2vAGTBQoH7Zxkq/ws=
github.com/confio/ics23-iavl v0.6.0/go.mod h1:mmXAxD1vWoO0VP8YHu6mM1QHGv71NQqa1iSVm4HeKcY=
github.com/confio/ics23/go v0.0.0-20200323120010-7d9a00f0a2fa/go.mod h1:W1I3XC8d9N8OTu/ct5VJ84ylcOunZwMXsWkd27nvVts=
github.com/confio/ics23/go v0.0.0-20200804135649-a9fbc744ca3d h1:VbtIIE3NDC6/aIRUR9FdmRE4l0B5IDgYHiFi8pw0QOc=
github.com/confio/ics23/go v0.0.0-20200804135649-a9fbc744ca3d/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg=
github.com/confio/ics23/go v0.0.0-20200610201322-18c7bd6b2dd3/go.mod h1:W1I3XC8d9N8OTu/ct5VJ84ylcOunZwMXsWkd27nvVts=
github.com/confio/ics23/go v0.0.0-20200804135932-65ad804e8539 h1:4AuX7KNUVdNa/am9yCQRqWMfdDJ86EtFJk/xwf6ntgc=
github.com/confio/ics23/go v0.0.0-20200804135932-65ad804e8539/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
@ -101,10 +101,13 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d h1:49RLWk1j44Xu4fjHb6JFYmeUnDORVwHNkDxaQ0ctCVU=
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/iavl v0.15.0-rc1 h1:cYMPAxu5xpGPhGYvGlpeCmgmgH7oY+kebZm2oHfh2nE=
github.com/cosmos/iavl v0.15.0-rc1/go.mod h1:qFTkoCC00sBKWCG3Ws8GAUaYR1jIOtwNZ9p8uFOu4Jo=
github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4=
github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY=
github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI=
github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
@ -114,9 +117,17 @@ github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgraph-io/badger/v2 v2.0.3 h1:inzdf6VF/NZ+tJ8RwwYMjJMvsOALTHYdozn0qSl6XJI=
github.com/dgraph-io/badger/v2 v2.0.3/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM=
github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3 h1:MQLRM35Pp0yAyBYksjbj1nZI/w6eyRY/mWoM1sFf4kU=
github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dvsekhvalnov/jose2go v0.0.0-20180829124132-7f401d37b68a h1:mq+R6XEM6lJX5VlLyZIrUSP8tSuJp82xTK89hvBwJbU=
github.com/dvsekhvalnov/jose2go v0.0.0-20180829124132-7f401d37b68a/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
@ -130,8 +141,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/etcd-io/bbolt v1.3.3 h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM=
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ=
github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64=
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A=
@ -168,20 +177,18 @@ github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4er
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc=
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw=
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
@ -195,7 +202,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
@ -220,8 +226,6 @@ github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=
github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
@ -233,7 +237,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.14.6 h1:8ERzHx8aj1Sc47mu9n/AksaKCSWrMc
github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f h1:8N8XWLZelZNibkhM1FuF+3Ad3YIbgirjdMiVA0eUkaM=
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is=
github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=
@ -301,7 +304,6 @@ github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+
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/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
@ -352,6 +354,8 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE
github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
@ -379,7 +383,6 @@ github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT9
github.com/otiai10/mint v1.3.1 h1:BCmzIS3n71sGfHB5NMNDB3lHYPz8fWSkCAErHed//qc=
github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=
github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs=
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
@ -388,6 +391,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9
github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw=
github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs=
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o=
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@ -404,10 +409,6 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.5.0 h1:Ctq0iGpCmr3jeP77kbF2UxgvRwzWWz+4Bh9/vJTyg1A=
github.com/prometheus/client_golang v1.5.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.5.1 h1:bdHYieyGlH+6OLEk2YQha8THib30KP0/yD0YH9m6xcA=
github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
@ -422,7 +423,6 @@ github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
@ -432,14 +432,12 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ=
github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a h1:9ZKAASQSHhDYGoxY8uLVpewe1GDZ2vu2Tr/vTdVAkFQ=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ=
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
@ -452,9 +450,12 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y=
github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
@ -468,16 +469,16 @@ github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPH
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.6 h1:breEStsVwemnKh2/s6gMvSdMEkwW0sK8vGStnlVBMCs=
github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
@ -487,9 +488,9 @@ github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
github.com/spf13/viper v1.6.3/go.mod h1:jUMtyi0/lB5yZH/FjyGAoH7IMNrIhlBf6pXZmbMDvzw=
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk=
github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
@ -502,8 +503,6 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
@ -516,26 +515,20 @@ github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s
github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U=
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI=
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk=
github.com/tendermint/go-amino v0.14.1/go.mod h1:i/UKE5Uocn+argJJBb12qTZsCDBcAYMbR92AaJVmKso=
github.com/tendermint/go-amino v0.15.1 h1:D2uk35eT4iTsvJd9jWIetzthE5C0/k2QmMFkCN+4JgQ=
github.com/tendermint/go-amino v0.15.1/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
github.com/tendermint/iavl v0.13.2/go.mod h1:vE1u0XAGXYjHykd4BLp8p/yivrw2PF1TuoljBcsQoGA=
github.com/tendermint/iavl v0.14.0 h1:Jkff+IFrXxRWtH9Jn/ga/2cxNnzMTv58xEKgCJsKUBg=
github.com/tendermint/iavl v0.14.0/go.mod h1:QmfViflFiXzxKLQE4tAUuWQHq+RSuQFxablW5oJZ6sE=
github.com/tendermint/tendermint v0.33.2 h1:NzvRMTuXJxqSsFed2J7uHmMU5N1CVzSpfi3nCc882KY=
github.com/tendermint/tendermint v0.33.2/go.mod h1:25DqB7YvV1tN3tHsjWoc2vFtlwICfrub9XO6UBO+4xk=
github.com/tendermint/tendermint v0.33.5 h1:jYgRd9ImkzA9iOyhpmgreYsqSB6tpDa6/rXYPb8HKE8=
github.com/tendermint/tendermint v0.33.5/go.mod h1:0yUs9eIuuDq07nQql9BmI30FtYGcEC60Tu5JzB5IezM=
github.com/tendermint/tendermint v0.33.8 h1:Xxu4QhpqcomSE0iQDw1MqLgfsa8fqtPtWFJK6zZOVso=
github.com/tendermint/tendermint v0.33.8/go.mod h1:0yUs9eIuuDq07nQql9BmI30FtYGcEC60Tu5JzB5IezM=
github.com/tendermint/tm-db v0.4.1/go.mod h1:JsJ6qzYkCGiGwm5GHl/H5GLI9XLb6qZX7PRe425dHAY=
github.com/tendermint/tm-db v0.5.0/go.mod h1:lSq7q5WRR/njf1LnhiZ/lIJHk2S8Y1Zyq5oP/3o9C2U=
github.com/tendermint/tm-db v0.5.1 h1:H9HDq8UEA7Eeg13kdYckkgwwkQLBnJGgX4PgLJRhieY=
github.com/tendermint/tm-db v0.5.1/go.mod h1:g92zWjHpCYlEvQXvy9M168Su8V1IBEeawpXVVBaK4f4=
github.com/tendermint/tendermint v0.34.0-rc2/go.mod h1:+AG8ftE2PD4uMVzGSB7c0oH9xbTlIyMeoX0M9r89x3Y=
github.com/tendermint/tendermint v0.34.0-rc3 h1:d7Fsd5rdbxq4GmJ0kRfx7l7LesQM7e70f0ytWLTQ/Go=
github.com/tendermint/tendermint v0.34.0-rc3/go.mod h1:BoHcEpjfpBHc1Be7RQz3AHaXFNObcDG7SNHCev6Or4g=
github.com/tendermint/tm-db v0.6.0 h1:Us30k7H1UDcdqoSPhmP8ztAW/SWV6c6OfsfeCiboTC4=
github.com/tendermint/tm-db v0.6.0/go.mod h1:xj3AWJ08kBDlCHKijnhJ7mTcDMOikT1r8Poxy2pJn7Q=
github.com/tendermint/tm-db v0.6.1 h1:w3X87itMPXopcRPlFiqspEKhw4FXihPk2rnFFkP0zGk=
github.com/tendermint/tm-db v0.6.1/go.mod h1:m3x9kRP4UFd7JODJL0yBAZqE7wTw+S37uAE90cTx7OA=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
@ -543,8 +536,9 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:
github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8=
github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=
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.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
@ -562,18 +556,15 @@ go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413 h1:ULYEB3JvPRE/IfO+9uO7vKV/xzVTO7XPAwm8xbf4w2g=
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-20200406173513-056763e48d71 h1:DOmugCavvUtnUD114C1Wh+UgTgQZ4pMLzXxi1pSt+/Y=
golang.org/x/crypto v0.0.0-20200406173513-056763e48d71/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79 h1:IaQbIIB2X/Mp/DKctl6ROxz1KyMlKp4uyvL6+kQ7C88=
golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/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 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg=
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@ -614,7 +605,6 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
@ -630,7 +620,6 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -640,6 +629,7 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -649,20 +639,21 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 h1:ywK/j/KkyTHcdyYSZNXGjMwgmDSfjglYZ3vStQ/gSCU=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
@ -693,7 +684,6 @@ golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200110213125-a7a6caa82ab2 h1:V9r/14uGBqLgNlHRYWdVqjMdWkcOHnE2KG8DwVqQSEc=
golang.org/x/tools v0.0.0-20200110213125-a7a6caa82ab2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@ -721,7 +711,6 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73 h1:+yTMTeazSO5iBqU9NR53hgriivQQbYa5Uuaj8r3qKII=
google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
@ -738,31 +727,28 @@ google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4=
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/grpc v1.28.1 h1:C1QC6KzgSiLyBabDi87BbjaGreoRgGUF5nOyvfrAZ1k=
google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/grpc v1.31.0 h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI=
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
@ -791,5 +777,7 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
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=
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=

View File

@ -1,14 +1,13 @@
syntax = "proto3";
package cosmos.base.abci.v1beta1;
import "tendermint/abci/types/types.proto";
import "gogoproto/gogo.proto";
import "tendermint/abci/types.proto";
import "google/protobuf/any.proto";
option go_package = "github.com/cosmos/cosmos-sdk/types";
option (gogoproto.goproto_stringer_all) = false;
// TxResponse defines a structure containing relevant tx data and metadata. The
// tags are stringified and the log is JSON decoded.
message TxResponse {
@ -35,7 +34,7 @@ message TxResponse {
int64 gas_used = 10;
// The request transaction bytes.
google.protobuf.Any tx = 11;
// Time of the previous block. For heights > 1, it's the weighted median of the
// 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.
string timestamp = 12;
}
@ -45,7 +44,7 @@ message ABCIMessageLog {
option (gogoproto.stringer) = true;
uint32 msg_index = 1;
string log = 2;
string log = 2;
// Events contains a slice of Event objects that were emitted during some
// execution.
@ -57,14 +56,14 @@ message ABCIMessageLog {
message StringEvent {
option (gogoproto.stringer) = true;
string type = 1;
string type = 1;
repeated Attribute attributes = 2 [(gogoproto.nullable) = false];
}
// Attribute defines an attribute wrapper where the key and value are
// strings instead of raw bytes.
message Attribute {
string key = 1;
string key = 1;
string value = 2;
}
@ -90,7 +89,7 @@ message Result {
// Events contains a slice of Event objects that were emitted during message or
// handler execution.
repeated tendermint.abci.types.Event events = 3 [(gogoproto.nullable) = false];
repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false];
}
// SimulationResponse defines the response generated when a transaction is
@ -114,4 +113,4 @@ message TxMsgData {
option (gogoproto.stringer) = true;
repeated MsgData data = 1;
}
}

View File

@ -2,7 +2,7 @@ syntax = "proto3";
package cosmos.staking.v1beta1;
import "gogoproto/gogo.proto";
import "tendermint/abci/types/types.proto";
import "tendermint/types/types.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "cosmos/base/v1beta1/coin.proto";
@ -12,10 +12,8 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types";
// HistoricalInfo contains the historical information that gets stored at
// each height.
message HistoricalInfo {
option (gogoproto.equal) = true;
tendermint.abci.types.Header header = 1 [(gogoproto.nullable) = false];
repeated Validator valset = 2 [(gogoproto.nullable) = false];
tendermint.types.Header header = 1 [(gogoproto.nullable) = false];
repeated Validator valset = 2 [(gogoproto.nullable) = false];
}
// CommissionRates defines the initial commission rates to be used for creating
@ -45,8 +43,8 @@ message Commission {
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp update_time = 2 [
CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp update_time = 2 [
(gogoproto.nullable) = false,
(gogoproto.stdtime) = true,
(gogoproto.moretags) = "yaml:\"update_time\""
@ -83,8 +81,8 @@ message Validator {
];
string consensus_pubkey = 2 [(gogoproto.moretags) = "yaml:\"consensus_pubkey\""];
bool jailed = 3;
int32 status = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.BondStatus"];
string tokens = 5 [
int32 status = 4 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.BondStatus"];
string tokens = 5 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
@ -93,9 +91,9 @@ message Validator {
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
];
Description description = 7 [(gogoproto.nullable) = false];
int64 unbonding_height = 8 [(gogoproto.moretags) = "yaml:\"unbonding_height\""];
google.protobuf.Timestamp unbonding_time = 9 [
Description description = 7 [(gogoproto.nullable) = false];
int64 unbonding_height = 8 [(gogoproto.moretags) = "yaml:\"unbonding_height\""];
google.protobuf.Timestamp unbonding_time = 9 [
(gogoproto.nullable) = false,
(gogoproto.stdtime) = true,
(gogoproto.moretags) = "yaml:\"unbonding_time\""
@ -111,7 +109,7 @@ message Validator {
// ValAddresses defines a repeated set of validator addresses.
message ValAddresses {
option (gogoproto.goproto_stringer) = false;
option (gogoproto.stringer) = true;
option (gogoproto.stringer) = true;
repeated bytes addresses = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
}
@ -303,10 +301,10 @@ message RedelegationEntryResponse {
option (gogoproto.equal) = true;
RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false];
string balance = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
string balance = 4 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}
// RedelegationResponse is equivalent to a Redelegation except that its entries
@ -315,20 +313,19 @@ message RedelegationEntryResponse {
message RedelegationResponse {
option (gogoproto.equal) = true;
Redelegation redelegation = 1 [(gogoproto.nullable) = false];
repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false];
Redelegation redelegation = 1 [(gogoproto.nullable) = false];
repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false];
}
// Pool - tracking bonded and not-bonded token supply of the bond denomination
message Pool {
option (gogoproto.description) = true;
option (gogoproto.equal) = true;
string not_bonded_tokens = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
option (gogoproto.equal) = true;
string not_bonded_tokens = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.jsontag) = "not_bonded_tokens",
(gogoproto.nullable) = false];
string bonded_tokens = 2 [(gogoproto.jsontag) = "bonded_tokens",
string bonded_tokens = 2 [(gogoproto.jsontag) = "bonded_tokens",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"bonded_tokens\""];
}

View File

@ -4,7 +4,7 @@ package ibc.commitment;
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/23-commitment/types";
import "gogoproto/gogo.proto";
import "tendermint/crypto/merkle/merkle.proto";
import "tendermint/crypto/proof.proto";
// MerkleRoot defines a merkle root hash.
// In the Cosmos SDK, the AppHash of a block header becomes the root.
@ -36,9 +36,7 @@ message MerklePath {
// verifiable in conjunction with a known commitment root. Proofs should be
// succinct.
message MerkleProof {
option (gogoproto.equal) = true;
tendermint.crypto.merkle.Proof proof = 1;
tendermint.crypto.ProofOps proof = 1;
}
// KeyPath defines a slice of keys

View File

@ -9,6 +9,7 @@ import (
"os"
"github.com/spf13/cobra"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
"github.com/cosmos/cosmos-sdk/client/flags"
@ -75,17 +76,19 @@ func ExportCmd(appExporter types.AppExporter, defaultNodeHome string) *cobra.Com
doc.AppState = appState
doc.Validators = validators
doc.ConsensusParams = &tmtypes.ConsensusParams{
Block: tmtypes.BlockParams{
doc.ConsensusParams = &tmproto.ConsensusParams{
Block: tmproto.BlockParams{
MaxBytes: cp.Block.MaxBytes,
MaxGas: cp.Block.MaxGas,
TimeIotaMs: doc.ConsensusParams.Block.TimeIotaMs,
},
Evidence: tmtypes.EvidenceParams{
MaxAgeNumBlocks: cp.Evidence.MaxAgeNumBlocks,
MaxAgeDuration: cp.Evidence.MaxAgeDuration,
Evidence: tmproto.EvidenceParams{
MaxAgeNumBlocks: cp.Evidence.MaxAgeNumBlocks,
MaxAgeDuration: cp.Evidence.MaxAgeDuration,
MaxNum: cp.Evidence.MaxNum,
ProofTrialPeriod: cp.Evidence.ProofTrialPeriod,
},
Validator: tmtypes.ValidatorParams{
Validator: tmproto.ValidatorParams{
PubKeyTypes: cp.Validator.PubKeyTypes,
},
}

View File

@ -3,11 +3,10 @@ package mock
import (
"testing"
"github.com/tendermint/tendermint/types"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/tendermint/tendermint/types"
)
// TestInitApp makes sure we can initialize this thing without an error
@ -57,7 +56,7 @@ func TestDeliverTx(t *testing.T) {
tx := NewTx(key, value)
txBytes := tx.GetSignBytes()
header := abci.Header{
header := tmproto.Header{
AppHash: []byte("apphash"),
Height: 1,
}

View File

@ -116,8 +116,8 @@ against which this app has been compiled.
}{
Tendermint: tversion.Version,
ABCI: tversion.ABCIVersion,
BlockProtocol: tversion.BlockProtocol.Uint64(),
P2PProtocol: tversion.P2PProtocol.Uint64(),
BlockProtocol: tversion.BlockProtocol,
P2PProtocol: tversion.P2PProtocol,
})
if err != nil {
return err

View File

@ -129,7 +129,6 @@ func interceptConfigs(ctx *Context, rootViper *viper.Viper) (*tmcfg.Config, erro
conf.ProfListenAddress = "localhost:6060"
conf.P2P.RecvRate = 5120000
conf.P2P.SendRate = 5120000
conf.TxIndex.IndexAllKeys = true
conf.Consensus.TimeoutCommit = 5 * time.Second
tmcfg.WriteConfigFile(configFile, conf)
} else {

View File

@ -7,6 +7,7 @@ import (
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/baseapp"
@ -382,7 +383,7 @@ func NewSimApp(
// sub-keepers.
// This must be done during creation of baseapp rather than in InitChain so
// that in-memory capabilities get regenerated on app restart
ctx := app.BaseApp.NewUncachedContext(true, abci.Header{})
ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{})
app.CapabilityKeeper.InitializeAndSeal(ctx)
app.ScopedIBCKeeper = scopedIBCKeeper

View File

@ -5,6 +5,7 @@ import (
"log"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
@ -21,7 +22,7 @@ func (app *SimApp) ExportAppStateAndValidators(
) (appState json.RawMessage, validators []tmtypes.GenesisValidator, cp *abci.ConsensusParams, err error) {
// as if they could withdraw from the start of the next block
ctx := app.NewContext(true, abci.Header{Height: app.LastBlockHeight()})
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})
if forZeroHeight {
app.prepForZeroHeightGenesis(ctx, jailWhiteList)

View File

@ -5,7 +5,7 @@ import (
"os"
"testing"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/x/simulation"
)
@ -87,7 +87,7 @@ func BenchmarkInvariants(b *testing.B) {
PrintStats(db)
}
ctx := app.NewContext(true, abci.Header{Height: app.LastBlockHeight() + 1})
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight() + 1})
// 3. Benchmark each invariant separately
//

View File

@ -8,9 +8,9 @@ import (
"testing"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/baseapp"
@ -140,8 +140,8 @@ func TestAppImportExport(t *testing.T) {
err = json.Unmarshal(appState, &genesisState)
require.NoError(t, err)
ctxA := app.NewContext(true, abci.Header{Height: app.LastBlockHeight()})
ctxB := newApp.NewContext(true, abci.Header{Height: app.LastBlockHeight()})
ctxA := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})
ctxB := newApp.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})
newApp.mm.InitGenesis(ctxB, app.AppCodec(), genesisState)
newApp.StoreConsensusParams(ctxB, consensusParams)

View File

@ -152,7 +152,7 @@ func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONMarshaler, genesisFile
panic(err)
}
privKey := secp256k1.GenPrivKeySecp256k1(privkeySeed)
privKey := secp256k1.GenPrivKeyFromSecret(privkeySeed)
a, ok := acc.GetCachedValue().(authtypes.AccountI)
if !ok {

View File

@ -14,6 +14,7 @@ import (
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"
@ -33,14 +34,13 @@ var DefaultConsensusParams = &abci.ConsensusParams{
MaxBytes: 200000,
MaxGas: 2000000,
},
Evidence: &abci.EvidenceParams{
Evidence: &tmproto.EvidenceParams{
MaxAgeNumBlocks: 302400,
MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration
},
Validator: &abci.ValidatorParams{
Validator: &tmproto.ValidatorParams{
PubKeyTypes: []string{
tmtypes.ABCIPubKeyTypeEd25519,
tmtypes.ABCIPubKeyTypeSecp256k1,
},
},
}
@ -136,7 +136,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs
// commit genesis changes
app.Commit()
app.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{
app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{
Height: app.LastBlockHeight() + 1,
AppHash: app.LastCommitID().Hash,
ValidatorsHash: valSet.Hash(),
@ -180,7 +180,7 @@ func SetupWithGenesisAccounts(genAccs []authtypes.GenesisAccount, balances ...ba
)
app.Commit()
app.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{Height: app.LastBlockHeight() + 1}})
app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1}})
return app
}
@ -309,7 +309,7 @@ func TestAddr(addr string, bech string) (sdk.AccAddress, error) {
// CheckBalance checks the balance of an account.
func CheckBalance(t *testing.T, app *SimApp, addr sdk.AccAddress, balances sdk.Coins) {
ctxCheck := app.BaseApp.NewContext(true, abci.Header{})
ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{})
require.True(t, balances.IsEqual(app.BankKeeper.GetAllBalances(ctxCheck, addr)))
}
@ -318,7 +318,7 @@ func CheckBalance(t *testing.T, app *SimApp, addr sdk.AccAddress, balances sdk.C
// the parameter 'expPass' against the result. A corresponding result is
// returned.
func SignCheckDeliver(
t *testing.T, txGen client.TxConfig, app *bam.BaseApp, header abci.Header, msgs []sdk.Msg,
t *testing.T, txGen client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg,
accNums, seq []uint64, expSimPass, expPass bool, priv ...crypto.PrivKey,
) (sdk.GasInfo, *sdk.Result, error) {
@ -420,7 +420,7 @@ func NewPubKeyFromHex(pk string) (res crypto.PubKey) {
if err != nil {
panic(err)
}
var pkEd ed25519.PubKeyEd25519
copy(pkEd[:], pkBytes)
pkEd := make(ed25519.PubKey, ed25519.PubKeySize)
copy(pkEd, pkBytes)
return pkEd
}

View File

@ -2,6 +2,7 @@ package std
import (
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
@ -18,10 +19,10 @@ func ConsensusParamsKeyTable() paramstypes.KeyTable {
baseapp.ParamStoreKeyBlockParams, abci.BlockParams{}, baseapp.ValidateBlockParams,
),
paramstypes.NewParamSetPair(
baseapp.ParamStoreKeyEvidenceParams, abci.EvidenceParams{}, baseapp.ValidateEvidenceParams,
baseapp.ParamStoreKeyEvidenceParams, tmproto.EvidenceParams{}, baseapp.ValidateEvidenceParams,
),
paramstypes.NewParamSetPair(
baseapp.ParamStoreKeyValidatorParams, abci.ValidatorParams{}, baseapp.ValidateValidatorParams,
baseapp.ParamStoreKeyValidatorParams, tmproto.ValidatorParams{}, baseapp.ValidateValidatorParams,
),
)
}

View File

@ -23,27 +23,30 @@ func (cdc DefaultPublicKeyCodec) Decode(key *types.PublicKey) (crypto.PubKey, er
switch key := key.Sum.(type) {
case *types.PublicKey_Secp256K1:
n := len(key.Secp256K1)
if n != secp256k1.PubKeySecp256k1Size {
if n != secp256k1.PubKeySize {
return nil, fmt.Errorf("wrong length %d for secp256k1 public key", n)
}
var res secp256k1.PubKeySecp256k1
copy(res[:], key.Secp256K1)
res := make(secp256k1.PubKey, secp256k1.PubKeySize)
copy(res, key.Secp256K1)
return res, nil
case *types.PublicKey_Ed25519:
n := len(key.Ed25519)
if n != ed255192.PubKeyEd25519Size {
if n != ed255192.PubKeySize {
return nil, fmt.Errorf("wrong length %d for ed25519 public key", n)
}
var res ed255192.PubKeyEd25519
copy(res[:], key.Ed25519)
res := make(ed255192.PubKey, ed255192.PubKeySize)
copy(res, key.Ed25519)
return res, nil
case *types.PublicKey_Sr25519:
n := len(key.Sr25519)
if n != sr25519.PubKeySr25519Size {
if n != sr25519.PubKeySize {
return nil, fmt.Errorf("wrong length %d for sr25519 public key", n)
}
var res sr25519.PubKeySr25519
copy(res[:], key.Sr25519)
res := make(sr25519.PubKey, sr25519.PubKeySize)
copy(res, key.Sr25519)
return res, nil
case *types.PublicKey_Multisig:
@ -66,12 +69,12 @@ func (cdc DefaultPublicKeyCodec) Decode(key *types.PublicKey) (crypto.PubKey, er
// Encode implements the PublicKeyCodec.Encode method
func (cdc DefaultPublicKeyCodec) Encode(key crypto.PubKey) (*types.PublicKey, error) {
switch key := key.(type) {
case secp256k1.PubKeySecp256k1:
return &types.PublicKey{Sum: &types.PublicKey_Secp256K1{Secp256K1: key[:]}}, nil
case ed255192.PubKeyEd25519:
return &types.PublicKey{Sum: &types.PublicKey_Ed25519{Ed25519: key[:]}}, nil
case sr25519.PubKeySr25519:
return &types.PublicKey{Sum: &types.PublicKey_Sr25519{Sr25519: key[:]}}, nil
case secp256k1.PubKey:
return &types.PublicKey{Sum: &types.PublicKey_Secp256K1{Secp256K1: key}}, nil
case ed255192.PubKey:
return &types.PublicKey{Sum: &types.PublicKey_Ed25519{Ed25519: key}}, nil
case sr25519.PubKey:
return &types.PublicKey{Sum: &types.PublicKey_Sr25519{Sr25519: key}}, nil
case multisig.PubKeyMultisigThreshold:
pubKeys := key.PubKeys
resKeys := make([]*types.PublicKey, len(pubKeys))

View File

@ -4,13 +4,13 @@ import (
"fmt"
"testing"
"github.com/cosmos/iavl"
"github.com/stretchr/testify/require"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/store/cache"
iavlstore "github.com/cosmos/cosmos-sdk/store/iavl"
"github.com/cosmos/cosmos-sdk/store/types"
"github.com/stretchr/testify/require"
"github.com/tendermint/iavl"
dbm "github.com/tendermint/tm-db"
)
func TestGetOrSetStoreCache(t *testing.T) {

View File

@ -89,10 +89,12 @@ func (mi *memIterator) Value() []byte {
return mi.items[len(mi.items)-1].Value
}
func (mi *memIterator) Close() {
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

View File

@ -151,9 +151,12 @@ func (iter *cacheMergeIterator) Value() []byte {
}
// Close implements Iterator
func (iter *cacheMergeIterator) Close() {
iter.parent.Close()
iter.cache.Close()
func (iter *cacheMergeIterator) Close() error {
if err := iter.parent.Close(); err != nil {
return err
}
return iter.cache.Close()
}
// Error returns an error if the cacheMergeIterator is invalid defined by the

View File

@ -165,8 +165,8 @@ func (gi *gasIterator) Value() (value []byte) {
}
// Implements Iterator.
func (gi *gasIterator) Close() {
gi.parent.Close()
func (gi *gasIterator) Close() error {
return gi.parent.Close()
}
// Error delegates the Error call to the parent iterator.

View File

@ -55,7 +55,11 @@ func TestGasKVStoreIterator(t *testing.T) {
require.Nil(t, end)
require.NoError(t, iterator.Error())
t.Cleanup(iterator.Close)
t.Cleanup(func() {
if err := iterator.Close(); err != nil {
t.Fatal(err)
}
})
ka := iterator.Key()
require.Equal(t, ka, keyFmt(1))
va := iterator.Value()
@ -71,7 +75,11 @@ func TestGasKVStoreIterator(t *testing.T) {
require.NoError(t, iterator.Error())
reverseIterator := st.ReverseIterator(nil, nil)
t.Cleanup(reverseIterator.Close)
t.Cleanup(func() {
if err := reverseIterator.Close(); err != nil {
t.Fatal(err)
}
})
require.Equal(t, reverseIterator.Key(), keyFmt(2))
reverseIterator.Next()
require.Equal(t, reverseIterator.Key(), keyFmt(1))

View File

@ -6,11 +6,10 @@ import (
"sync"
"time"
ics23iavl "github.com/confio/ics23-iavl"
ics23 "github.com/confio/ics23/go"
"github.com/tendermint/iavl"
"github.com/cosmos/iavl"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/merkle"
tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/store/cachekv"
@ -267,7 +266,7 @@ func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
}
// get proof from tree and convert to merkle.Proof before adding to result
res.Proof = getProofFromTree(mtree, req.Data, res.Value != nil)
res.ProofOps = getProofFromTree(mtree, req.Data, res.Value != nil)
case "/subspace":
pairs := kv.Pairs{
@ -300,7 +299,7 @@ func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
// Takes a MutableTree, a key, and a flag for creating existence or absence proof and returns the
// appropriate merkle.Proof. Since this must be called after querying for the value, this function should never error
// Thus, it will panic on error rather than returning it
func getProofFromTree(tree *iavl.MutableTree, key []byte, exists bool) *merkle.Proof {
func getProofFromTree(tree *iavl.MutableTree, key []byte, exists bool) *tmcrypto.ProofOps {
var (
commitmentProof *ics23.CommitmentProof
err error
@ -308,14 +307,14 @@ func getProofFromTree(tree *iavl.MutableTree, key []byte, exists bool) *merkle.P
if exists {
// value was found
commitmentProof, err = ics23iavl.CreateMembershipProof(tree, key)
commitmentProof, err = tree.GetMembershipProof(key)
if err != nil {
// sanity check: If value was found, membership proof must be creatable
panic(fmt.Sprintf("unexpected value for empty proof: %s", err.Error()))
}
} else {
// value wasn't found
commitmentProof, err = ics23iavl.CreateNonMembershipProof(tree, key)
commitmentProof, err = tree.GetNonMembershipProof(key)
if err != nil {
// sanity check: If value wasn't found, nonmembership proof must be creatable
panic(fmt.Sprintf("unexpected error for nonexistence proof: %s", err.Error()))
@ -323,7 +322,7 @@ func getProofFromTree(tree *iavl.MutableTree, key []byte, exists bool) *merkle.P
}
op := types.NewIavlCommitmentOp(key, commitmentProof)
return &merkle.Proof{Ops: []merkle.ProofOp{op.ProofOp()}}
return &tmcrypto.ProofOps{Ops: []tmcrypto.ProofOp{op.ProofOp()}}
}
//----------------------------------------
@ -446,11 +445,13 @@ func (iter *iavlIterator) Value() []byte {
// Close closes the IAVL iterator by closing the quit channel and waiting for
// the iterCh to finish/close.
func (iter *iavlIterator) Close() {
func (iter *iavlIterator) Close() error {
close(iter.quitCh)
// wait iterCh to close
for range iter.iterCh {
}
return nil
}
// Error performs a no-op.

View File

@ -5,8 +5,8 @@ import (
"fmt"
"testing"
"github.com/cosmos/iavl"
"github.com/stretchr/testify/require"
"github.com/tendermint/iavl"
abci "github.com/tendermint/tendermint/abci/types"
dbm "github.com/tendermint/tm-db"
@ -73,7 +73,7 @@ func TestGetImmutable(t *testing.T) {
res := newStore.Query(abci.RequestQuery{Data: []byte("hello"), Height: cID.Version, Path: "/key", Prove: true})
require.Equal(t, res.Value, []byte("adios"))
require.NotNil(t, res.Proof)
require.NotNil(t, res.ProofOps)
require.Panics(t, func() { newStore.Set(nil, nil) })
require.Panics(t, func() { newStore.Delete(nil) })

View File

@ -3,7 +3,7 @@ package iavl
import (
"fmt"
"github.com/tendermint/iavl"
"github.com/cosmos/iavl"
)
var (

View File

@ -3,8 +3,8 @@ package iavl
import (
"testing"
"github.com/cosmos/iavl"
"github.com/stretchr/testify/require"
"github.com/tendermint/iavl"
dbm "github.com/tendermint/tm-db"
)

View File

@ -5,6 +5,7 @@ import (
"github.com/tendermint/tendermint/crypto/merkle"
"github.com/tendermint/tendermint/crypto/tmhash"
tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
"github.com/cosmos/cosmos-sdk/types/kv"
)
@ -65,7 +66,7 @@ func hashKVPairs(kvs kv.Pairs) []byte {
kvsH[i] = KVPair(kvp).Bytes()
}
return merkle.SimpleHashFromByteSlices(kvsH)
return merkle.HashFromByteSlices(kvsH)
}
// ---------------------------------------------
@ -168,9 +169,9 @@ func (kv KVPair) Bytes() []byte {
return buf[:nlk+nk+nlv+nv]
}
// SimpleHashFromMap computes a merkle tree from sorted map and returns the merkle
// HashFromMap computes a merkle tree from sorted map and returns the merkle
// root.
func SimpleHashFromMap(m map[string][]byte) []byte {
func HashFromMap(m map[string][]byte) []byte {
mm := newMerkleMap()
for k, v := range m {
mm.set(k, v)
@ -179,10 +180,10 @@ func SimpleHashFromMap(m map[string][]byte) []byte {
return mm.hash()
}
// SimpleProofsFromMap generates proofs from a map. The keys/values of the map will be used as the keys/values
// ProofsFromMap generates proofs from a map. The keys/values of the map will be used as the keys/values
// in the underlying key-value pairs.
// The keys are sorted before the proofs are computed.
func SimpleProofsFromMap(m map[string][]byte) ([]byte, map[string]*merkle.SimpleProof, []string) {
func ProofsFromMap(m map[string][]byte) ([]byte, map[string]*tmcrypto.Proof, []string) {
sm := newSimpleMap()
for k, v := range m {
sm.Set(k, v)
@ -195,12 +196,12 @@ func SimpleProofsFromMap(m map[string][]byte) ([]byte, map[string]*merkle.Simple
kvsBytes[i] = KVPair(kvp).Bytes()
}
rootHash, proofList := merkle.SimpleProofsFromByteSlices(kvsBytes)
proofs := make(map[string]*merkle.SimpleProof)
rootHash, proofList := merkle.ProofsFromByteSlices(kvsBytes)
proofs := make(map[string]*tmcrypto.Proof)
keys := make([]string, len(proofList))
for i, kvp := range kvs.Pairs {
proofs[string(kvp.Key)] = proofList[i]
proofs[string(kvp.Key)] = proofList[i].ToProto()
keys[i] = string(kvp.Key)
}

View File

@ -18,7 +18,7 @@ func TestMerkleMap(t *testing.T) {
values []string // each string gets converted to []byte in test
want string
}{
{[]string{}, []string{}, ""},
{[]string{}, []string{}, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},
{[]string{"key1"}, []string{"value1"}, "a44d3cc7daba1a4600b00a2434b30f8b970652169810d6dfa9fb1793a2189324"},
{[]string{"key1"}, []string{"value2"}, "0638e99b3445caec9d95c05e1a3fc1487b4ddec6a952ff337080360b0dcc078c"},
// swap order with 2 keys
@ -65,7 +65,7 @@ func TestSimpleMap(t *testing.T) {
values []string // each string gets converted to []byte in test
want string
}{
{[]string{}, []string{}, ""},
{[]string{}, []string{}, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},
{[]string{"key1"}, []string{"value1"}, "a44d3cc7daba1a4600b00a2434b30f8b970652169810d6dfa9fb1793a2189324"},
{[]string{"key1"}, []string{"value2"}, "0638e99b3445caec9d95c05e1a3fc1487b4ddec6a952ff337080360b0dcc078c"},
// swap order with 2 keys

View File

@ -5,7 +5,7 @@ import (
"math/bits"
ics23 "github.com/confio/ics23/go"
"github.com/tendermint/tendermint/crypto/merkle"
"github.com/tendermint/tendermint/proto/tendermint/crypto"
)
// ConvertExistenceProof will convert the given proof into a valid
@ -13,7 +13,7 @@ import (
//
// This is the simplest case of the range proof and we will focus on
// demoing compatibility here
func ConvertExistenceProof(p *merkle.SimpleProof, key, value []byte) (*ics23.ExistenceProof, error) {
func ConvertExistenceProof(p *crypto.Proof, key, value []byte) (*ics23.ExistenceProof, error) {
path, err := convertInnerOps(p)
if err != nil {
return nil, err
@ -42,7 +42,7 @@ func convertLeafOp() *ics23.LeafOp {
}
}
func convertInnerOps(p *merkle.SimpleProof) ([]*ics23.InnerOp, error) {
func convertInnerOps(p *crypto.Proof) ([]*ics23.InnerOp, error) {
inners := make([]*ics23.InnerOp, 0, len(p.Aunts))
path := buildPath(p.Index, p.Total)
@ -69,7 +69,7 @@ func convertInnerOps(p *merkle.SimpleProof) ([]*ics23.InnerOp, error) {
// buildPath returns a list of steps from leaf to root
// in each step, true means index is left side, false index is right side
// code adapted from merkle/simple_proof.go:computeHashFromAunts
func buildPath(idx int, total int) []bool {
func buildPath(idx, total int64) []bool {
if total < 2 {
return nil
}
@ -84,13 +84,13 @@ func buildPath(idx int, total int) []bool {
return append(buildPath(idx-numLeft, total-numLeft), goLeft)
}
func getSplitPoint(length int) int {
func getSplitPoint(length int64) int64 {
if length < 1 {
panic("Trying to split a tree with size < 1")
}
uLength := uint(length)
bitlen := bits.Len(uLength)
k := 1 << uint(bitlen-1)
k := int64(1 << uint(bitlen-1))
if k == length {
k >>= 1
}

View File

@ -31,8 +31,8 @@ func TestLeafOp(t *testing.T) {
func TestBuildPath(t *testing.T) {
cases := map[string]struct {
idx int
total int
idx int64
total int64
expected []bool
}{
"pair left": {

View File

@ -94,7 +94,7 @@ func createExistenceProof(data map[string][]byte, key []byte) (*ics23.ExistenceP
return nil, fmt.Errorf("cannot make existence proof if key is not in map")
}
_, ics23, _ := sdkmaps.SimpleProofsFromMap(data)
_, ics23, _ := sdkmaps.ProofsFromMap(data)
proof := ics23[string(key)]
if proof == nil {
return nil, fmt.Errorf("returned no proof for key")

View File

@ -3,15 +3,17 @@ package proofs
import (
"sort"
"github.com/tendermint/tendermint/crypto/merkle"
"github.com/tendermint/tendermint/libs/rand"
tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
sdkmaps "github.com/cosmos/cosmos-sdk/store/internal/maps"
)
// SimpleResult contains a merkle.SimpleProof along with all data needed to build the confio/proof
type SimpleResult struct {
Key []byte
Value []byte
Proof *merkle.SimpleProof
Proof *tmcrypto.Proof
RootHash []byte
}
@ -20,7 +22,7 @@ type SimpleResult struct {
// returns a range proof and the root hash of the tree
func GenerateRangeProof(size int, loc Where) *SimpleResult {
data := BuildMap(size)
root, proofs, allkeys := merkle.SimpleProofsFromMap(data)
root, proofs, allkeys := sdkmaps.ProofsFromMap(data)
key := GetKey(allkeys, loc)
proof := proofs[key]
@ -55,7 +57,7 @@ func SortedKeys(data map[string][]byte) []string {
}
func CalcRoot(data map[string][]byte) []byte {
root, _, _ := merkle.SimpleProofsFromMap(data)
root, _, _ := sdkmaps.ProofsFromMap(data)
return root
}

View File

@ -178,8 +178,8 @@ func (pi *prefixIterator) Value() []byte {
}
// Implements Iterator
func (pi *prefixIterator) Close() {
pi.iter.Close()
func (pi *prefixIterator) Close() error {
return pi.iter.Close()
}
// Error returns an error if the prefixIterator is invalid defined by the Valid

View File

@ -4,16 +4,15 @@ import (
"crypto/rand"
"testing"
"github.com/stretchr/testify/require"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/store/dbadapter"
"github.com/cosmos/cosmos-sdk/store/gaskv"
"github.com/cosmos/cosmos-sdk/store/iavl"
"github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"
tiavl "github.com/tendermint/iavl"
dbm "github.com/tendermint/tm-db"
tiavl "github.com/cosmos/iavl"
)
// copied from iavl/store_test.go

View File

@ -26,31 +26,31 @@ func TestVerifyIAVLStoreQueryProof(t *testing.T) {
Data: []byte("MYKEY"),
Prove: true,
})
require.NotNil(t, res.Proof)
require.NotNil(t, res.ProofOps)
// Verify proof.
prt := DefaultProofRuntime()
err = prt.VerifyValue(res.Proof, cid.Hash, "/MYKEY", []byte("MYVALUE"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/MYKEY", []byte("MYVALUE"))
require.Nil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "/MYKEY_NOT", []byte("MYVALUE"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/MYKEY_NOT", []byte("MYVALUE"))
require.NotNil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "/MYKEY/MYKEY", []byte("MYVALUE"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/MYKEY/MYKEY", []byte("MYVALUE"))
require.NotNil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "MYKEY", []byte("MYVALUE"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "MYKEY", []byte("MYVALUE"))
require.NotNil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "/MYKEY", []byte("MYVALUE_NOT"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/MYKEY", []byte("MYVALUE_NOT"))
require.NotNil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "/MYKEY", []byte(nil))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/MYKEY", []byte(nil))
require.NotNil(t, err)
}
@ -73,39 +73,39 @@ func TestVerifyMultiStoreQueryProof(t *testing.T) {
Data: []byte("MYKEY"),
Prove: true,
})
require.NotNil(t, res.Proof)
require.NotNil(t, res.ProofOps)
// Verify proof.
prt := DefaultProofRuntime()
err := prt.VerifyValue(res.Proof, cid.Hash, "/iavlStoreKey/MYKEY", []byte("MYVALUE"))
err := prt.VerifyValue(res.ProofOps, cid.Hash, "/iavlStoreKey/MYKEY", []byte("MYVALUE"))
require.Nil(t, err)
// Verify proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "/iavlStoreKey/MYKEY", []byte("MYVALUE"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/iavlStoreKey/MYKEY", []byte("MYVALUE"))
require.Nil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "/iavlStoreKey/MYKEY_NOT", []byte("MYVALUE"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/iavlStoreKey/MYKEY_NOT", []byte("MYVALUE"))
require.NotNil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "/iavlStoreKey/MYKEY/MYKEY", []byte("MYVALUE"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/iavlStoreKey/MYKEY/MYKEY", []byte("MYVALUE"))
require.NotNil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "iavlStoreKey/MYKEY", []byte("MYVALUE"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "iavlStoreKey/MYKEY", []byte("MYVALUE"))
require.NotNil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "/MYKEY", []byte("MYVALUE"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/MYKEY", []byte("MYVALUE"))
require.NotNil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "/iavlStoreKey/MYKEY", []byte("MYVALUE_NOT"))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/iavlStoreKey/MYKEY", []byte("MYVALUE_NOT"))
require.NotNil(t, err)
// Verify (bad) proof.
err = prt.VerifyValue(res.Proof, cid.Hash, "/iavlStoreKey/MYKEY", []byte(nil))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/iavlStoreKey/MYKEY", []byte(nil))
require.NotNil(t, err)
}
@ -129,20 +129,20 @@ func TestVerifyMultiStoreQueryProofAbsence(t *testing.T) {
Data: []byte("MYABSENTKEY"),
Prove: true,
})
require.NotNil(t, res.Proof)
require.NotNil(t, res.ProofOps)
// Verify proof.
prt := DefaultProofRuntime()
err = prt.VerifyAbsence(res.Proof, cid.Hash, "/iavlStoreKey/MYABSENTKEY")
err = prt.VerifyAbsence(res.ProofOps, cid.Hash, "/iavlStoreKey/MYABSENTKEY")
require.Nil(t, err)
// Verify (bad) proof.
prt = DefaultProofRuntime()
err = prt.VerifyAbsence(res.Proof, cid.Hash, "/MYABSENTKEY")
err = prt.VerifyAbsence(res.ProofOps, cid.Hash, "/MYABSENTKEY")
require.NotNil(t, err)
// Verify (bad) proof.
prt = DefaultProofRuntime()
err = prt.VerifyValue(res.Proof, cid.Hash, "/iavlStoreKey/MYABSENTKEY", []byte(""))
err = prt.VerifyValue(res.ProofOps, cid.Hash, "/iavlStoreKey/MYABSENTKEY", []byte(""))
require.NotNil(t, err)
}

View File

@ -6,9 +6,9 @@ import (
"io"
"strings"
iavltree "github.com/cosmos/iavl"
gogotypes "github.com/gogo/protobuf/types"
"github.com/pkg/errors"
iavltree "github.com/tendermint/iavl"
abci "github.com/tendermint/tendermint/abci/types"
dbm "github.com/tendermint/tm-db"
@ -477,7 +477,7 @@ func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery {
return res
}
if res.Proof == nil || len(res.Proof.Ops) == 0 {
if res.ProofOps == nil || len(res.ProofOps.Ops) == 0 {
return sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "proof is unexpectedly empty; ensure height has not been pruned"))
}
@ -496,7 +496,7 @@ func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery {
}
// Restore origin path and append proof op.
res.Proof.Ops = append(res.Proof.Ops, commitInfo.ProofOp(storeName))
res.ProofOps.Ops = append(res.ProofOps.Ops, commitInfo.ProofOp(storeName))
return res
}

View File

@ -591,5 +591,5 @@ func hashStores(stores map[types.StoreKey]types.CommitKVStore) []byte {
CommitId: store.LastCommitID(),
}.GetHash()
}
return sdkmaps.SimpleHashFromMap(m)
return sdkmaps.HashFromMap(m)
}

View File

@ -146,8 +146,8 @@ func (ti *traceIterator) Value() []byte {
}
// Close implements the Iterator interface.
func (ti *traceIterator) Close() {
ti.parent.Close()
func (ti *traceIterator) Close() error {
return ti.parent.Close()
}
// Error delegates the Error call to the parent iterator.

View File

@ -50,11 +50,6 @@ func TestTraceKVStoreGet(t *testing.T) {
expectedValue []byte
expectedOut string
}{
{
key: []byte{},
expectedValue: nil,
expectedOut: "{\"operation\":\"read\",\"key\":\"\",\"value\":\"\",\"metadata\":{\"blockHeight\":64}}\n",
},
{
key: kvPairs[0].Key,
expectedValue: kvPairs[0].Value,
@ -124,10 +119,6 @@ func TestTraceKVStoreDelete(t *testing.T) {
key []byte
expectedOut string
}{
{
key: []byte{},
expectedOut: "{\"operation\":\"delete\",\"key\":\"\",\"value\":\"\",\"metadata\":{\"blockHeight\":64}}\n",
},
{
key: kvPairs[0].Key,
expectedOut: "{\"operation\":\"delete\",\"key\":\"a2V5MDAwMDAwMDE=\",\"value\":\"\",\"metadata\":{\"blockHeight\":64}}\n",
@ -150,10 +141,6 @@ func TestTraceKVStoreHas(t *testing.T) {
key []byte
expected bool
}{
{
key: []byte{},
expected: false,
},
{
key: kvPairs[0].Key,
expected: true,
@ -224,7 +211,7 @@ func TestTestTraceKVStoreIterator(t *testing.T) {
require.False(t, iterator.Valid())
require.Panics(t, iterator.Next)
require.NotPanics(t, iterator.Close)
require.NoError(t, iterator.Close())
}
func TestTestTraceKVStoreReverseIterator(t *testing.T) {
@ -280,7 +267,7 @@ func TestTestTraceKVStoreReverseIterator(t *testing.T) {
require.False(t, iterator.Valid())
require.Panics(t, iterator.Next)
require.NotPanics(t, iterator.Close)
require.NoError(t, iterator.Close())
}
func TestTraceKVStorePrefix(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
fmt "fmt"
ics23 "github.com/confio/ics23/go"
"github.com/tendermint/tendermint/crypto/merkle"
tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto"
sdkmaps "github.com/cosmos/cosmos-sdk/store/internal/maps"
sdkproofs "github.com/cosmos/cosmos-sdk/store/internal/proofs"
@ -37,13 +37,13 @@ func (ci CommitInfo) Hash() []byte {
return nil
}
rootHash, _, _ := sdkmaps.SimpleProofsFromMap(ci.toMap())
rootHash, _, _ := sdkmaps.ProofsFromMap(ci.toMap())
return rootHash
}
func (ci CommitInfo) ProofOp(storeName string) merkle.ProofOp {
func (ci CommitInfo) ProofOp(storeName string) tmcrypto.ProofOp {
cmap := ci.toMap()
_, proofs, _ := sdkmaps.SimpleProofsFromMap(cmap)
_, proofs, _ := sdkmaps.ProofsFromMap(cmap)
proof := proofs[storeName]
if proof == nil {

View File

@ -3,6 +3,7 @@ package types
import (
ics23 "github.com/confio/ics23/go"
"github.com/tendermint/tendermint/crypto/merkle"
tmmerkle "github.com/tendermint/tendermint/proto/tendermint/crypto"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
@ -48,7 +49,7 @@ func NewSimpleMerkleCommitmentOp(key []byte, proof *ics23.CommitmentProof) Commi
// CommitmentOpDecoder takes a merkle.ProofOp and attempts to decode it into a CommitmentOp ProofOperator
// The proofOp.Data is just a marshalled CommitmentProof. The Key of the CommitmentOp is extracted
// from the unmarshalled proof.
func CommitmentOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error) {
func CommitmentOpDecoder(pop tmmerkle.ProofOp) (merkle.ProofOperator, error) {
var spec *ics23.ProofSpec
switch pop.Type {
case ProofOpIAVLCommitment:
@ -117,12 +118,12 @@ func (op CommitmentOp) Run(args [][]byte) ([][]byte, error) {
// ProofOp implements ProofOperator interface and converts a CommitmentOp
// into a merkle.ProofOp format that can later be decoded by CommitmentOpDecoder
// back into a CommitmentOp for proof verification
func (op CommitmentOp) ProofOp() merkle.ProofOp {
func (op CommitmentOp) ProofOp() tmmerkle.ProofOp {
bz, err := op.Proof.Marshal()
if err != nil {
panic(err.Error())
}
return merkle.ProofOp{
return tmmerkle.ProofOp{
Type: op.Type,
Key: op.Key,
Data: bz,

View File

@ -9,7 +9,9 @@
},
"evidence": {
"max_age_num_blocks": "100000",
"max_age_duration": "172800000000000"
"max_age_duration": "172800000000000",
"max_num": 50,
"proof_trial_period": "50000"
},
"validator": {
"pub_key_types": [
@ -23,57 +25,62 @@
"params": {
"default_send_enabled": true
},
"balances": [ {"address": "cosmos106vrzv5xkheqhjm023pxcxlqmcjvuhtfyachz4",
"coins": [
{
"denom": "nametoken",
"amount": "1000"
},
{
"denom": "stake",
"amount": "100000000"
}
]
},
{ "address": "cosmos1xztun2634zplhajda7tmjaxy488qj44n765t58",
"coins": [
{
"denom": "nametoken",
"amount": "1000"
},
{
"denom": "stake",
"amount": "100000000"
}
]
}
],
"balances": [
{
"address": "cosmos106vrzv5xkheqhjm023pxcxlqmcjvuhtfyachz4",
"coins": [
{
"denom": "nametoken",
"amount": "1000"
},
{
"denom": "stake",
"amount": "100000000"
}
]
},
{
"address": "cosmos1xztun2634zplhajda7tmjaxy488qj44n765t58",
"coins": [
{
"denom": "nametoken",
"amount": "1000"
},
{
"denom": "stake",
"amount": "100000000"
}
]
}
],
"supply": [],
"denom_metadata": [{
"description": "The native staking token of the Cosmos Hub.",
"denom_units": [ {
"denom": "uatom",
"exponent": 0,
"aliases": [
"microatom"
]
},
{
"denom": "matom",
"exponent": 3,
"aliases": [
"milliatom"
]
},
{
"denom": "atom",
"exponent": 6
}],
"base": "uatom",
"display": "atom"
}]
"denom_metadata": [
{
"description": "The native staking token of the Cosmos Hub.",
"denom_units": [
{
"denom": "uatom",
"exponent": 0,
"aliases": [
"microatom"
]
},
{
"denom": "matom",
"exponent": 3,
"aliases": [
"milliatom"
]
},
{
"denom": "atom",
"exponent": 6
}
],
"base": "uatom",
"display": "atom"
}
]
},
"genutil": {
"gentxs": []

View File

@ -0,0 +1,401 @@
syntax = "proto3";
package tendermint.abci;
option go_package = "github.com/tendermint/tendermint/abci/types";
// For more information on gogo.proto, see:
// https://github.com/gogo/protobuf/blob/master/extensions.md
import "tendermint/crypto/proof.proto";
import "tendermint/types/types.proto";
import "tendermint/crypto/keys.proto";
import "tendermint/types/params.proto";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
// This file is copied from http://github.com/tendermint/abci
// NOTE: When using custom types, mind the warnings.
// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues
//----------------------------------------
// Request types
message Request {
oneof value {
RequestEcho echo = 1;
RequestFlush flush = 2;
RequestInfo info = 3;
RequestSetOption set_option = 4;
RequestInitChain init_chain = 5;
RequestQuery query = 6;
RequestBeginBlock begin_block = 7;
RequestCheckTx check_tx = 8;
RequestDeliverTx deliver_tx = 9;
RequestEndBlock end_block = 10;
RequestCommit commit = 11;
RequestListSnapshots list_snapshots = 12;
RequestOfferSnapshot offer_snapshot = 13;
RequestLoadSnapshotChunk load_snapshot_chunk = 14;
RequestApplySnapshotChunk apply_snapshot_chunk = 15;
}
}
message RequestEcho {
string message = 1;
}
message RequestFlush {}
message RequestInfo {
string version = 1;
uint64 block_version = 2;
uint64 p2p_version = 3;
}
// nondeterministic
message RequestSetOption {
string key = 1;
string value = 2;
}
message RequestInitChain {
google.protobuf.Timestamp time = 1
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
string chain_id = 2;
ConsensusParams consensus_params = 3;
repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false];
bytes app_state_bytes = 5;
int64 initial_height = 6;
}
message RequestQuery {
bytes data = 1;
string path = 2;
int64 height = 3;
bool prove = 4;
}
message RequestBeginBlock {
bytes hash = 1;
tendermint.types.Header header = 2 [(gogoproto.nullable) = false];
LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false];
repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false];
}
enum CheckTxType {
NEW = 0 [(gogoproto.enumvalue_customname) = "New"];
RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"];
}
message RequestCheckTx {
bytes tx = 1;
CheckTxType type = 2;
}
message RequestDeliverTx {
bytes tx = 1;
}
message RequestEndBlock {
int64 height = 1;
}
message RequestCommit {}
// lists available snapshots
message RequestListSnapshots {
}
// offers a snapshot to the application
message RequestOfferSnapshot {
Snapshot snapshot = 1; // snapshot offered by peers
bytes app_hash = 2; // light client-verified app hash for snapshot height
}
// loads a snapshot chunk
message RequestLoadSnapshotChunk {
uint64 height = 1;
uint32 format = 2;
uint32 chunk = 3;
}
// Applies a snapshot chunk
message RequestApplySnapshotChunk {
uint32 index = 1;
bytes chunk = 2;
string sender = 3;
}
//----------------------------------------
// Response types
message Response {
oneof value {
ResponseException exception = 1;
ResponseEcho echo = 2;
ResponseFlush flush = 3;
ResponseInfo info = 4;
ResponseSetOption set_option = 5;
ResponseInitChain init_chain = 6;
ResponseQuery query = 7;
ResponseBeginBlock begin_block = 8;
ResponseCheckTx check_tx = 9;
ResponseDeliverTx deliver_tx = 10;
ResponseEndBlock end_block = 11;
ResponseCommit commit = 12;
ResponseListSnapshots list_snapshots = 13;
ResponseOfferSnapshot offer_snapshot = 14;
ResponseLoadSnapshotChunk load_snapshot_chunk = 15;
ResponseApplySnapshotChunk apply_snapshot_chunk = 16;
}
}
// nondeterministic
message ResponseException {
string error = 1;
}
message ResponseEcho {
string message = 1;
}
message ResponseFlush {}
message ResponseInfo {
string data = 1;
string version = 2;
uint64 app_version = 3;
int64 last_block_height = 4;
bytes last_block_app_hash = 5;
}
// nondeterministic
message ResponseSetOption {
uint32 code = 1;
// bytes data = 2;
string log = 3;
string info = 4;
}
message ResponseInitChain {
ConsensusParams consensus_params = 1;
repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false];
bytes app_hash = 3;
}
message ResponseQuery {
uint32 code = 1;
// bytes data = 2; // use "value" instead.
string log = 3; // nondeterministic
string info = 4; // nondeterministic
int64 index = 5;
bytes key = 6;
bytes value = 7;
tendermint.crypto.ProofOps proof_ops = 8;
int64 height = 9;
string codespace = 10;
}
message ResponseBeginBlock {
repeated Event events = 1
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
}
message ResponseCheckTx {
uint32 code = 1;
bytes data = 2;
string log = 3; // nondeterministic
string info = 4; // nondeterministic
int64 gas_wanted = 5 [json_name = "gas_wanted"];
int64 gas_used = 6 [json_name = "gas_used"];
repeated Event events = 7
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
string codespace = 8;
}
message ResponseDeliverTx {
uint32 code = 1;
bytes data = 2;
string log = 3; // nondeterministic
string info = 4; // nondeterministic
int64 gas_wanted = 5 [json_name = "gas_wanted"];
int64 gas_used = 6 [json_name = "gas_used"];
repeated Event events = 7
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
string codespace = 8;
}
message ResponseEndBlock {
repeated ValidatorUpdate validator_updates = 1
[(gogoproto.nullable) = false];
ConsensusParams consensus_param_updates = 2;
repeated Event events = 3
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
}
message ResponseCommit {
// reserve 1
bytes data = 2;
int64 retain_height = 3;
}
message ResponseListSnapshots {
repeated Snapshot snapshots = 1;
}
message ResponseOfferSnapshot {
Result result = 1;
enum Result {
UNKNOWN = 0; // Unknown result, abort all snapshot restoration
ACCEPT = 1; // Snapshot accepted, apply chunks
ABORT = 2; // Abort all snapshot restoration
REJECT = 3; // Reject this specific snapshot, try others
REJECT_FORMAT = 4; // Reject all snapshots of this format, try others
REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others
}
}
message ResponseLoadSnapshotChunk {
bytes chunk = 1;
}
message ResponseApplySnapshotChunk {
Result result = 1;
repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply
repeated string reject_senders = 3; // Chunk senders to reject and ban
enum Result {
UNKNOWN = 0; // Unknown result, abort all snapshot restoration
ACCEPT = 1; // Chunk successfully accepted
ABORT = 2; // Abort all snapshot restoration
RETRY = 3; // Retry chunk (combine with refetch and reject)
RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject)
REJECT_SNAPSHOT = 5; // Reject this snapshot, try others
}
}
//----------------------------------------
// Misc.
// ConsensusParams contains all consensus-relevant parameters
// that can be adjusted by the abci app
message ConsensusParams {
BlockParams block = 1;
tendermint.types.EvidenceParams evidence = 2;
tendermint.types.ValidatorParams validator = 3;
tendermint.types.VersionParams version = 4;
}
// BlockParams contains limits on the block size.
message BlockParams {
// Note: must be greater than 0
int64 max_bytes = 1;
// Note: must be greater or equal to -1
int64 max_gas = 2;
}
message LastCommitInfo {
int32 round = 1;
repeated VoteInfo votes = 2 [(gogoproto.nullable) = false];
}
// Event allows application developers to attach additional information to
// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx.
// Later, transactions may be queried using these events.
message Event {
string type = 1;
repeated EventAttribute attributes = 2 [
(gogoproto.nullable) = false,
(gogoproto.jsontag) = "attributes,omitempty"
];
}
// EventAttribute is a single key-value pair, associated with an event.
message EventAttribute {
bytes key = 1;
bytes value = 2;
bool index = 3; // nondeterministic
}
// TxResult contains results of executing the transaction.
//
// One usage is indexing transaction results.
message TxResult {
int64 height = 1;
uint32 index = 2;
bytes tx = 3;
ResponseDeliverTx result = 4 [(gogoproto.nullable) = false];
}
//----------------------------------------
// Blockchain Types
// Validator
message Validator {
bytes address = 1; // The first 20 bytes of SHA256(public key)
// PubKey pub_key = 2 [(gogoproto.nullable)=false];
int64 power = 3; // The voting power
}
// ValidatorUpdate
message ValidatorUpdate {
tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false];
int64 power = 2;
}
// VoteInfo
message VoteInfo {
Validator validator = 1 [(gogoproto.nullable) = false];
bool signed_last_block = 2;
}
message Evidence {
string type = 1;
// The offending validator
Validator validator = 2 [(gogoproto.nullable) = false];
// The height when the offense occurred
int64 height = 3;
// The corresponding time where the offense occurred
google.protobuf.Timestamp time = 4 [
(gogoproto.nullable) = false,
(gogoproto.stdtime) = true
];
// Total voting power of the validator set in case the ABCI application does
// not store historical validators.
// https://github.com/tendermint/tendermint/issues/4581
int64 total_voting_power = 5;
}
//----------------------------------------
// State Sync Types
message Snapshot {
uint64 height = 1; // The height at which the snapshot was taken
uint32 format = 2; // The application-specific snapshot format
uint32 chunks = 3; // Number of chunks in the snapshot
bytes hash = 4; // Arbitrary snapshot hash, equal only if identical
bytes metadata = 5; // Arbitrary application metadata
}
//----------------------------------------
// Service Definition
service ABCIApplication {
rpc Echo(RequestEcho) returns (ResponseEcho);
rpc Flush(RequestFlush) returns (ResponseFlush);
rpc Info(RequestInfo) returns (ResponseInfo);
rpc SetOption(RequestSetOption) returns (ResponseSetOption);
rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
rpc Query(RequestQuery) returns (ResponseQuery);
rpc Commit(RequestCommit) returns (ResponseCommit);
rpc InitChain(RequestInitChain) returns (ResponseInitChain);
rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots);
rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot);
rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk);
rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk);
}

View File

@ -1,346 +0,0 @@
syntax = "proto3";
package tendermint.abci.types;
option go_package = "github.com/tendermint/tendermint/abci/types";
// For more information on gogo.proto, see:
// https://github.com/gogo/protobuf/blob/master/extensions.md
import "gogoproto/gogo.proto";
import "tendermint/crypto/merkle/merkle.proto";
import "tendermint/libs/kv/types.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
// This file is copied from http://github.com/tendermint/abci
// NOTE: When using custom types, mind the warnings.
// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.goproto_registration) = true;
// Generate tests
option (gogoproto.populate_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.testgen_all) = true;
//----------------------------------------
// Request types
message Request {
oneof value {
RequestEcho echo = 2;
RequestFlush flush = 3;
RequestInfo info = 4;
RequestSetOption set_option = 5;
RequestInitChain init_chain = 6;
RequestQuery query = 7;
RequestBeginBlock begin_block = 8;
RequestCheckTx check_tx = 9;
RequestDeliverTx deliver_tx = 19;
RequestEndBlock end_block = 11;
RequestCommit commit = 12;
}
}
message RequestEcho {
string message = 1;
}
message RequestFlush {}
message RequestInfo {
string version = 1;
uint64 block_version = 2;
uint64 p2p_version = 3;
}
// nondeterministic
message RequestSetOption {
string key = 1;
string value = 2;
}
message RequestInitChain {
google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
string chain_id = 2;
ConsensusParams consensus_params = 3;
repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false];
bytes app_state_bytes = 5;
}
message RequestQuery {
bytes data = 1;
string path = 2;
int64 height = 3;
bool prove = 4;
}
message RequestBeginBlock {
bytes hash = 1;
Header header = 2 [(gogoproto.nullable) = false];
LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false];
repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false];
}
enum CheckTxType {
New = 0;
Recheck = 1;
}
message RequestCheckTx {
bytes tx = 1;
CheckTxType type = 2;
}
message RequestDeliverTx {
bytes tx = 1;
}
message RequestEndBlock {
int64 height = 1;
}
message RequestCommit {}
//----------------------------------------
// Response types
message Response {
oneof value {
ResponseException exception = 1;
ResponseEcho echo = 2;
ResponseFlush flush = 3;
ResponseInfo info = 4;
ResponseSetOption set_option = 5;
ResponseInitChain init_chain = 6;
ResponseQuery query = 7;
ResponseBeginBlock begin_block = 8;
ResponseCheckTx check_tx = 9;
ResponseDeliverTx deliver_tx = 10;
ResponseEndBlock end_block = 11;
ResponseCommit commit = 12;
}
}
// nondeterministic
message ResponseException {
string error = 1;
}
message ResponseEcho {
string message = 1;
}
message ResponseFlush {}
message ResponseInfo {
string data = 1;
string version = 2;
uint64 app_version = 3;
int64 last_block_height = 4;
bytes last_block_app_hash = 5;
}
// nondeterministic
message ResponseSetOption {
uint32 code = 1;
// bytes data = 2;
string log = 3;
string info = 4;
}
message ResponseInitChain {
ConsensusParams consensus_params = 1;
repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false];
}
message ResponseQuery {
uint32 code = 1;
// bytes data = 2; // use "value" instead.
string log = 3; // nondeterministic
string info = 4; // nondeterministic
int64 index = 5;
bytes key = 6;
bytes value = 7;
tendermint.crypto.merkle.Proof proof = 8;
int64 height = 9;
string codespace = 10;
}
message ResponseBeginBlock {
repeated Event events = 1
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
}
message ResponseCheckTx {
uint32 code = 1;
bytes data = 2;
string log = 3; // nondeterministic
string info = 4; // nondeterministic
int64 gas_wanted = 5;
int64 gas_used = 6;
repeated Event events = 7
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
string codespace = 8;
}
message ResponseDeliverTx {
uint32 code = 1;
bytes data = 2;
string log = 3; // nondeterministic
string info = 4; // nondeterministic
int64 gas_wanted = 5;
int64 gas_used = 6;
repeated Event events = 7
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
string codespace = 8;
}
message ResponseEndBlock {
repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false];
ConsensusParams consensus_param_updates = 2;
repeated Event events = 3
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"];
}
message ResponseCommit {
// reserve 1
bytes data = 2;
}
//----------------------------------------
// Misc.
// ConsensusParams contains all consensus-relevant parameters
// that can be adjusted by the abci app
message ConsensusParams {
BlockParams block = 1;
EvidenceParams evidence = 2;
ValidatorParams validator = 3;
}
// BlockParams contains limits on the block size.
message BlockParams {
// Note: must be greater than 0
int64 max_bytes = 1;
// Note: must be greater or equal to -1
int64 max_gas = 2;
}
message EvidenceParams {
// Note: must be greater than 0
int64 max_age_num_blocks = 1;
google.protobuf.Duration max_age_duration = 2
[(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
}
// ValidatorParams contains limits on validators.
message ValidatorParams {
repeated string pub_key_types = 1;
}
message LastCommitInfo {
int32 round = 1;
repeated VoteInfo votes = 2 [(gogoproto.nullable) = false];
}
message Event {
string type = 1;
repeated tendermint.libs.kv.Pair attributes = 2
[(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"];
}
//----------------------------------------
// Blockchain Types
message Header {
// basic block info
Version version = 1 [(gogoproto.nullable) = false];
string chain_id = 2 [(gogoproto.customname) = "ChainID"];
int64 height = 3;
google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
// prev block info
BlockID last_block_id = 5 [(gogoproto.nullable) = false];
// hashes of block data
bytes last_commit_hash = 6; // commit from validators from the last block
bytes data_hash = 7; // transactions
// hashes from the app output from the prev block
bytes validators_hash = 8; // validators for the current block
bytes next_validators_hash = 9; // validators for the next block
bytes consensus_hash = 10; // consensus params for current block
bytes app_hash = 11; // state after txs from the previous block
bytes last_results_hash = 12; // root hash of all results from the txs from the previous block
// consensus info
bytes evidence_hash = 13; // evidence included in the block
bytes proposer_address = 14; // original proposer of the block
}
message Version {
uint64 Block = 1;
uint64 App = 2;
}
message BlockID {
bytes hash = 1;
PartSetHeader parts_header = 2 [(gogoproto.nullable) = false];
}
message PartSetHeader {
int32 total = 1;
bytes hash = 2;
}
// Validator
message Validator {
bytes address = 1;
// PubKey pub_key = 2 [(gogoproto.nullable)=false];
int64 power = 3;
}
// ValidatorUpdate
message ValidatorUpdate {
PubKey pub_key = 1 [(gogoproto.nullable) = false];
int64 power = 2;
}
// VoteInfo
message VoteInfo {
Validator validator = 1 [(gogoproto.nullable) = false];
bool signed_last_block = 2;
}
message PubKey {
string type = 1;
bytes data = 2;
}
message Evidence {
string type = 1;
Validator validator = 2 [(gogoproto.nullable) = false];
int64 height = 3;
google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
int64 total_voting_power = 5;
}
//----------------------------------------
// Service Definition
service ABCIApplication {
rpc Echo(RequestEcho) returns (ResponseEcho);
rpc Flush(RequestFlush) returns (ResponseFlush);
rpc Info(RequestInfo) returns (ResponseInfo);
rpc SetOption(RequestSetOption) returns (ResponseSetOption);
rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx);
rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx);
rpc Query(RequestQuery) returns (ResponseQuery);
rpc Commit(RequestCommit) returns (ResponseCommit);
rpc InitChain(RequestInitChain) returns (ResponseInitChain);
rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock);
rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock);
}

View File

@ -0,0 +1,24 @@
syntax = "proto3";
package tendermint.crypto;
option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto";
import "gogoproto/gogo.proto";
// PublicKey defines the keys available for use with Tendermint Validators
message PublicKey {
option (gogoproto.compare) = true;
option (gogoproto.equal) = true;
oneof sum {
bytes ed25519 = 1;
}
}
// PrivateKey defines the keys available for use with Tendermint Validators
// WARNING PrivateKey is used for internal purposes only
message PrivateKey {
oneof sum {
bytes ed25519 = 1;
}
}

View File

@ -1,31 +0,0 @@
syntax = "proto3";
package tendermint.crypto.merkle;
option go_package = "github.com/tendermint/tendermint/crypto/merkle";
// For more information on gogo.proto, see:
// https://github.com/gogo/protobuf/blob/master/extensions.md
import "gogoproto/gogo.proto";
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.equal_all) = true;
//----------------------------------------
// Message types
// ProofOp defines an operation used for calculating Merkle root
// The data could be arbitrary format, providing nessecary data
// for example neighbouring node hash
message ProofOp {
string type = 1;
bytes key = 2;
bytes data = 3;
}
// Proof is Merkle proof defined by the list of ProofOps
message Proof {
repeated ProofOp ops = 1 [(gogoproto.nullable) = false];
}

View File

@ -0,0 +1,41 @@
syntax = "proto3";
package tendermint.crypto;
option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto";
import "gogoproto/gogo.proto";
message Proof {
int64 total = 1;
int64 index = 2;
bytes leaf_hash = 3;
repeated bytes aunts = 4;
}
message ValueOp {
// Encoded in ProofOp.Key.
bytes key = 1;
// To encode in ProofOp.Data
Proof proof = 2;
}
message DominoOp {
string key = 1;
string input = 2;
string output = 3;
}
// ProofOp defines an operation used for calculating Merkle root
// The data could be arbitrary format, providing nessecary data
// for example neighbouring node hash
message ProofOp {
string type = 1;
bytes key = 2;
bytes data = 3;
}
// ProofOps is Merkle proof defined by the list of ProofOps
message ProofOps {
repeated ProofOp ops = 1 [(gogoproto.nullable) = false];
}

View File

@ -0,0 +1,9 @@
syntax = "proto3";
package tendermint.libs.bits;
option go_package = "github.com/tendermint/tendermint/proto/tendermint/libs/bits";
message BitArray {
int64 bits = 1;
repeated uint64 elems = 2;
}

View File

@ -1,29 +0,0 @@
syntax = "proto3";
package tendermint.libs.kv;
option go_package = "github.com/tendermint/tendermint/libs/kv";
import "gogoproto/gogo.proto";
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.goproto_registration) = true;
// Generate tests
option (gogoproto.populate_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.testgen_all) = true;
//----------------------------------------
// Abstract types
// Define these here for compatibility but use tmlibs/kv.Pair.
message Pair {
bytes key = 1;
bytes value = 2;
}
// Define these here for compatibility but use tmlibs/kv.KI64Pair.
message KI64Pair {
bytes key = 1;
int64 value = 2;
}

View File

@ -0,0 +1,68 @@
syntax = "proto3";
package tendermint.types;
option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "tendermint/types/types.proto";
import "tendermint/crypto/keys.proto";
// DuplicateVoteEvidence contains evidence a validator signed two conflicting
// votes.
message DuplicateVoteEvidence {
Vote vote_a = 1;
Vote vote_b = 2;
google.protobuf.Timestamp timestamp = 3
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}
message PotentialAmnesiaEvidence {
Vote vote_a = 1;
Vote vote_b = 2;
int64 height_stamp = 3;
google.protobuf.Timestamp timestamp = 4
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}
message AmnesiaEvidence {
PotentialAmnesiaEvidence potential_amnesia_evidence = 1;
ProofOfLockChange polc = 2;
}
message ConflictingHeadersEvidence {
SignedHeader h1 = 1;
SignedHeader h2 = 2;
}
message LunaticValidatorEvidence {
Header header = 1;
Vote vote = 2;
string invalid_header_field = 3;
google.protobuf.Timestamp timestamp = 4
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}
message Evidence {
oneof sum {
DuplicateVoteEvidence duplicate_vote_evidence = 1;
ConflictingHeadersEvidence conflicting_headers_evidence = 2;
LunaticValidatorEvidence lunatic_validator_evidence = 3;
PotentialAmnesiaEvidence potential_amnesia_evidence = 4;
AmnesiaEvidence amnesia_evidence = 5;
}
}
// EvidenceData contains any evidence of malicious wrong-doing by validators
message EvidenceData {
repeated Evidence evidence = 1 [(gogoproto.nullable) = false];
bytes hash = 2;
}
message ProofOfLockChange {
repeated Vote votes = 1;
tendermint.crypto.PublicKey pub_key = 2;
}

View File

@ -0,0 +1,86 @@
syntax = "proto3";
package tendermint.types;
option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
option (gogoproto.equal_all) = true;
// ConsensusParams contains consensus critical parameters that determine the
// validity of blocks.
message ConsensusParams {
BlockParams block = 1 [(gogoproto.nullable) = false];
EvidenceParams evidence = 2 [(gogoproto.nullable) = false];
ValidatorParams validator = 3 [(gogoproto.nullable) = false];
VersionParams version = 4 [(gogoproto.nullable) = false];
}
// BlockParams contains limits on the block size.
message BlockParams {
// Max block size, in bytes.
// Note: must be greater than 0
int64 max_bytes = 1;
// Max gas per block.
// Note: must be greater or equal to -1
int64 max_gas = 2;
// Minimum time increment between consecutive blocks (in milliseconds) If the
// block header timestamp is ahead of the system clock, decrease this value.
//
// Not exposed to the application.
int64 time_iota_ms = 3;
}
// EvidenceParams determine how we handle evidence of malfeasance.
message EvidenceParams {
// Max age of evidence, in blocks.
//
// The basic formula for calculating this is: MaxAgeDuration / {average block
// time}.
int64 max_age_num_blocks = 1;
// Max age of evidence, in time.
//
// It should correspond with an app's "unbonding period" or other similar
// mechanism for handling [Nothing-At-Stake
// attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed).
google.protobuf.Duration max_age_duration = 2
[(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
// This sets the maximum number of evidence that can be committed in a single block.
// and should fall comfortably under the max block bytes when we consider the size of
// each evidence (See MaxEvidenceBytes). The maximum number is MaxEvidencePerBlock.
// Default is 50
uint32 max_num = 3;
// Proof trial period dictates the time given for nodes accused of amnesia evidence, incorrectly
// voting twice in two different rounds to respond with their respective proofs.
// Default is half the max age in blocks: 50,000
int64 proof_trial_period = 4;
}
// ValidatorParams restrict the public key types validators can use.
// NOTE: uses ABCI pubkey naming, not Amino names.
message ValidatorParams {
option (gogoproto.populate) = true;
option (gogoproto.equal) = true;
repeated string pub_key_types = 1;
}
// VersionParams contains the ABCI application version.
message VersionParams {
option (gogoproto.populate) = true;
option (gogoproto.equal) = true;
uint64 app_version = 1;
}
// HashedParams is a subset of ConsensusParams.
//
// It is hashed into the Header.ConsensusHash.
message HashedParams {
int64 block_max_bytes = 1;
int64 block_max_gas = 2;
}

View File

@ -0,0 +1,156 @@
syntax = "proto3";
package tendermint.types;
option go_package = "github.com/tendermint/tendermint/proto/tendermint/types";
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "tendermint/libs/bits/types.proto";
import "tendermint/crypto/proof.proto";
import "tendermint/version/types.proto";
// BlockIdFlag indicates which BlcokID the signature is for
enum BlockIDFlag {
option (gogoproto.goproto_enum_stringer) = true;
option (gogoproto.goproto_enum_prefix) = false;
BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"];
BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"];
BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"];
BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"];
}
// SignedMsgType is a type of signed message in the consensus.
enum SignedMsgType {
option (gogoproto.goproto_enum_stringer) = true;
option (gogoproto.goproto_enum_prefix) = false;
SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"];
// Votes
SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"];
SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"];
// Proposals
SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"];
}
// PartsetHeader
message PartSetHeader {
uint32 total = 1;
bytes hash = 2;
}
message Part {
uint32 index = 1;
bytes bytes = 2;
tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false];
}
// BlockID
message BlockID {
bytes hash = 1;
PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false];
}
// --------------------------------
// Header defines the structure of a Tendermint block header.
message Header {
// basic block info
tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false];
string chain_id = 2 [(gogoproto.customname) = "ChainID"];
int64 height = 3;
google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
// prev block info
BlockID last_block_id = 5 [(gogoproto.nullable) = false];
// hashes of block data
bytes last_commit_hash = 6; // commit from validators from the last block
bytes data_hash = 7; // transactions
// hashes from the app output from the prev block
bytes validators_hash = 8; // validators for the current block
bytes next_validators_hash = 9; // validators for the next block
bytes consensus_hash = 10; // consensus params for current block
bytes app_hash = 11; // state after txs from the previous block
bytes last_results_hash = 12; // root hash of all results from the txs from the previous block
// consensus info
bytes evidence_hash = 13; // evidence included in the block
bytes proposer_address = 14; // original proposer of the block
}
// Data contains the set of transactions included in the block
message Data {
// Txs that will be applied by state @ block.Height+1.
// NOTE: not all txs here are valid. We're just agreeing on the order first.
// This means that block.AppHash does not include these txs.
repeated bytes txs = 1;
// Volatile
bytes hash = 2;
}
// Vote represents a prevote, precommit, or commit vote from validators for
// consensus.
message Vote {
SignedMsgType type = 1;
int64 height = 2;
int32 round = 3;
BlockID block_id = 4
[(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil.
google.protobuf.Timestamp timestamp = 5
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
bytes validator_address = 6;
int32 validator_index = 7;
bytes signature = 8;
}
// Commit contains the evidence that a block was committed by a set of validators.
message Commit {
int64 height = 1;
int32 round = 2;
BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"];
repeated CommitSig signatures = 4 [(gogoproto.nullable) = false];
bytes hash = 5;
tendermint.libs.bits.BitArray bit_array = 6;
}
// CommitSig is a part of the Vote included in a Commit.
message CommitSig {
BlockIDFlag block_id_flag = 1;
bytes validator_address = 2;
google.protobuf.Timestamp timestamp = 3
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
bytes signature = 4;
}
message Proposal {
SignedMsgType type = 1;
int64 height = 2;
int32 round = 3;
int32 pol_round = 4;
BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
google.protobuf.Timestamp timestamp = 6
[(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
bytes signature = 7;
}
message SignedHeader {
Header header = 1;
Commit commit = 2;
}
message BlockMeta {
BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false];
int64 block_size = 2;
Header header = 3 [(gogoproto.nullable) = false];
int64 num_txs = 4;
}
// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
message TxProof {
bytes root_hash = 1;
bytes data = 2;
tendermint.crypto.Proof proof = 3;
}

View File

@ -0,0 +1,24 @@
syntax = "proto3";
package tendermint.version;
option go_package = "github.com/tendermint/tendermint/proto/tendermint/version";
import "gogoproto/gogo.proto";
// App includes the protocol and software version for the application.
// This information is included in ResponseInfo. The App.Protocol can be
// updated in ResponseEndBlock.
message App {
uint64 protocol = 1;
string software = 2;
}
// Consensus captures the consensus rules for processing a block in the blockchain,
// including all blockchain data structures and the rules of the application's
// state transition machine.
message Consensus {
option (gogoproto.equal) = true;
uint64 block = 1;
uint64 app = 2;
}

View File

@ -515,57 +515,57 @@ func init() {
}
var fileDescriptor_4e37629bc7eb0df8 = []byte{
// 787 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xbd, 0x4e, 0x1b, 0x4b,
0x14, 0xf6, 0xda, 0x66, 0xed, 0x1d, 0xc3, 0xe5, 0xde, 0xb9, 0x4e, 0x58, 0x08, 0xb1, 0xcd, 0x92,
0x48, 0x6e, 0xb2, 0x16, 0x90, 0x48, 0x91, 0x8b, 0x28, 0x6c, 0xfe, 0xb0, 0x04, 0xcd, 0x62, 0x14,
0x29, 0x8d, 0x35, 0xf6, 0x0e, 0xe3, 0x15, 0xde, 0x1d, 0x6b, 0x67, 0x0c, 0x76, 0x97, 0x32, 0x65,
0x2a, 0x8a, 0x54, 0xa9, 0xf3, 0x24, 0x94, 0x94, 0x14, 0x91, 0x93, 0x98, 0x37, 0xe0, 0x09, 0xa2,
0x99, 0x59, 0xff, 0x90, 0xc8, 0x34, 0xf6, 0x99, 0xf3, 0x37, 0xe7, 0x7c, 0xdf, 0x37, 0x0b, 0x36,
0x5b, 0x94, 0x05, 0x94, 0x55, 0x9a, 0x88, 0xe1, 0x0a, 0x6a, 0xb6, 0xfc, 0xca, 0xe9, 0x56, 0x13,
0x73, 0xb4, 0x25, 0x0f, 0x76, 0x37, 0xa2, 0x9c, 0x42, 0x53, 0x25, 0xd9, 0x22, 0xc9, 0x96, 0xfe,
0x38, 0x69, 0x6d, 0x83, 0xe3, 0xd0, 0xc3, 0x51, 0xe0, 0x87, 0x5c, 0x55, 0xf3, 0x41, 0x17, 0x33,
0xf5, 0xab, 0x8a, 0xd7, 0xf2, 0x84, 0x12, 0x2a, 0xcd, 0x8a, 0xb0, 0x62, 0xef, 0x2a, 0xa1, 0x94,
0x74, 0x70, 0x45, 0x9e, 0x9a, 0xbd, 0xe3, 0x0a, 0x0a, 0x07, 0x2a, 0x64, 0x9d, 0xa7, 0x00, 0xa8,
0xf7, 0x5d, 0xcc, 0xba, 0x34, 0x64, 0x18, 0xde, 0x07, 0x7a, 0x1b, 0xfb, 0xa4, 0xcd, 0x4d, 0xad,
0xa4, 0x95, 0x53, 0x6e, 0x7c, 0x82, 0x16, 0xd0, 0x79, 0xbf, 0x8d, 0x58, 0xdb, 0x4c, 0x96, 0xb4,
0xb2, 0xe1, 0x80, 0xd1, 0xb0, 0xa8, 0xd7, 0xfb, 0x7b, 0x88, 0xb5, 0xdd, 0x38, 0x02, 0xd7, 0x81,
0xd1, 0xa2, 0x1e, 0x66, 0x5d, 0xd4, 0xc2, 0x66, 0x4a, 0xa4, 0xb9, 0x53, 0x07, 0x84, 0x20, 0x2d,
0x0e, 0x66, 0xba, 0xa4, 0x95, 0x97, 0x5c, 0x69, 0x0b, 0x9f, 0x87, 0x38, 0x32, 0x17, 0x64, 0xb2,
0xb4, 0xe1, 0x0a, 0xc8, 0x44, 0xe8, 0xac, 0xd1, 0xa1, 0xc4, 0xd4, 0xa5, 0x5b, 0x8f, 0xd0, 0xd9,
0x3e, 0x25, 0xf0, 0x08, 0xa4, 0x3b, 0x94, 0x30, 0x33, 0x53, 0x4a, 0x95, 0x73, 0xdb, 0x65, 0x7b,
0x1e, 0x4c, 0xf6, 0xae, 0xf3, 0xaa, 0x76, 0x80, 0x19, 0x43, 0x04, 0xef, 0x53, 0xe2, 0xac, 0x5c,
0x0c, 0x8b, 0x89, 0x6f, 0x3f, 0x8a, 0xcb, 0xb7, 0xfd, 0xcc, 0x95, 0xed, 0xc4, 0x0c, 0x7e, 0x78,
0x4c, 0xcd, 0xac, 0x9a, 0x41, 0xd8, 0xf0, 0x21, 0x00, 0x04, 0xb1, 0xc6, 0x19, 0x0a, 0x39, 0xf6,
0x4c, 0x43, 0x22, 0x61, 0x10, 0xc4, 0xde, 0x4b, 0x07, 0x5c, 0x05, 0x59, 0x11, 0xee, 0x31, 0xec,
0x99, 0x40, 0x06, 0x33, 0x04, 0xb1, 0x23, 0x86, 0x3d, 0xf8, 0x08, 0x24, 0x79, 0xdf, 0xcc, 0x95,
0xb4, 0x72, 0x6e, 0x3b, 0x6f, 0x2b, 0xd8, 0xed, 0x31, 0xec, 0xf6, 0x6e, 0x38, 0x70, 0x93, 0xbc,
0x2f, 0x90, 0xe2, 0x7e, 0x80, 0x19, 0x47, 0x41, 0xd7, 0x5c, 0x54, 0x48, 0x4d, 0x1c, 0xd5, 0xf4,
0xa7, 0xaf, 0xc5, 0x84, 0xf5, 0x45, 0x03, 0xff, 0xdc, 0x9e, 0x18, 0x3e, 0x00, 0x46, 0xc0, 0x48,
0xc3, 0x0f, 0x3d, 0xdc, 0x97, 0xfc, 0x2c, 0xb9, 0xd9, 0x80, 0x91, 0x9a, 0x38, 0xc3, 0x7f, 0x41,
0x4a, 0x60, 0x26, 0xe9, 0x71, 0x85, 0x09, 0x0f, 0x81, 0x8e, 0x4f, 0x71, 0xc8, 0x99, 0x99, 0x92,
0x90, 0x3d, 0x9e, 0x0f, 0xd9, 0x21, 0x8f, 0xfc, 0x90, 0xbc, 0x11, 0xd9, 0x4e, 0x3e, 0xc6, 0x6b,
0x71, 0xc6, 0xc9, 0xdc, 0xb8, 0x55, 0x35, 0xfd, 0xf1, 0x7b, 0x49, 0xb3, 0x22, 0x90, 0x9b, 0x89,
0x0a, 0x0c, 0x85, 0x08, 0xe5, 0x4c, 0x86, 0x2b, 0x6d, 0x58, 0x03, 0x00, 0x71, 0x1e, 0xf9, 0xcd,
0x1e, 0xc7, 0xcc, 0x4c, 0xca, 0x09, 0x36, 0xef, 0x20, 0x6d, 0x9c, 0xeb, 0xa4, 0xc5, 0xfd, 0xee,
0x4c, 0x71, 0x7c, 0xe7, 0x0e, 0x30, 0x26, 0x49, 0x62, 0xdb, 0x13, 0x3c, 0x88, 0x2f, 0x14, 0x26,
0xcc, 0x83, 0x85, 0x53, 0xd4, 0xe9, 0xe1, 0x18, 0x01, 0x75, 0xb0, 0x28, 0xc8, 0xbc, 0x43, 0xac,
0x26, 0x48, 0x7d, 0x7a, 0x8b, 0x54, 0x51, 0x99, 0x76, 0xee, 0xdd, 0x0c, 0x8b, 0xff, 0x0d, 0x50,
0xd0, 0xa9, 0x5a, 0xd3, 0x98, 0x35, 0xcb, 0xb5, 0x3d, 0xc3, 0x75, 0x52, 0xd6, 0xfc, 0x7f, 0x33,
0x2c, 0x2e, 0x4f, 0x6b, 0x44, 0xc4, 0x9a, 0x08, 0xc0, 0xea, 0x02, 0xdd, 0xc5, 0xac, 0xd7, 0xe1,
0x13, 0x71, 0x8b, 0x9b, 0x16, 0x63, 0x71, 0xff, 0x4d, 0x52, 0xf5, 0x0f, 0x92, 0xd6, 0xed, 0xe9,
0x23, 0x57, 0x08, 0xa9, 0xe7, 0xad, 0xb8, 0x51, 0xd8, 0x4c, 0xb8, 0x90, 0x42, 0x39, 0xd7, 0x00,
0x3c, 0xf4, 0x83, 0x5e, 0x07, 0x71, 0x9f, 0x86, 0x93, 0x97, 0xfc, 0x56, 0x0d, 0x2e, 0xb5, 0xad,
0x49, 0x3d, 0x6e, 0xcc, 0x47, 0x3f, 0xc6, 0xc8, 0xc9, 0x8a, 0xfe, 0x97, 0xc3, 0xa2, 0x26, 0x17,
0x92, 0xb0, 0x3d, 0x07, 0x7a, 0x24, 0x17, 0x92, 0x53, 0xe7, 0xb6, 0x4b, 0xf3, 0xbb, 0xa8, 0xc5,
0xdd, 0x38, 0xdf, 0x7a, 0x01, 0x32, 0x07, 0x8c, 0xbc, 0x16, 0x7b, 0xaf, 0x02, 0x21, 0xd4, 0xc6,
0x8c, 0x48, 0x32, 0x01, 0x23, 0x75, 0xa1, 0x93, 0x31, 0x4c, 0xc9, 0x29, 0x4c, 0x31, 0xe1, 0x7b,
0xc0, 0xa8, 0xf7, 0xc7, 0x1d, 0x9e, 0x4d, 0xd0, 0x4c, 0xdd, 0xbd, 0x4a, 0x5c, 0x30, 0xdb, 0xc9,
0x79, 0x79, 0xf5, 0xab, 0x90, 0xb8, 0x18, 0x15, 0xb4, 0xcb, 0x51, 0x41, 0xfb, 0x39, 0x2a, 0x68,
0x9f, 0xaf, 0x0b, 0x89, 0xcb, 0xeb, 0x42, 0xe2, 0xea, 0xba, 0x90, 0xf8, 0x60, 0x11, 0x9f, 0xb7,
0x7b, 0x4d, 0xbb, 0x45, 0x83, 0x4a, 0xfc, 0x81, 0x56, 0x7f, 0x4f, 0x98, 0x77, 0xa2, 0xbe, 0xae,
0x4d, 0x5d, 0xbe, 0xe1, 0x9d, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xbb, 0x16, 0xe4, 0xc2,
0x05, 0x00, 0x00,
// 786 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0x4b, 0x6f, 0xdb, 0x46,
0x10, 0x16, 0x25, 0x99, 0x12, 0x47, 0x76, 0xdd, 0x6e, 0x55, 0x9b, 0xb6, 0x5b, 0x49, 0xa5, 0x5b,
0x40, 0x97, 0x52, 0xf0, 0xa3, 0x40, 0xe1, 0x43, 0x51, 0xb3, 0x2f, 0x0b, 0xb0, 0x2f, 0xb4, 0x8c,
0x00, 0xb9, 0x08, 0x2b, 0x71, 0xbd, 0x62, 0x2c, 0x72, 0x05, 0xee, 0xca, 0x96, 0x6e, 0x39, 0xe6,
0x98, 0x93, 0x0f, 0x39, 0xe5, 0x9c, 0x5f, 0xe2, 0xa3, 0x8f, 0x3e, 0x04, 0x4a, 0x22, 0xff, 0x03,
0xff, 0x82, 0x60, 0x97, 0xd4, 0xc3, 0x09, 0xe4, 0x13, 0xe7, 0xf1, 0xed, 0xec, 0xcc, 0xf7, 0xcd,
0x12, 0xb6, 0xdb, 0x8c, 0x07, 0x8c, 0xd7, 0x5a, 0x98, 0x93, 0x1a, 0x6e, 0xb5, 0xfd, 0xda, 0xe5,
0x4e, 0x8b, 0x08, 0xbc, 0xa3, 0x1c, 0xbb, 0x17, 0x31, 0xc1, 0x90, 0x19, 0x83, 0x6c, 0x09, 0xb2,
0x55, 0x3c, 0x01, 0x6d, 0x16, 0x29, 0xa3, 0x4c, 0x81, 0x6a, 0xd2, 0x8a, 0xf1, 0x9b, 0x5b, 0x82,
0x84, 0x1e, 0x89, 0x02, 0x3f, 0x14, 0x71, 0x4d, 0x31, 0xec, 0x11, 0x9e, 0x24, 0x37, 0x28, 0x63,
0xb4, 0x4b, 0x6a, 0xca, 0x6b, 0xf5, 0xcf, 0x6b, 0x38, 0x1c, 0xc6, 0x29, 0xeb, 0x3a, 0x03, 0xd0,
0x18, 0xb8, 0x84, 0xf7, 0x58, 0xc8, 0x09, 0x5a, 0x03, 0xbd, 0x43, 0x7c, 0xda, 0x11, 0xa6, 0x56,
0xd1, 0xaa, 0x19, 0x37, 0xf1, 0x90, 0x05, 0xba, 0x18, 0x74, 0x30, 0xef, 0x98, 0xe9, 0x8a, 0x56,
0x35, 0x1c, 0x18, 0x8f, 0xca, 0x7a, 0x63, 0x70, 0x84, 0x79, 0xc7, 0x4d, 0x32, 0xe8, 0x47, 0x30,
0xda, 0xcc, 0x23, 0xbc, 0x87, 0xdb, 0xc4, 0xcc, 0x48, 0x98, 0x3b, 0x0b, 0x20, 0x04, 0x59, 0xe9,
0x98, 0xd9, 0x8a, 0x56, 0x5d, 0x71, 0x95, 0x2d, 0x63, 0x1e, 0x16, 0xd8, 0x5c, 0x52, 0x60, 0x65,
0xa3, 0x75, 0xc8, 0x45, 0xf8, 0xaa, 0xd9, 0x65, 0xd4, 0xd4, 0x55, 0x58, 0x8f, 0xf0, 0xd5, 0x31,
0xa3, 0xe8, 0x0c, 0xb2, 0x5d, 0x46, 0xb9, 0x99, 0xab, 0x64, 0xaa, 0x85, 0xdd, 0xaa, 0xbd, 0x88,
0x20, 0xfb, 0xd0, 0xf9, 0xbb, 0x7e, 0x42, 0x38, 0xc7, 0x94, 0x1c, 0x33, 0xea, 0xac, 0xdf, 0x8c,
0xca, 0xa9, 0x77, 0x1f, 0xca, 0xab, 0x8f, 0xe3, 0xdc, 0x55, 0xe5, 0x64, 0x0f, 0x7e, 0x78, 0xce,
0xcc, 0x7c, 0xdc, 0x83, 0xb4, 0xd1, 0x4f, 0x00, 0x14, 0xf3, 0xe6, 0x15, 0x0e, 0x05, 0xf1, 0x4c,
0x43, 0x31, 0x61, 0x50, 0xcc, 0x9f, 0xa9, 0x00, 0xda, 0x80, 0xbc, 0x4c, 0xf7, 0x39, 0xf1, 0x4c,
0x50, 0xc9, 0x1c, 0xc5, 0xfc, 0x8c, 0x13, 0x0f, 0xfd, 0x02, 0x69, 0x31, 0x30, 0x0b, 0x15, 0xad,
0x5a, 0xd8, 0x2d, 0xda, 0x31, 0xed, 0xf6, 0x84, 0x76, 0xfb, 0x30, 0x1c, 0xba, 0x69, 0x31, 0x90,
0x4c, 0x09, 0x3f, 0x20, 0x5c, 0xe0, 0xa0, 0x67, 0x2e, 0xc7, 0x4c, 0x4d, 0x03, 0x07, 0xd9, 0x57,
0x6f, 0xcb, 0x29, 0xeb, 0x8d, 0x06, 0xdf, 0x3c, 0xee, 0x18, 0x6d, 0x81, 0x11, 0x70, 0xda, 0xf4,
0x43, 0x8f, 0x0c, 0x94, 0x3e, 0x2b, 0x6e, 0x3e, 0xe0, 0xb4, 0x2e, 0x7d, 0xf4, 0x2d, 0x64, 0x24,
0x67, 0x4a, 0x1e, 0x57, 0x9a, 0xe8, 0x14, 0x74, 0x72, 0x49, 0x42, 0xc1, 0xcd, 0x8c, 0xa2, 0xec,
0xd7, 0xc5, 0x94, 0x9d, 0x8a, 0xc8, 0x0f, 0xe9, 0xbf, 0x12, 0xed, 0x14, 0x13, 0xbe, 0x96, 0xe7,
0x82, 0xdc, 0x4d, 0x4a, 0x1d, 0x64, 0x5f, 0xbe, 0xaf, 0x68, 0x56, 0x04, 0x85, 0xb9, 0xac, 0xe4,
0x50, 0xae, 0x9b, 0xea, 0xc9, 0x70, 0x95, 0x8d, 0xea, 0x00, 0x58, 0x88, 0xc8, 0x6f, 0xf5, 0x05,
0xe1, 0x66, 0x5a, 0x75, 0xb0, 0xfd, 0x84, 0x68, 0x13, 0xac, 0x93, 0x95, 0xf7, 0xbb, 0x73, 0x87,
0x93, 0x3b, 0xf7, 0xc0, 0x98, 0x82, 0xe4, 0xb4, 0x17, 0x64, 0x98, 0x5c, 0x28, 0x4d, 0x54, 0x84,
0xa5, 0x4b, 0xdc, 0xed, 0x93, 0x84, 0x81, 0xd8, 0xb1, 0x18, 0xe4, 0xfe, 0xc7, 0xbc, 0x2e, 0x45,
0xdd, 0x7f, 0x24, 0xaa, 0x3c, 0x99, 0x75, 0x7e, 0x78, 0x18, 0x95, 0xbf, 0x1b, 0xe2, 0xa0, 0x7b,
0x60, 0xcd, 0x72, 0xd6, 0xbc, 0xd6, 0xf6, 0x9c, 0xd6, 0x69, 0x75, 0xe6, 0xfb, 0x87, 0x51, 0x79,
0x75, 0x76, 0x46, 0x66, 0xac, 0xe9, 0x02, 0x58, 0x2f, 0x40, 0x77, 0x09, 0xef, 0x77, 0xc5, 0x74,
0xb9, 0xe5, 0x4d, 0xcb, 0xc9, 0x72, 0x7f, 0x2d, 0xd2, 0xfe, 0x17, 0x22, 0xad, 0xd9, 0xb3, 0x87,
0x1c, 0x33, 0x14, 0xab, 0x12, 0xb3, 0x32, 0x55, 0x41, 0xad, 0xc8, 0xb5, 0x06, 0xe8, 0xd4, 0x0f,
0xfa, 0x5d, 0x2c, 0x7c, 0x16, 0x4e, 0xdf, 0xf0, 0x7f, 0x71, 0xcb, 0x6a, 0xab, 0x35, 0xb5, 0x89,
0x3f, 0x2f, 0xe6, 0x3d, 0x61, 0xc7, 0xc9, 0xcb, 0xfa, 0xb7, 0xa3, 0xb2, 0xa6, 0x46, 0x51, 0x84,
0xfd, 0x01, 0x7a, 0xa4, 0x46, 0x51, 0xfd, 0x16, 0x76, 0x2b, 0x8b, 0xab, 0xc4, 0x23, 0xbb, 0x09,
0xde, 0xfa, 0x13, 0x72, 0x27, 0x9c, 0xfe, 0x23, 0x27, 0xde, 0x00, 0xb9, 0xa2, 0xcd, 0xb9, 0xf5,
0xc8, 0x05, 0x9c, 0x36, 0xe4, 0x86, 0x4c, 0x08, 0x4a, 0xcf, 0x08, 0x4a, 0xa4, 0x3e, 0x02, 0xa3,
0x31, 0x98, 0x54, 0xf8, 0x7d, 0xca, 0x63, 0xe6, 0xe9, 0x51, 0x92, 0x03, 0xf3, 0x95, 0x9c, 0xbf,
0xee, 0x3e, 0x95, 0x52, 0x37, 0xe3, 0x92, 0x76, 0x3b, 0x2e, 0x69, 0x1f, 0xc7, 0x25, 0xed, 0xf5,
0x7d, 0x29, 0x75, 0x7b, 0x5f, 0x4a, 0xdd, 0xdd, 0x97, 0x52, 0xcf, 0x2d, 0xea, 0x8b, 0x4e, 0xbf,
0x65, 0xb7, 0x59, 0x50, 0x4b, 0x7e, 0xca, 0xf1, 0xe7, 0x37, 0xee, 0x5d, 0xc4, 0x7f, 0xd0, 0x96,
0xae, 0x5e, 0xef, 0xde, 0xe7, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x2c, 0x53, 0x4a, 0xb6, 0x05,
0x00, 0x00,
}
func (m *TxResponse) Marshal() (dAtA []byte, err error) {

View File

@ -11,7 +11,8 @@ import (
"github.com/tendermint/tendermint/crypto"
yaml "gopkg.in/yaml.v2"
tmamino "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/codec/legacy"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/types/bech32"
)
@ -625,7 +626,7 @@ func Bech32ifyPubKey(pkt Bech32PubKeyType, pubkey crypto.PubKey) (string, error)
}
return bech32.ConvertAndEncode(bech32Prefix, pubkey.Bytes())
return bech32.ConvertAndEncode(bech32Prefix, legacy.Cdc.MustMarshalBinaryBare(pubkey))
}
// MustBech32ifyPubKey calls Bech32ifyPubKey except it panics on error.
@ -660,7 +661,7 @@ func GetPubKeyFromBech32(pkt Bech32PubKeyType, pubkeyStr string) (crypto.PubKey,
return nil, err
}
pk, err := tmamino.PubKeyFromBytes(bz)
pk, err := cryptocodec.PubKeyFromBytes(bz)
if err != nil {
return nil, err
}

View File

@ -13,14 +13,14 @@ import (
)
func BenchmarkBech32ifyPubKey(b *testing.B) {
var pk ed25519.PubKeyEd25519
pk := make(ed25519.PubKey, ed25519.PubKeySize)
rng := rand.New(rand.NewSource(time.Now().Unix()))
b.ResetTimer()
for i := 0; i < b.N; i++ {
b.StopTimer()
rng.Read(pk[:])
rng.Read(pk)
b.StartTimer()
_, err := types.Bech32ifyPubKey(types.Bech32PubKeyTypeConsPub, pk)
@ -29,14 +29,14 @@ func BenchmarkBech32ifyPubKey(b *testing.B) {
}
func BenchmarkGetPubKeyFromBech32(b *testing.B) {
var pk ed25519.PubKeyEd25519
pk := make(ed25519.PubKey, ed25519.PubKeySize)
rng := rand.New(rand.NewSource(time.Now().Unix()))
b.ResetTimer()
for i := 0; i < b.N; i++ {
b.StopTimer()
rng.Read(pk[:])
rng.Read(pk)
pkStr, err := types.Bech32ifyPubKey(types.Bech32PubKeyTypeConsPub, pk)
require.NoError(b, err)

View File

@ -58,10 +58,10 @@ func TestEmptyAddresses(t *testing.T) {
}
func TestRandBech32PubkeyConsistency(t *testing.T) {
var pub ed25519.PubKeyEd25519
pub := make(ed25519.PubKey, ed25519.PubKeySize)
for i := 0; i < 1000; i++ {
rand.Read(pub[:])
rand.Read(pub)
mustBech32AccPub := types.MustBech32ifyPubKey(types.Bech32PubKeyTypeAccPub, pub)
bech32AccPub, err := types.Bech32ifyPubKey(types.Bech32PubKeyTypeAccPub, pub)
@ -116,10 +116,10 @@ func TestYAMLMarshalers(t *testing.T) {
}
func TestRandBech32AccAddrConsistency(t *testing.T) {
var pub ed25519.PubKeyEd25519
pub := make(ed25519.PubKey, ed25519.PubKeySize)
for i := 0; i < 1000; i++ {
rand.Read(pub[:])
rand.Read(pub)
acc := types.AccAddress(pub.Address())
res := types.AccAddress{}
@ -154,7 +154,7 @@ func TestRandBech32AccAddrConsistency(t *testing.T) {
}
func TestValAddr(t *testing.T) {
var pub ed25519.PubKeyEd25519
pub := make(ed25519.PubKey, ed25519.PubKeySize)
for i := 0; i < 20; i++ {
rand.Read(pub[:])
@ -194,7 +194,7 @@ func TestValAddr(t *testing.T) {
}
func TestConsAddress(t *testing.T) {
var pub ed25519.PubKeyEd25519
pub := make(ed25519.PubKey, ed25519.PubKeySize)
for i := 0; i < 20; i++ {
rand.Read(pub[:])
@ -243,7 +243,7 @@ func RandString(n int) string {
}
func TestConfiguredPrefix(t *testing.T) {
var pub ed25519.PubKeyEd25519
pub := make(ed25519.PubKey, ed25519.PubKeySize)
for length := 1; length < 10; length++ {
for times := 1; times < 20; times++ {
rand.Read(pub[:])
@ -298,8 +298,8 @@ func TestConfiguredPrefix(t *testing.T) {
}
func TestAddressInterface(t *testing.T) {
var pub ed25519.PubKeyEd25519
rand.Read(pub[:])
pub := make(ed25519.PubKey, ed25519.PubKeySize)
rand.Read(pub)
addrs := []types.Address{
types.ConsAddress(pub.Address()),

View File

@ -7,6 +7,7 @@ import (
"github.com/gogo/protobuf/proto"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/store/gaskv"
stypes "github.com/cosmos/cosmos-sdk/store/types"
@ -23,7 +24,7 @@ and standard additions here would be better just to add to the Context struct
type Context struct {
ctx context.Context
ms MultiStore
header abci.Header
header tmproto.Header
chainID string
txBytes []byte
logger log.Logger
@ -57,8 +58,8 @@ func (c Context) MinGasPrices() DecCoins { return c.minGasPrice }
func (c Context) EventManager() *EventManager { return c.eventManager }
// clone the header before returning
func (c Context) BlockHeader() abci.Header {
var msg = proto.Clone(&c.header).(*abci.Header)
func (c Context) BlockHeader() tmproto.Header {
var msg = proto.Clone(&c.header).(*tmproto.Header)
return *msg
}
@ -67,7 +68,7 @@ func (c Context) ConsensusParams() *abci.ConsensusParams {
}
// create a new context
func NewContext(ms MultiStore, header abci.Header, isCheckTx bool, logger log.Logger) Context {
func NewContext(ms MultiStore, header tmproto.Header, isCheckTx bool, logger log.Logger) Context {
// https://github.com/gogo/protobuf/issues/519
header.Time = header.Time.UTC()
return Context{
@ -96,7 +97,7 @@ func (c Context) WithMultiStore(ms MultiStore) Context {
}
// WithBlockHeader returns a Context with an updated tendermint block header in UTC time.
func (c Context) WithBlockHeader(header abci.Header) Context {
func (c Context) WithBlockHeader(header tmproto.Header) Context {
// https://github.com/gogo/protobuf/issues/519
header.Time = header.Time.UTC()
c.header = header

View File

@ -6,13 +6,11 @@ import (
"time"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/secp256k1"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/store"
"github.com/cosmos/cosmos-sdk/types"
@ -51,7 +49,7 @@ func defaultContext(t *testing.T, key types.StoreKey) types.Context {
cms.MountStoreWithDB(key, types.StoreTypeIAVL, db)
err := cms.LoadLatestVersion()
require.NoError(t, err)
ctx := types.NewContext(cms, abci.Header{}, false, log.NewNopLogger())
ctx := types.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger())
return ctx
}
@ -104,7 +102,7 @@ func TestContextWithCustom(t *testing.T) {
var ctx types.Context
require.True(t, ctx.IsZero())
header := abci.Header{}
header := tmproto.Header{}
height := int64(1)
chainid := "chainid"
ischeck := true
@ -164,7 +162,7 @@ func TestContextHeader(t *testing.T) {
addr := secp256k1.GenPrivKey().PubKey().Address()
proposer := types.ConsAddress(addr)
ctx = types.NewContext(nil, abci.Header{}, false, nil)
ctx = types.NewContext(nil, tmproto.Header{}, false, nil)
ctx = ctx.
WithBlockHeight(height).
@ -178,35 +176,35 @@ func TestContextHeader(t *testing.T) {
func TestContextHeaderClone(t *testing.T) {
cases := map[string]struct {
h abci.Header
h tmproto.Header
}{
"empty": {
h: abci.Header{},
h: tmproto.Header{},
},
"height": {
h: abci.Header{
h: tmproto.Header{
Height: 77,
},
},
"time": {
h: abci.Header{
h: tmproto.Header{
Time: time.Unix(12345677, 12345),
},
},
"zero time": {
h: abci.Header{
h: tmproto.Header{
Time: time.Unix(0, 0),
},
},
"many items": {
h: abci.Header{
h: tmproto.Header{
Height: 823,
Time: time.Unix(9999999999, 0),
ChainID: "silly-demo",
},
},
"many items with hash": {
h: abci.Header{
h: tmproto.Header{
Height: 823,
Time: time.Unix(9999999999, 0),
ChainID: "silly-demo",
@ -233,7 +231,7 @@ func TestContextHeaderClone(t *testing.T) {
}
func TestUnwrapSDKContext(t *testing.T) {
sdkCtx := types.NewContext(nil, abci.Header{}, false, nil)
sdkCtx := types.NewContext(nil, tmproto.Header{}, false, nil)
ctx := types.WrapSDKContext(sdkCtx)
sdkCtx2 := types.UnwrapSDKContext(ctx)
require.Equal(t, sdkCtx, sdkCtx2)

View File

@ -6,7 +6,6 @@ import (
"strings"
abci "github.com/tendermint/tendermint/abci/types"
tmkv "github.com/tendermint/tendermint/libs/kv"
)
// ----------------------------------------------------------------------------
@ -79,8 +78,8 @@ func (a Attribute) String() string {
}
// ToKVPair converts an Attribute object into a Tendermint key/value pair.
func (a Attribute) ToKVPair() tmkv.Pair {
return tmkv.Pair{Key: toBytes(a.Key), Value: toBytes(a.Value)}
func (a Attribute) ToKVPair() abci.EventAttribute {
return abci.EventAttribute{Key: toBytes(a.Key), Value: toBytes(a.Value)}
}
// AppendAttributes adds one or more attributes to an Event.

View File

@ -5,24 +5,21 @@ import (
"fmt"
"testing"
"github.com/stretchr/testify/require"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/store"
"github.com/cosmos/cosmos-sdk/store/prefix"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/query"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
dbm "github.com/tendermint/tm-db"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/query"
)
const (
@ -187,7 +184,7 @@ func ExamplePaginate() {
func setupTest() (*simapp.SimApp, sdk.Context, codec.Marshaler) {
app := simapp.Setup(false)
ctx := app.BaseApp.NewContext(false, abci.Header{Height: 1})
ctx := app.BaseApp.NewContext(false, tmproto.Header{Height: 1})
appCodec := app.AppCodec()
db := dbm.NewMemDB()

View File

@ -4,6 +4,7 @@ import (
"math/rand"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519"
"github.com/tendermint/tendermint/crypto/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
@ -16,6 +17,7 @@ type Account struct {
PrivKey crypto.PrivKey
PubKey crypto.PubKey
Address sdk.AccAddress
ConsKey crypto.PrivKey
}
// Equals returns true if two accounts are equal
@ -39,9 +41,11 @@ func RandomAccounts(r *rand.Rand, n int) []Account {
privkeySeed := make([]byte, 15)
r.Read(privkeySeed)
accs[i].PrivKey = secp256k1.GenPrivKeySecp256k1(privkeySeed)
accs[i].PrivKey = secp256k1.GenPrivKeyFromSecret(privkeySeed)
accs[i].PubKey = accs[i].PrivKey.PubKey()
accs[i].Address = sdk.AccAddress(accs[i].PubKey.Address())
accs[i].ConsKey = ed25519.GenPrivKeyFromSecret(privkeySeed)
}
return accs

View File

@ -91,7 +91,8 @@ func NewLevelDB(name, dir string) (db dbm.DB, err error) {
err = fmt.Errorf("couldn't create db: %v", r)
}
}()
return dbm.NewDB(name, backend, dir), err
return dbm.NewDB(name, backend, dir)
}
// copy bytes

View File

@ -1002,7 +1002,7 @@ func (suite *AnteTestSuite) TestCustomSignatureVerificationGasConsumer() {
// setup an ante handler that only accepts PubKeyEd25519
suite.anteHandler = ante.NewAnteHandler(suite.app.AccountKeeper, suite.app.BankKeeper, func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error {
switch pubkey := sig.PubKey.(type) {
case ed25519.PubKeyEd25519:
case ed25519.PubKey:
meter.ConsumeGas(params.SigVerifyCostED25519, "ante verify: ed25519")
return nil
default:

View File

@ -20,7 +20,7 @@ import (
var (
// simulation signature values used to estimate gas consumption
simSecp256k1Pubkey secp256k1.PubKeySecp256k1
simSecp256k1Pubkey = make(secp256k1.PubKey, secp256k1.PubKeySize)
simSecp256k1Sig [64]byte
_ authsigning.SigVerifiableTx = (*types.StdTx)(nil) // assert StdTx implements SigVerifiableTx
@ -29,7 +29,7 @@ var (
func init() {
// This decodes a valid hex string into a sepc256k1Pubkey for use in transaction simulation
bz, _ := hex.DecodeString("035AD6810A47F073553FF30D2FCC7E0D3B1C0B74B61A1AAA2582344037151E143A")
copy(simSecp256k1Pubkey[:], bz)
copy(simSecp256k1Pubkey, bz)
}
// SignatureVerificationGasConsumer is the type of function that is used to both
@ -320,11 +320,11 @@ func DefaultSigVerificationGasConsumer(
pubkey := sig.PubKey
switch pubkey := pubkey.(type) {
case ed25519.PubKeyEd25519:
case ed25519.PubKey:
meter.ConsumeGas(params.SigVerifyCostED25519, "ante verify: ed25519")
return sdkerrors.Wrap(sdkerrors.ErrInvalidPubKey, "ED25519 public keys are unsupported")
case secp256k1.PubKeySecp256k1:
case secp256k1.PubKey:
meter.ConsumeGas(params.SigVerifyCostSecp256k1, "ante verify: secp256k1")
return nil

View File

@ -6,8 +6,8 @@ import (
"testing"
"github.com/stretchr/testify/suite"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
@ -41,7 +41,7 @@ type AnteTestSuite struct {
// returns context and app with params set on account keeper
func createTestApp(isCheckTx bool) (*simapp.SimApp, sdk.Context) {
app := simapp.Setup(isCheckTx)
ctx := app.BaseApp.NewContext(isCheckTx, abci.Header{})
ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{})
app.AccountKeeper.SetParams(ctx, authtypes.DefaultParams())
return app, ctx

View File

@ -43,7 +43,7 @@ func QueryTxsByEvents(clientCtx client.Context, events []string, page, limit int
// TODO: this may not always need to be proven
// https://github.com/cosmos/cosmos-sdk/issues/6807
resTxs, err := node.TxSearch(query, true, page, limit, orderBy)
resTxs, err := node.TxSearch(query, true, &page, &limit, orderBy)
if err != nil {
return nil, err
}

View File

@ -1,7 +1,7 @@
package keeper_test
import (
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types"
@ -11,7 +11,7 @@ import (
// returns context and app with params set on account keeper
func createTestApp(isCheckTx bool) (*simapp.SimApp, sdk.Context) {
app := simapp.Setup(isCheckTx)
ctx := app.BaseApp.NewContext(isCheckTx, abci.Header{})
ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{})
app.AccountKeeper.SetParams(ctx, authtypes.DefaultParams())
return app, ctx

View File

@ -5,6 +5,7 @@ import (
"github.com/stretchr/testify/require"
abcitypes "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/x/auth/types"
@ -12,7 +13,7 @@ import (
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
app := simapp.Setup(false)
ctx := app.BaseApp.NewContext(false, abcitypes.Header{})
ctx := app.BaseApp.NewContext(false, tmproto.Header{})
app.InitChain(
abcitypes.RequestInitChain{

View File

@ -19,7 +19,7 @@ func VerifySignature(pubKey crypto.PubKey, signerData SignerData, sigData signin
if err != nil {
return err
}
if !pubKey.VerifyBytes(signBytes, data.Signature) {
if !pubKey.VerifySignature(signBytes, data.Signature) {
return fmt.Errorf("unable to verify single signer signature")
}
return nil

View File

@ -4,8 +4,8 @@ import (
"testing"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
@ -93,7 +93,7 @@ func TestVerifySignature(t *testing.T) {
// returns context and app with params set on account keeper
func createTestApp(isCheckTx bool) (*simapp.SimApp, sdk.Context) {
app := simapp.Setup(isCheckTx)
ctx := app.BaseApp.NewContext(isCheckTx, abci.Header{})
ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{})
app.AccountKeeper.SetParams(ctx, types.DefaultParams())
return app, ctx

View File

@ -6,6 +6,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/legacy"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
@ -47,7 +48,7 @@ func TestTxBuilder(t *testing.T) {
PubKey: pubkey,
Data: &signing.SingleSignatureData{
SignMode: signing.SignMode_SIGN_MODE_DIRECT,
Signature: pubkey.Bytes(),
Signature: legacy.Cdc.MustMarshalBinaryBare(pubkey),
},
}
@ -106,7 +107,7 @@ func TestTxBuilder(t *testing.T) {
require.Equal(t, len(msgs), len(txBuilder.GetMsgs()))
require.Equal(t, 1, len(txBuilder.GetPubKeys()))
require.Equal(t, pubkey.Bytes(), txBuilder.GetPubKeys()[0].Bytes())
require.Equal(t, legacy.Cdc.MustMarshalBinaryBare(pubkey), legacy.Cdc.MustMarshalBinaryBare(txBuilder.GetPubKeys()[0]))
txBuilder = &builder{}
require.NotPanics(t, func() {
@ -134,7 +135,7 @@ func TestBuilderValidateBasic(t *testing.T) {
PubKey: pubKey1,
Data: &signing.SingleSignatureData{
SignMode: signing.SignMode_SIGN_MODE_DIRECT,
Signature: pubKey1.Bytes(),
Signature: legacy.Cdc.MustMarshalBinaryBare(pubKey1),
},
}
@ -142,7 +143,7 @@ func TestBuilderValidateBasic(t *testing.T) {
PubKey: pubKey2,
Data: &signing.SingleSignatureData{
SignMode: signing.SignMode_SIGN_MODE_DIRECT,
Signature: pubKey2.Bytes(),
Signature: legacy.Cdc.MustMarshalBinaryBare(pubKey2),
},
}

Some files were not shown because too many files have changed in this diff Show More