Skip to content

Commit

Permalink
Merge pull request #81 from PeggyJV/mvid/testnet-imports
Browse files Browse the repository at this point in the history
Testnet import changes
  • Loading branch information
zmanian authored Jul 20, 2021
2 parents 2102174 + 6d85a67 commit 550b158
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 71 deletions.
2 changes: 0 additions & 2 deletions module/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ github.com/cosmos/cosmos-sdk v0.42.4-0.20210623214207-eb0fc466c99b/go.mod h1:xiL
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/peggyjv/gravity-bridge/module v0.0.0-20210322173118-25d77b5f9b46 h1:XXCzKCfiWWnn6sjNISC/pv+GbfEd03bCpu0IXCnS9TA=
github.com/peggyjv/gravity-bridge/module v0.0.0-20210322173118-25d77b5f9b46/go.mod h1:jEI1pLV70xW9prKdBnKroKWIpYXjcVyn4BQQcwXHs40=
github.com/cosmos/iavl v0.15.0-rc3.0.20201009144442-230e9bdf52cd/go.mod h1:3xOIaNNX19p0QrX0VqWa6voPRoJRGGYtny+DH8NEPvE=
github.com/cosmos/iavl v0.15.0-rc5/go.mod h1:WqoPL9yPTQ85QBMT45OOUzPxG/U/JcJoN7uMjgxke/I=
github.com/cosmos/iavl v0.15.3 h1:xE9r6HW8GeKeoYJN4zefpljZ1oukVScP/7M8oj6SUts=
Expand Down
2 changes: 1 addition & 1 deletion testnet/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/cosmos/cosmos-sdk/x/auth/types"
types2 "github.com/cosmos/cosmos-sdk/x/bank/types"
gravitytypes "github.com/cosmos/gravity-bridge/module/x/gravity/types"
gravitytypes "github.com/peggyjv/gravity-bridge/module/x/gravity/types"
)

type Auth struct {
Expand Down
10 changes: 5 additions & 5 deletions testnet/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/cosmos/gravity-bridge/testnet
module github.com/peggyjv/gravity-bridge/testnet

go 1.16

Expand All @@ -7,14 +7,14 @@ require (
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.1 // indirect
github.com/containerd/continuity v0.1.0 // indirect
github.com/cosmos/cosmos-sdk v0.42.5
github.com/cosmos/cosmos-sdk v0.42.4-0.20210623214207-eb0fc466c99b
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/gravity-bridge/module v0.0.0-00010101000000-000000000000
github.com/ethereum/go-ethereum v1.9.21
github.com/ethereum/go-ethereum v1.9.23
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 // indirect
github.com/opencontainers/runc v1.0.0-rc95 // indirect
github.com/ory/dockertest/v3 v3.6.5
github.com/peggyjv/gravity-bridge/module v0.0.0-00010101000000-000000000000
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/stretchr/testify v1.7.0
github.com/tendermint/tendermint v0.34.10
Expand All @@ -25,4 +25,4 @@ require (

replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

replace github.com/cosmos/gravity-bridge/module => github.com/peggyjv/gravity-bridge/module v0.0.0-20210612031159-dae2f0d5b179
replace github.com/peggyjv/gravity-bridge/module => ../module
51 changes: 10 additions & 41 deletions testnet/go.sum

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions testnet/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package main

func main() {}
3 changes: 1 addition & 2 deletions testnet/prebuilt_ci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ import (
sdktypes "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/genutil/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
gravitytypes "github.com/cosmos/gravity-bridge/module/x/gravity/types"
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
gravitytypes "github.com/peggyjv/gravity-bridge/module/x/gravity/types"
"github.com/stretchr/testify/require"
tmjson "github.com/tendermint/tendermint/libs/json"

)


Expand Down
16 changes: 8 additions & 8 deletions testnet/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,24 @@ import (
"crypto/ecdsa"
"encoding/json"
"fmt"
"github.com/cosmos/cosmos-sdk/codec/unknownproto"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
"github.com/cosmos/cosmos-sdk/types/tx"
tmos "github.com/tendermint/tendermint/libs/os"
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/privval"
"os"
"path"
"path/filepath"

"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/codec/unknownproto"
sdkcrypto "github.com/cosmos/cosmos-sdk/crypto"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/server"
sdktypes "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/tx"
txsigning "github.com/cosmos/cosmos-sdk/types/tx/signing"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
Expand All @@ -34,11 +31,14 @@ import (
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cosmos/go-bip39"
"github.com/cosmos/gravity-bridge/module/app"
gravitytypes "github.com/cosmos/gravity-bridge/module/x/gravity/types"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
"github.com/peggyjv/gravity-bridge/module/app"
gravitytypes "github.com/peggyjv/gravity-bridge/module/x/gravity/types"
cfg "github.com/tendermint/tendermint/config"
tmos "github.com/tendermint/tendermint/libs/os"
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/privval"
tmtypes "github.com/tendermint/tendermint/types"
)

Expand Down
24 changes: 12 additions & 12 deletions testnet/with_pristine_e2e_environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ import (

"github.com/BurntSushi/toml"
"github.com/cosmos/cosmos-sdk/codec"
types3 "github.com/cosmos/cosmos-sdk/codec/types"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
types6 "github.com/cosmos/cosmos-sdk/crypto/types"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/server"
types2 "github.com/cosmos/cosmos-sdk/types"
sdktypes "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/genutil/types"
types4 "github.com/cosmos/cosmos-sdk/x/staking/types"
types5 "github.com/cosmos/gravity-bridge/module/x/gravity/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/ory/dockertest/v3"
"github.com/ory/dockertest/v3/docker"
gravitytypes "github.com/peggyjv/gravity-bridge/module/x/gravity/types"
"github.com/stretchr/testify/require"
json2 "github.com/tendermint/tendermint/libs/json"
tendermintjson "github.com/tendermint/tendermint/libs/json"
)

func withPristineE2EEnvironment(t *testing.T, cb func(
Expand Down Expand Up @@ -140,13 +140,13 @@ func withPristineE2EEnvironment(t *testing.T, cb func(
require.NoError(t, err, "error unmarshalling genesis state")

// generate gentxs
amount, _ := types2.NewIntFromString("100000000000")
coin := types2.Coin{Denom: "stake", Amount: amount}
amount, _ := sdktypes.NewIntFromString("100000000000")
coin := sdktypes.Coin{Denom: "stake", Amount: amount}
genTxs := make([]json.RawMessage, len(chain.Validators))

interfaceRegistry := types3.NewInterfaceRegistry()
interfaceRegistry.RegisterImplementations((*types2.Msg)(nil), &types4.MsgCreateValidator{}, &types5.MsgDelegateKeys{})
interfaceRegistry.RegisterImplementations((*types6.PubKey)(nil), &secp256k1.PubKey{}, &ed25519.PubKey{})
interfaceRegistry := codectypes.NewInterfaceRegistry()
interfaceRegistry.RegisterImplementations((*sdktypes.Msg)(nil), &stakingtypes.MsgCreateValidator{}, &gravitytypes.MsgDelegateKeys{})
interfaceRegistry.RegisterImplementations((*cryptotypes.PubKey)(nil), &secp256k1.PubKey{}, &ed25519.PubKey{})
marshaler := codec.NewProtoCodec(interfaceRegistry)

for i, v := range chain.Validators {
Expand Down Expand Up @@ -174,7 +174,7 @@ func withPristineE2EEnvironment(t *testing.T, cb func(
require.NoError(t, err, "error marshalling app state")

genDoc.AppState = bz
out, err := json2.MarshalIndent(genDoc, "", " ")
out, err := tendermintjson.MarshalIndent(genDoc, "", " ")
require.NoError(t, err, "error marshalling genesis doc")

for _, validator := range chain.Validators {
Expand Down

0 comments on commit 550b158

Please sign in to comment.