cosmos-sdk/x/ibc/testing/solomachine.go

166 lines
4.5 KiB
Go
Raw Normal View History

package ibctesting
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto"
"github.com/cosmos/cosmos-sdk/codec"
Proto Tx with Any (#7276) * WIP on protobuf keys * Use Type() and Bytes() in sr25519 pub key Equals * Add tests * Add few more tests * Update other pub/priv key types Equals * Fix PrivKey's Sign method * Rename variables in tests * Fix infinite recursive calls * Use tm ed25519 keys * Add Sign and VerifySignature tests * Remove ed25519 and sr25519 references * proto linting * Add proto crypto file * Implement some of the new multisig proto type methods * Add tests for MultisigThresholdPubKey * Add tests for pubkey pb/amino conversion functions * Move crypto types.go and register new proto pubkeys * Add missing pointer ref * Address review comments * panic in MultisigThresholdPubKey VerifySignature * Use internal crypto.PubKey in multisig * Add tests for MultisigThresholdPubKey VerifyMultisignature * Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1 * Remove conversion functions and introduce internal PubKey type * Override Amino marshaling for proto pubkeys * Merge master * Make proto-gen * Start removal of old PubKeyMultisigThreshold references * Fix tests * Fix solomachine * Fix ante handler tests * Pull latest go-amino * Remove ed25519 * Remove old secp256k1 PubKey and PrivKey * Uncomment test case * Fix linting issues * More linting * Revert tests keys values * Add Amino overrides to proto keys * Add pubkey test * Fix tests * Use threshold isntead of K * Standardize Type * Revert standardize types commit * Fix build * Fix lint * Fix lint * Add comment * Register crypto.PubKey * Add empty key in BuildSimTx * Simplify proto names * Unpack interfaces for signing desc * Fix IBC tests? * Format proto * Use secp256k1 in ibc * Fixed merge issues * Uncomment tests * Update x/ibc/testing/solomachine.go * UnpackInterfaces for solomachine types * Remove old multisig * Add amino marshal for multisig * Fix lint * Correctly register amino * One test left! * Remove old struct * Fix test * Fix test * Unpack into tmcrypto * Remove old threshold pubkey tests * Fix register amino * Fix lint * Use sdk crypto PubKey in multisig UnpackInterfaces * Potential fix? * Register LegacyAminoPubKey * Register our own PubKey * Register tmcrypto PubKey * Register both PubKeys * Register interfaces in test * Refactor fiels * Add comments * Use anil's suggestion * Add norace back * Check nil * Address comments * FIx lint * Add tests for solomachine unpack interfaces * Fix query tx by hash * Better name in amino register * Display StdTx instead of proto Tx * Remove useless check Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com> Co-authored-by: blushi <marie.gauthier63@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-09-21 09:48:28 -07:00
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
"github.com/cosmos/cosmos-sdk/x/auth/tx"
clienttypes "github.com/cosmos/cosmos-sdk/x/ibc/02-client/types"
"github.com/cosmos/cosmos-sdk/x/ibc/exported"
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
solomachinetypes "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/solomachine/types"
)
// Solomachine is a testing helper used to simulate a counterparty
// solo machine client.
type Solomachine struct {
t *testing.T
cdc codec.BinaryMarshaler
ClientID string
PrivateKey crypto.PrivKey
PublicKey crypto.PubKey
Sequence uint64
Time uint64
Diversifier string
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
}
// NewSolomachine returns a new solomachine instance with a generated private/public
// key pair and a sequence starting at 1.
func NewSolomachine(t *testing.T, cdc codec.BinaryMarshaler, clientID, diversifier string) *Solomachine {
Proto Tx with Any (#7276) * WIP on protobuf keys * Use Type() and Bytes() in sr25519 pub key Equals * Add tests * Add few more tests * Update other pub/priv key types Equals * Fix PrivKey's Sign method * Rename variables in tests * Fix infinite recursive calls * Use tm ed25519 keys * Add Sign and VerifySignature tests * Remove ed25519 and sr25519 references * proto linting * Add proto crypto file * Implement some of the new multisig proto type methods * Add tests for MultisigThresholdPubKey * Add tests for pubkey pb/amino conversion functions * Move crypto types.go and register new proto pubkeys * Add missing pointer ref * Address review comments * panic in MultisigThresholdPubKey VerifySignature * Use internal crypto.PubKey in multisig * Add tests for MultisigThresholdPubKey VerifyMultisignature * Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1 * Remove conversion functions and introduce internal PubKey type * Override Amino marshaling for proto pubkeys * Merge master * Make proto-gen * Start removal of old PubKeyMultisigThreshold references * Fix tests * Fix solomachine * Fix ante handler tests * Pull latest go-amino * Remove ed25519 * Remove old secp256k1 PubKey and PrivKey * Uncomment test case * Fix linting issues * More linting * Revert tests keys values * Add Amino overrides to proto keys * Add pubkey test * Fix tests * Use threshold isntead of K * Standardize Type * Revert standardize types commit * Fix build * Fix lint * Fix lint * Add comment * Register crypto.PubKey * Add empty key in BuildSimTx * Simplify proto names * Unpack interfaces for signing desc * Fix IBC tests? * Format proto * Use secp256k1 in ibc * Fixed merge issues * Uncomment tests * Update x/ibc/testing/solomachine.go * UnpackInterfaces for solomachine types * Remove old multisig * Add amino marshal for multisig * Fix lint * Correctly register amino * One test left! * Remove old struct * Fix test * Fix test * Unpack into tmcrypto * Remove old threshold pubkey tests * Fix register amino * Fix lint * Use sdk crypto PubKey in multisig UnpackInterfaces * Potential fix? * Register LegacyAminoPubKey * Register our own PubKey * Register tmcrypto PubKey * Register both PubKeys * Register interfaces in test * Refactor fiels * Add comments * Use anil's suggestion * Add norace back * Check nil * Address comments * FIx lint * Add tests for solomachine unpack interfaces * Fix query tx by hash * Better name in amino register * Display StdTx instead of proto Tx * Remove useless check Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com> Co-authored-by: blushi <marie.gauthier63@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-09-21 09:48:28 -07:00
privKey := secp256k1.GenPrivKey()
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
return &Solomachine{
t: t,
cdc: cdc,
ClientID: clientID,
PrivateKey: privKey,
PublicKey: privKey.PubKey(),
Sequence: 1,
Time: 10,
Diversifier: diversifier,
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
}
}
// ClientState returns a new solo machine ClientState instance. Default usage does not allow update
// after governance proposal
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
func (solo *Solomachine) ClientState() *solomachinetypes.ClientState {
return solomachinetypes.NewClientState(solo.Sequence, solo.ConsensusState(), false)
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
}
// ConsensusState returns a new solo machine ConsensusState instance
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
func (solo *Solomachine) ConsensusState() *solomachinetypes.ConsensusState {
Proto Tx with Any (#7276) * WIP on protobuf keys * Use Type() and Bytes() in sr25519 pub key Equals * Add tests * Add few more tests * Update other pub/priv key types Equals * Fix PrivKey's Sign method * Rename variables in tests * Fix infinite recursive calls * Use tm ed25519 keys * Add Sign and VerifySignature tests * Remove ed25519 and sr25519 references * proto linting * Add proto crypto file * Implement some of the new multisig proto type methods * Add tests for MultisigThresholdPubKey * Add tests for pubkey pb/amino conversion functions * Move crypto types.go and register new proto pubkeys * Add missing pointer ref * Address review comments * panic in MultisigThresholdPubKey VerifySignature * Use internal crypto.PubKey in multisig * Add tests for MultisigThresholdPubKey VerifyMultisignature * Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1 * Remove conversion functions and introduce internal PubKey type * Override Amino marshaling for proto pubkeys * Merge master * Make proto-gen * Start removal of old PubKeyMultisigThreshold references * Fix tests * Fix solomachine * Fix ante handler tests * Pull latest go-amino * Remove ed25519 * Remove old secp256k1 PubKey and PrivKey * Uncomment test case * Fix linting issues * More linting * Revert tests keys values * Add Amino overrides to proto keys * Add pubkey test * Fix tests * Use threshold isntead of K * Standardize Type * Revert standardize types commit * Fix build * Fix lint * Fix lint * Add comment * Register crypto.PubKey * Add empty key in BuildSimTx * Simplify proto names * Unpack interfaces for signing desc * Fix IBC tests? * Format proto * Use secp256k1 in ibc * Fixed merge issues * Uncomment tests * Update x/ibc/testing/solomachine.go * UnpackInterfaces for solomachine types * Remove old multisig * Add amino marshal for multisig * Fix lint * Correctly register amino * One test left! * Remove old struct * Fix test * Fix test * Unpack into tmcrypto * Remove old threshold pubkey tests * Fix register amino * Fix lint * Use sdk crypto PubKey in multisig UnpackInterfaces * Potential fix? * Register LegacyAminoPubKey * Register our own PubKey * Register tmcrypto PubKey * Register both PubKeys * Register interfaces in test * Refactor fiels * Add comments * Use anil's suggestion * Add norace back * Check nil * Address comments * FIx lint * Add tests for solomachine unpack interfaces * Fix query tx by hash * Better name in amino register * Display StdTx instead of proto Tx * Remove useless check Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com> Co-authored-by: blushi <marie.gauthier63@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-09-21 09:48:28 -07:00
publicKey, err := tx.PubKeyToAny(solo.PublicKey)
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
require.NoError(solo.t, err)
return &solomachinetypes.ConsensusState{
PublicKey: publicKey,
Diversifier: solo.Diversifier,
Timestamp: solo.Time,
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
}
}
// GetHeight returns an exported.Height with Sequence as EpochHeight
func (solo *Solomachine) GetHeight() exported.Height {
return clienttypes.NewHeight(0, solo.Sequence)
}
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
// CreateHeader generates a new private/public key pair and creates the
// necessary signature to construct a valid solo machine header.
func (solo *Solomachine) CreateHeader() *solomachinetypes.Header {
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
// generate new private key and signature for header
Proto Tx with Any (#7276) * WIP on protobuf keys * Use Type() and Bytes() in sr25519 pub key Equals * Add tests * Add few more tests * Update other pub/priv key types Equals * Fix PrivKey's Sign method * Rename variables in tests * Fix infinite recursive calls * Use tm ed25519 keys * Add Sign and VerifySignature tests * Remove ed25519 and sr25519 references * proto linting * Add proto crypto file * Implement some of the new multisig proto type methods * Add tests for MultisigThresholdPubKey * Add tests for pubkey pb/amino conversion functions * Move crypto types.go and register new proto pubkeys * Add missing pointer ref * Address review comments * panic in MultisigThresholdPubKey VerifySignature * Use internal crypto.PubKey in multisig * Add tests for MultisigThresholdPubKey VerifyMultisignature * Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1 * Remove conversion functions and introduce internal PubKey type * Override Amino marshaling for proto pubkeys * Merge master * Make proto-gen * Start removal of old PubKeyMultisigThreshold references * Fix tests * Fix solomachine * Fix ante handler tests * Pull latest go-amino * Remove ed25519 * Remove old secp256k1 PubKey and PrivKey * Uncomment test case * Fix linting issues * More linting * Revert tests keys values * Add Amino overrides to proto keys * Add pubkey test * Fix tests * Use threshold isntead of K * Standardize Type * Revert standardize types commit * Fix build * Fix lint * Fix lint * Add comment * Register crypto.PubKey * Add empty key in BuildSimTx * Simplify proto names * Unpack interfaces for signing desc * Fix IBC tests? * Format proto * Use secp256k1 in ibc * Fixed merge issues * Uncomment tests * Update x/ibc/testing/solomachine.go * UnpackInterfaces for solomachine types * Remove old multisig * Add amino marshal for multisig * Fix lint * Correctly register amino * One test left! * Remove old struct * Fix test * Fix test * Unpack into tmcrypto * Remove old threshold pubkey tests * Fix register amino * Fix lint * Use sdk crypto PubKey in multisig UnpackInterfaces * Potential fix? * Register LegacyAminoPubKey * Register our own PubKey * Register tmcrypto PubKey * Register both PubKeys * Register interfaces in test * Refactor fiels * Add comments * Use anil's suggestion * Add norace back * Check nil * Address comments * FIx lint * Add tests for solomachine unpack interfaces * Fix query tx by hash * Better name in amino register * Display StdTx instead of proto Tx * Remove useless check Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com> Co-authored-by: blushi <marie.gauthier63@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-09-21 09:48:28 -07:00
newPrivKey := secp256k1.GenPrivKey()
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
Proto Tx with Any (#7276) * WIP on protobuf keys * Use Type() and Bytes() in sr25519 pub key Equals * Add tests * Add few more tests * Update other pub/priv key types Equals * Fix PrivKey's Sign method * Rename variables in tests * Fix infinite recursive calls * Use tm ed25519 keys * Add Sign and VerifySignature tests * Remove ed25519 and sr25519 references * proto linting * Add proto crypto file * Implement some of the new multisig proto type methods * Add tests for MultisigThresholdPubKey * Add tests for pubkey pb/amino conversion functions * Move crypto types.go and register new proto pubkeys * Add missing pointer ref * Address review comments * panic in MultisigThresholdPubKey VerifySignature * Use internal crypto.PubKey in multisig * Add tests for MultisigThresholdPubKey VerifyMultisignature * Only keep LegacyAminoMultisigThresholdPubKey and move to proto keys to v1 * Remove conversion functions and introduce internal PubKey type * Override Amino marshaling for proto pubkeys * Merge master * Make proto-gen * Start removal of old PubKeyMultisigThreshold references * Fix tests * Fix solomachine * Fix ante handler tests * Pull latest go-amino * Remove ed25519 * Remove old secp256k1 PubKey and PrivKey * Uncomment test case * Fix linting issues * More linting * Revert tests keys values * Add Amino overrides to proto keys * Add pubkey test * Fix tests * Use threshold isntead of K * Standardize Type * Revert standardize types commit * Fix build * Fix lint * Fix lint * Add comment * Register crypto.PubKey * Add empty key in BuildSimTx * Simplify proto names * Unpack interfaces for signing desc * Fix IBC tests? * Format proto * Use secp256k1 in ibc * Fixed merge issues * Uncomment tests * Update x/ibc/testing/solomachine.go * UnpackInterfaces for solomachine types * Remove old multisig * Add amino marshal for multisig * Fix lint * Correctly register amino * One test left! * Remove old struct * Fix test * Fix test * Unpack into tmcrypto * Remove old threshold pubkey tests * Fix register amino * Fix lint * Use sdk crypto PubKey in multisig UnpackInterfaces * Potential fix? * Register LegacyAminoPubKey * Register our own PubKey * Register tmcrypto PubKey * Register both PubKeys * Register interfaces in test * Refactor fiels * Add comments * Use anil's suggestion * Add norace back * Check nil * Address comments * FIx lint * Add tests for solomachine unpack interfaces * Fix query tx by hash * Better name in amino register * Display StdTx instead of proto Tx * Remove useless check Co-authored-by: Aaron Craelius <aaronc@users.noreply.github.com> Co-authored-by: blushi <marie.gauthier63@gmail.com> Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
2020-09-21 09:48:28 -07:00
publicKey, err := tx.PubKeyToAny(newPrivKey.PubKey())
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
require.NoError(solo.t, err)
data := &solomachinetypes.HeaderData{
NewPubKey: publicKey,
NewDiversifier: solo.Diversifier,
}
dataBz, err := solo.cdc.MarshalBinaryBare(data)
require.NoError(solo.t, err)
signBytes := &solomachinetypes.SignBytes{
Sequence: solo.Sequence,
Timestamp: solo.Time,
Diversifier: solo.Diversifier,
Data: dataBz,
}
signBz, err := solo.cdc.MarshalBinaryBare(signBytes)
require.NoError(solo.t, err)
signature, err := solo.PrivateKey.Sign(signBz)
require.NoError(solo.t, err)
header := &solomachinetypes.Header{
Sequence: solo.Sequence,
Timestamp: solo.Time,
Signature: signature,
NewPublicKey: publicKey,
NewDiversifier: solo.Diversifier,
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
}
// assumes successful header update
solo.Sequence++
solo.PrivateKey = newPrivKey
solo.PublicKey = newPrivKey.PubKey()
return header
}
// CreateMisbehaviour constructs testing misbehaviour for the solo machine client
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
// by signing over two different data bytes at the same sequence.
func (solo *Solomachine) CreateMisbehaviour() *solomachinetypes.Misbehaviour {
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
dataOne := []byte("DATA ONE")
dataTwo := []byte("DATA TWO")
signBytes := &solomachinetypes.SignBytes{
Sequence: solo.Sequence,
Timestamp: solo.Time,
Diversifier: solo.Diversifier,
Data: dataOne,
}
signBz, err := solo.cdc.MarshalBinaryBare(signBytes)
require.NoError(solo.t, err)
sig, err := solo.PrivateKey.Sign(signBz)
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
require.NoError(solo.t, err)
signatureOne := solomachinetypes.SignatureAndData{
Signature: sig,
Data: dataOne,
}
signBytes = &solomachinetypes.SignBytes{
Sequence: solo.Sequence,
Timestamp: solo.Time,
Diversifier: solo.Diversifier,
Data: dataTwo,
}
signBz, err = solo.cdc.MarshalBinaryBare(signBytes)
require.NoError(solo.t, err)
sig, err = solo.PrivateKey.Sign(signBz)
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
require.NoError(solo.t, err)
signatureTwo := solomachinetypes.SignatureAndData{
Signature: sig,
Data: dataTwo,
}
return &solomachinetypes.Misbehaviour{
implement solo machine client (#6267) * pause work until client refactor resolved * continued scaffolding * add msgs and evidence * add update and misbehaviour functionality * implement cli * various types compile issues * add sig proof and various bug fixes * added rest routes * verification funcs now update sequence number * add sm suite and header test * msgcreateclient and msgupdateclient tests * add basic evidence test * evidence validate basic test * consensus state tests * rm accidental file * add verify con state and channel state, pause work for counterparty commitment type * client state tests added * update clienttype numbers * update test added * add misbehaviour tests * update alias * update cli tx * update import alias * cleanup code * remove todo, tested by evidence tests * add info to err msg * wrapf * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/client/cli/tx.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/update.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/23-commitment/types/signature.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/06-solomachine/types/header.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * apply most of the review suggestions from @fedekunze * remove alias.go * update cli context with master changes * merge selective downstream changes from colin/solomachine * fix build issues * remove signature proof * try to migrate to proto * rm go structs for consensus state and header * address @fedekunze review and continue proto migration * fix proto issues * fix compile bugs in types, proto panics on getpubkey currently * add timestamp * update pubkey to be type sdkcrypto.PublicKey * update timestamp handling * begin removing amino, migrate to proto * fix various build issues * fix most test in types * change sanitize to produce, fix bug, types test passing * begin updating cli * move solomachine into light-clients/ * fix merge issue * update proto and fix cli * more fixes and update proto again * update pubkey to be any * fix string func issue * update tests to use testing pkg * update from tm crypto keys ref to sdk * fix tests :tada: * increase codecov * address TODOs * address most of @fedekunze comments * add test case for misbehaviour frozen client * fix lint * fix proto lint? * rename Signature to TimestampedSignature * remove chainID * rename FrozenHeight to FrozenSequence * apply verify consensus state changes requested by @AdityaSripal * remove dup check * fix typo in proto file comment Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Federico Kunze <federico.kunze94@gmail.com> Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
2020-08-24 03:06:48 -07:00
ClientId: solo.ClientID,
Sequence: solo.Sequence,
SignatureOne: &signatureOne,
SignatureTwo: &signatureTwo,
}
}