31 lines
735 B
Go
31 lines
735 B
Go
package types
|
|
|
|
import (
|
|
"github.com/tendermint/tendermint/crypto"
|
|
|
|
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
|
|
"github.com/cosmos/cosmos-sdk/testutil/testdata"
|
|
|
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
)
|
|
|
|
// NewTestMsg generates a test message
|
|
func NewTestMsg(addrs ...sdk.AccAddress) *testdata.TestMsg {
|
|
return testdata.NewTestMsg(addrs...)
|
|
}
|
|
|
|
// NewTestCoins coins to more than cover the fee
|
|
func NewTestCoins() sdk.Coins {
|
|
return sdk.Coins{
|
|
sdk.NewInt64Coin("atom", 10000000),
|
|
}
|
|
}
|
|
|
|
// KeyTestPubAddr generates a test key pair
|
|
func KeyTestPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) {
|
|
key := secp256k1.GenPrivKey()
|
|
pub := key.PubKey()
|
|
addr := sdk.AccAddress(pub.Address())
|
|
return key, pub, addr
|
|
}
|