Merge pull request #545 from cosmos/bucky/sdk-address
crypto.Address -> sdk.Address
This commit is contained in:
commit
3a13a649eb
|
@ -327,8 +327,8 @@ func (tx testUpdatePowerTx) Get(key interface{}) (value interface{}) { return ni
|
||||||
func (tx testUpdatePowerTx) GetMsg() sdk.Msg { return tx }
|
func (tx testUpdatePowerTx) GetMsg() sdk.Msg { return tx }
|
||||||
func (tx testUpdatePowerTx) GetSignBytes() []byte { return nil }
|
func (tx testUpdatePowerTx) GetSignBytes() []byte { return nil }
|
||||||
func (tx testUpdatePowerTx) ValidateBasic() sdk.Error { return nil }
|
func (tx testUpdatePowerTx) ValidateBasic() sdk.Error { return nil }
|
||||||
func (tx testUpdatePowerTx) GetSigners() []crypto.Address { return nil }
|
func (tx testUpdatePowerTx) GetSigners() []sdk.Address { return nil }
|
||||||
func (tx testUpdatePowerTx) GetFeePayer() crypto.Address { return nil }
|
func (tx testUpdatePowerTx) GetFeePayer() sdk.Address { return nil }
|
||||||
func (tx testUpdatePowerTx) GetSignatures() []sdk.StdSignature { return nil }
|
func (tx testUpdatePowerTx) GetSignatures() []sdk.StdSignature { return nil }
|
||||||
|
|
||||||
func TestValidatorChange(t *testing.T) {
|
func TestValidatorChange(t *testing.T) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ type Msg interface {
|
||||||
// Signers returns the addrs of signers that must sign.
|
// Signers returns the addrs of signers that must sign.
|
||||||
// CONTRACT: All signatures must be present to be valid.
|
// CONTRACT: All signatures must be present to be valid.
|
||||||
// CONTRACT: Returns addrs in some deterministic order.
|
// CONTRACT: Returns addrs in some deterministic order.
|
||||||
GetSigners() []crypto.Address
|
GetSigners() []Address
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -75,7 +75,7 @@ type SendMsg struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type IssueMsg struct {
|
type IssueMsg struct {
|
||||||
Banker crypto.Address `json:"banker"`
|
Banker sdk.Address `json:"banker"`
|
||||||
Outputs []Output `json:"outputs"`
|
Outputs []Output `json:"outputs"`
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -83,16 +83,16 @@ type IssueMsg struct {
|
||||||
Each specifies the addresses that must sign the message:
|
Each specifies the addresses that must sign the message:
|
||||||
|
|
||||||
```golang
|
```golang
|
||||||
func (msg SendMsg) GetSigners() []crypto.Address {
|
func (msg SendMsg) GetSigners() []sdk.Address {
|
||||||
addrs := make([]crypto.Address, len(msg.Inputs))
|
addrs := make([]sdk.Address, len(msg.Inputs))
|
||||||
for i, in := range msg.Inputs {
|
for i, in := range msg.Inputs {
|
||||||
addrs[i] = in.Address
|
addrs[i] = in.Address
|
||||||
}
|
}
|
||||||
return addrs
|
return addrs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (msg IssueMsg) GetSigners() []crypto.Address {
|
func (msg IssueMsg) GetSigners() []sdk.Address {
|
||||||
return []crypto.Address{msg.Banker}
|
return []sdk.Address{msg.Banker}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ type Tx interface {
|
||||||
|
|
||||||
// The address that pays the base fee for this message. The fee is
|
// The address that pays the base fee for this message. The fee is
|
||||||
// deducted before the Msg is processed.
|
// deducted before the Msg is processed.
|
||||||
GetFeePayer() crypto.Address
|
GetFeePayer() Address
|
||||||
|
|
||||||
// Get the canonical byte representation of the Tx.
|
// Get the canonical byte representation of the Tx.
|
||||||
// Includes any signatures (or empty slots).
|
// Includes any signatures (or empty slots).
|
||||||
|
|
|
@ -156,7 +156,7 @@ implementing the ``Msg`` interface:
|
||||||
// Signers returns the addrs of signers that must sign.
|
// Signers returns the addrs of signers that must sign.
|
||||||
// CONTRACT: All signatures must be present to be valid.
|
// CONTRACT: All signatures must be present to be valid.
|
||||||
// CONTRACT: Returns addrs in some deterministic order.
|
// CONTRACT: Returns addrs in some deterministic order.
|
||||||
GetSigners() []crypto.Address
|
GetSigners() []Address
|
||||||
}
|
}
|
||||||
|
|
||||||
Messages must specify their type via the ``Type()`` method. The type should
|
Messages must specify their type via the ``Type()`` method. The type should
|
||||||
|
@ -188,7 +188,7 @@ For instance, the ``Basecoin`` message types are defined in ``x/bank/tx.go``:
|
||||||
}
|
}
|
||||||
|
|
||||||
type IssueMsg struct {
|
type IssueMsg struct {
|
||||||
Banker crypto.Address `json:"banker"`
|
Banker sdk.Address `json:"banker"`
|
||||||
Outputs []Output `json:"outputs"`
|
Outputs []Output `json:"outputs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,16 +196,16 @@ Each specifies the addresses that must sign the message:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
func (msg SendMsg) GetSigners() []crypto.Address {
|
func (msg SendMsg) GetSigners() []sdk.Address {
|
||||||
addrs := make([]crypto.Address, len(msg.Inputs))
|
addrs := make([]sdk.Address, len(msg.Inputs))
|
||||||
for i, in := range msg.Inputs {
|
for i, in := range msg.Inputs {
|
||||||
addrs[i] = in.Address
|
addrs[i] = in.Address
|
||||||
}
|
}
|
||||||
return addrs
|
return addrs
|
||||||
}
|
}
|
||||||
|
|
||||||
func (msg IssueMsg) GetSigners() []crypto.Address {
|
func (msg IssueMsg) GetSigners() []sdk.Address {
|
||||||
return []crypto.Address{msg.Banker}
|
return []sdk.Address{msg.Banker}
|
||||||
}
|
}
|
||||||
|
|
||||||
Transactions
|
Transactions
|
||||||
|
@ -221,7 +221,7 @@ A transaction is a message with additional information for authentication:
|
||||||
|
|
||||||
// The address that pays the base fee for this message. The fee is
|
// The address that pays the base fee for this message. The fee is
|
||||||
// deducted before the Msg is processed.
|
// deducted before the Msg is processed.
|
||||||
GetFeePayer() crypto.Address
|
GetFeePayer() Address
|
||||||
|
|
||||||
// Get the canonical byte representation of the Tx.
|
// Get the canonical byte representation of the Tx.
|
||||||
// Includes any signatures (or empty slots).
|
// Includes any signatures (or empty slots).
|
||||||
|
|
|
@ -33,14 +33,14 @@ func TestSendMsg(t *testing.T) {
|
||||||
var msg = bank.SendMsg{
|
var msg = bank.SendMsg{
|
||||||
Inputs: []bank.Input{
|
Inputs: []bank.Input{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("input")),
|
Address: sdk.Address([]byte("input")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
Sequence: 1,
|
Sequence: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Outputs: []bank.Output{
|
Outputs: []bank.Output{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("output")),
|
Address: sdk.Address([]byte("output")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -155,14 +155,14 @@ func TestSendMsgWithAccounts(t *testing.T) {
|
||||||
var msg = bank.SendMsg{
|
var msg = bank.SendMsg{
|
||||||
Inputs: []bank.Input{
|
Inputs: []bank.Input{
|
||||||
{
|
{
|
||||||
Address: crypto.Address(addr1),
|
Address: sdk.Address(addr1),
|
||||||
Coins: sdk.Coins{{"foocoin", 10}},
|
Coins: sdk.Coins{{"foocoin", 10}},
|
||||||
Sequence: 1,
|
Sequence: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Outputs: []bank.Output{
|
Outputs: []bank.Output{
|
||||||
{
|
{
|
||||||
Address: crypto.Address(addr2),
|
Address: sdk.Address(addr2),
|
||||||
Coins: sdk.Coins{{"foocoin", 10}},
|
Coins: sdk.Coins{{"foocoin", 10}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,7 +3,6 @@ package types
|
||||||
import (
|
import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/cosmos/cosmos-sdk/x/auth"
|
"github.com/cosmos/cosmos-sdk/x/auth"
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
wire "github.com/tendermint/go-wire"
|
wire "github.com/tendermint/go-wire"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -42,7 +41,7 @@ type GenesisState struct {
|
||||||
// GenesisAccount doesn't need pubkey or sequence
|
// GenesisAccount doesn't need pubkey or sequence
|
||||||
type GenesisAccount struct {
|
type GenesisAccount struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Address crypto.Address `json:"address"`
|
Address sdk.Address `json:"address"`
|
||||||
Coins sdk.Coins `json:"coins"`
|
Coins sdk.Coins `json:"coins"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// An sdk.Tx which is its own sdk.Msg.
|
// An sdk.Tx which is its own sdk.Msg.
|
||||||
|
@ -44,7 +43,7 @@ func (tx kvstoreTx) ValidateBasic() sdk.Error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tx kvstoreTx) GetSigners() []crypto.Address {
|
func (tx kvstoreTx) GetSigners() []sdk.Address {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +51,7 @@ func (tx kvstoreTx) GetSignatures() []sdk.StdSignature {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tx kvstoreTx) GetFeePayer() crypto.Address {
|
func (tx kvstoreTx) GetFeePayer() sdk.Address {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// An sdk.Tx which is its own sdk.Msg.
|
// An sdk.Tx which is its own sdk.Msg.
|
||||||
|
@ -57,7 +56,7 @@ func (tx kvstoreTx) ValidateBasic() sdk.Error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tx kvstoreTx) GetSigners() []crypto.Address {
|
func (tx kvstoreTx) GetSigners() []sdk.Address {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +64,7 @@ func (tx kvstoreTx) GetSignatures() []sdk.StdSignature {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tx kvstoreTx) GetFeePayer() crypto.Address {
|
func (tx kvstoreTx) GetFeePayer() sdk.Address {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import (
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
"github.com/tendermint/go-crypto/keys"
|
"github.com/tendermint/go-crypto/keys"
|
||||||
"github.com/tendermint/go-crypto/keys/words"
|
"github.com/tendermint/go-crypto/keys/words"
|
||||||
cmn "github.com/tendermint/tmlibs/common"
|
cmn "github.com/tendermint/tmlibs/common"
|
||||||
|
@ -17,6 +16,8 @@ import (
|
||||||
tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
|
tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands"
|
||||||
cfg "github.com/tendermint/tendermint/config"
|
cfg "github.com/tendermint/tendermint/config"
|
||||||
tmtypes "github.com/tendermint/tendermint/types"
|
tmtypes "github.com/tendermint/tendermint/types"
|
||||||
|
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// InitCmd will initialize all files for tendermint,
|
// InitCmd will initialize all files for tendermint,
|
||||||
|
@ -45,7 +46,7 @@ type GenOptions func(args []string) (json.RawMessage, error)
|
||||||
// along with the secret phrase to recover the private key.
|
// along with the secret phrase to recover the private key.
|
||||||
// You can give coins to this address and return the recovery
|
// You can give coins to this address and return the recovery
|
||||||
// phrase to the user to access them.
|
// phrase to the user to access them.
|
||||||
func GenerateCoinKey() (crypto.Address, string, error) {
|
func GenerateCoinKey() (sdk.Address, string, error) {
|
||||||
// construct an in-memory key store
|
// construct an in-memory key store
|
||||||
codec, err := words.LoadCodec("english")
|
codec, err := words.LoadCodec("english")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -2,13 +2,16 @@ package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
crypto "github.com/tendermint/go-crypto"
|
crypto "github.com/tendermint/go-crypto"
|
||||||
|
cmn "github.com/tendermint/tmlibs/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Address = cmn.HexBytes
|
||||||
|
|
||||||
// Account is a standard account using a sequence number for replay protection
|
// Account is a standard account using a sequence number for replay protection
|
||||||
// and a pubkey for authentication.
|
// and a pubkey for authentication.
|
||||||
type Account interface {
|
type Account interface {
|
||||||
GetAddress() crypto.Address
|
GetAddress() Address
|
||||||
SetAddress(crypto.Address) error // errors if already set.
|
SetAddress(Address) error // errors if already set.
|
||||||
|
|
||||||
GetPubKey() crypto.PubKey // can return nil.
|
GetPubKey() crypto.PubKey // can return nil.
|
||||||
SetPubKey(crypto.PubKey) error
|
SetPubKey(crypto.PubKey) error
|
||||||
|
@ -26,8 +29,8 @@ type Account interface {
|
||||||
// AccountMapper stores and retrieves accounts from stores
|
// AccountMapper stores and retrieves accounts from stores
|
||||||
// retrieved from the context.
|
// retrieved from the context.
|
||||||
type AccountMapper interface {
|
type AccountMapper interface {
|
||||||
NewAccountWithAddress(ctx Context, addr crypto.Address) Account
|
NewAccountWithAddress(ctx Context, addr Address) Account
|
||||||
GetAccount(ctx Context, addr crypto.Address) Account
|
GetAccount(ctx Context, addr Address) Account
|
||||||
SetAccount(ctx Context, acc Account)
|
SetAccount(ctx Context, acc Account)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ package types
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/tendermint/go-crypto"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ABCI Response Code
|
// ABCI Response Code
|
||||||
|
@ -86,7 +84,7 @@ func ErrInsufficientFunds(msg string) Error {
|
||||||
func ErrUnknownRequest(msg string) Error {
|
func ErrUnknownRequest(msg string) Error {
|
||||||
return newError(CodeUnknownRequest, msg)
|
return newError(CodeUnknownRequest, msg)
|
||||||
}
|
}
|
||||||
func ErrUnrecognizedAddress(addr crypto.Address) Error {
|
func ErrUnrecognizedAddress(addr Address) Error {
|
||||||
return newError(CodeUnrecognizedAddress, addr.String())
|
return newError(CodeUnrecognizedAddress, addr.String())
|
||||||
}
|
}
|
||||||
func ErrInvalidSequence(msg string) Error {
|
func ErrInvalidSequence(msg string) Error {
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Transactions messages must fulfill the Msg
|
// Transactions messages must fulfill the Msg
|
||||||
type Msg interface {
|
type Msg interface {
|
||||||
|
|
||||||
|
@ -24,7 +20,7 @@ type Msg interface {
|
||||||
// Signers returns the addrs of signers that must sign.
|
// Signers returns the addrs of signers that must sign.
|
||||||
// CONTRACT: All signatures must be present to be valid.
|
// CONTRACT: All signatures must be present to be valid.
|
||||||
// CONTRACT: Returns addrs in some deterministic order.
|
// CONTRACT: Returns addrs in some deterministic order.
|
||||||
GetSigners() []crypto.Address
|
GetSigners() []Address
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transactions objects must fulfill the Tx
|
// Transactions objects must fulfill the Tx
|
||||||
|
@ -35,7 +31,7 @@ type Tx interface {
|
||||||
|
|
||||||
// The address that pays the base fee for this message. The fee is
|
// The address that pays the base fee for this message. The fee is
|
||||||
// deducted before the Msg is processed.
|
// deducted before the Msg is processed.
|
||||||
GetFeePayer() crypto.Address
|
GetFeePayer() Address
|
||||||
|
|
||||||
// Signatures returns the signature of signers who signed the Msg.
|
// Signatures returns the signature of signers who signed the Msg.
|
||||||
// CONTRACT: Length returned is same as length of
|
// CONTRACT: Length returned is same as length of
|
||||||
|
@ -65,7 +61,7 @@ func NewStdTx(msg Msg, sigs []StdSignature) StdTx {
|
||||||
|
|
||||||
//nolint
|
//nolint
|
||||||
func (tx StdTx) GetMsg() Msg { return tx.Msg }
|
func (tx StdTx) GetMsg() Msg { return tx.Msg }
|
||||||
func (tx StdTx) GetFeePayer() crypto.Address { return tx.Signatures[0].PubKey.Address() } // XXX but PubKey is optional!
|
func (tx StdTx) GetFeePayer() Address { return tx.Signatures[0].PubKey.Address() } // XXX but PubKey is optional!
|
||||||
func (tx StdTx) GetSignatures() []StdSignature { return tx.Signatures }
|
func (tx StdTx) GetSignatures() []StdSignature { return tx.Signatures }
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
|
|
|
@ -17,13 +17,13 @@ var _ sdk.Account = (*BaseAccount)(nil)
|
||||||
// Extend this by embedding this in your AppAccount.
|
// Extend this by embedding this in your AppAccount.
|
||||||
// See the examples/basecoin/types/account.go for an example.
|
// See the examples/basecoin/types/account.go for an example.
|
||||||
type BaseAccount struct {
|
type BaseAccount struct {
|
||||||
Address crypto.Address `json:"address"`
|
Address sdk.Address `json:"address"`
|
||||||
Coins sdk.Coins `json:"coins"`
|
Coins sdk.Coins `json:"coins"`
|
||||||
PubKey crypto.PubKey `json:"public_key"`
|
PubKey crypto.PubKey `json:"public_key"`
|
||||||
Sequence int64 `json:"sequence"`
|
Sequence int64 `json:"sequence"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewBaseAccountWithAddress(addr crypto.Address) BaseAccount {
|
func NewBaseAccountWithAddress(addr sdk.Address) BaseAccount {
|
||||||
return BaseAccount{
|
return BaseAccount{
|
||||||
Address: addr,
|
Address: addr,
|
||||||
}
|
}
|
||||||
|
@ -40,12 +40,12 @@ func (acc *BaseAccount) Set(key interface{}, value interface{}) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implements sdk.Account.
|
// Implements sdk.Account.
|
||||||
func (acc BaseAccount) GetAddress() crypto.Address {
|
func (acc BaseAccount) GetAddress() sdk.Address {
|
||||||
return acc.Address
|
return acc.Address
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implements sdk.Account.
|
// Implements sdk.Account.
|
||||||
func (acc *BaseAccount) SetAddress(addr crypto.Address) error {
|
func (acc *BaseAccount) SetAddress(addr sdk.Address) error {
|
||||||
if len(acc.Address) != 0 {
|
if len(acc.Address) != 0 {
|
||||||
return errors.New("cannot override BaseAccount address")
|
return errors.New("cannot override BaseAccount address")
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
wire "github.com/tendermint/go-wire"
|
wire "github.com/tendermint/go-wire"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
@ -61,7 +60,7 @@ func (c commander) getAccountCmd(cmd *cobra.Command, args []string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
key := crypto.Address(bz)
|
key := sdk.Address(bz)
|
||||||
|
|
||||||
res, err := client.Query(key, c.storeName)
|
res, err := client.Query(key, c.storeName)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
wire "github.com/tendermint/go-wire"
|
wire "github.com/tendermint/go-wire"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
@ -66,14 +65,14 @@ func (am accountMapper) Seal() sealedAccountMapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implements sdk.AccountMapper.
|
// Implements sdk.AccountMapper.
|
||||||
func (am accountMapper) NewAccountWithAddress(ctx sdk.Context, addr crypto.Address) sdk.Account {
|
func (am accountMapper) NewAccountWithAddress(ctx sdk.Context, addr sdk.Address) sdk.Account {
|
||||||
acc := am.clonePrototype()
|
acc := am.clonePrototype()
|
||||||
acc.SetAddress(addr)
|
acc.SetAddress(addr)
|
||||||
return acc
|
return acc
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implements sdk.AccountMapper.
|
// Implements sdk.AccountMapper.
|
||||||
func (am accountMapper) GetAccount(ctx sdk.Context, addr crypto.Address) sdk.Account {
|
func (am accountMapper) GetAccount(ctx sdk.Context, addr sdk.Address) sdk.Account {
|
||||||
store := ctx.KVStore(am.key)
|
store := ctx.KVStore(am.key)
|
||||||
bz := store.Get(addr)
|
bz := store.Get(addr)
|
||||||
if bz == nil {
|
if bz == nil {
|
||||||
|
|
|
@ -8,7 +8,6 @@ import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
wire "github.com/tendermint/go-wire"
|
wire "github.com/tendermint/go-wire"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
"github.com/cosmos/cosmos-sdk/client"
|
||||||
|
@ -105,7 +104,7 @@ func (c commander) buildTx() ([]byte, error) {
|
||||||
return txBytes, nil
|
return txBytes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildMsg(from crypto.Address) (sdk.Msg, error) {
|
func buildMsg(from sdk.Address) (sdk.Msg, error) {
|
||||||
|
|
||||||
// parse coins
|
// parse coins
|
||||||
amount := viper.GetString(flagAmount)
|
amount := viper.GetString(flagAmount)
|
||||||
|
@ -120,7 +119,7 @@ func buildMsg(from crypto.Address) (sdk.Msg, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
to := crypto.Address(bz)
|
to := sdk.Address(bz)
|
||||||
|
|
||||||
input := bank.NewInput(from, coins)
|
input := bank.NewInput(from, coins)
|
||||||
output := bank.NewOutput(to, coins)
|
output := bank.NewOutput(to, coins)
|
||||||
|
|
|
@ -3,8 +3,6 @@ package bank
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -19,7 +17,7 @@ func NewCoinKeeper(am sdk.AccountMapper) CoinKeeper {
|
||||||
}
|
}
|
||||||
|
|
||||||
// SubtractCoins subtracts amt from the coins at the addr.
|
// SubtractCoins subtracts amt from the coins at the addr.
|
||||||
func (ck CoinKeeper) SubtractCoins(ctx sdk.Context, addr crypto.Address, amt sdk.Coins) (sdk.Coins, sdk.Error) {
|
func (ck CoinKeeper) SubtractCoins(ctx sdk.Context, addr sdk.Address, amt sdk.Coins) (sdk.Coins, sdk.Error) {
|
||||||
acc := ck.am.GetAccount(ctx, addr)
|
acc := ck.am.GetAccount(ctx, addr)
|
||||||
if acc == nil {
|
if acc == nil {
|
||||||
return amt, sdk.ErrUnrecognizedAddress(addr)
|
return amt, sdk.ErrUnrecognizedAddress(addr)
|
||||||
|
@ -37,7 +35,7 @@ func (ck CoinKeeper) SubtractCoins(ctx sdk.Context, addr crypto.Address, amt sdk
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddCoins adds amt to the coins at the addr.
|
// AddCoins adds amt to the coins at the addr.
|
||||||
func (ck CoinKeeper) AddCoins(ctx sdk.Context, addr crypto.Address, amt sdk.Coins) (sdk.Coins, sdk.Error) {
|
func (ck CoinKeeper) AddCoins(ctx sdk.Context, addr sdk.Address, amt sdk.Coins) (sdk.Coins, sdk.Error) {
|
||||||
acc := ck.am.GetAccount(ctx, addr)
|
acc := ck.am.GetAccount(ctx, addr)
|
||||||
if acc == nil {
|
if acc == nil {
|
||||||
acc = ck.am.NewAccountWithAddress(ctx, addr)
|
acc = ck.am.NewAccountWithAddress(ctx, addr)
|
||||||
|
|
22
x/bank/tx.go
22
x/bank/tx.go
|
@ -73,8 +73,8 @@ func (msg SendMsg) GetSignBytes() []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implements Msg.
|
// Implements Msg.
|
||||||
func (msg SendMsg) GetSigners() []crypto.Address {
|
func (msg SendMsg) GetSigners() []sdk.Address {
|
||||||
addrs := make([]crypto.Address, len(msg.Inputs))
|
addrs := make([]sdk.Address, len(msg.Inputs))
|
||||||
for i, in := range msg.Inputs {
|
for i, in := range msg.Inputs {
|
||||||
addrs[i] = in.Address
|
addrs[i] = in.Address
|
||||||
}
|
}
|
||||||
|
@ -86,12 +86,12 @@ func (msg SendMsg) GetSigners() []crypto.Address {
|
||||||
|
|
||||||
// IssueMsg - high level transaction of the coin module
|
// IssueMsg - high level transaction of the coin module
|
||||||
type IssueMsg struct {
|
type IssueMsg struct {
|
||||||
Banker crypto.Address `json:"banker"`
|
Banker sdk.Address `json:"banker"`
|
||||||
Outputs []Output `json:"outputs"`
|
Outputs []Output `json:"outputs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewIssueMsg - construct arbitrary multi-in, multi-out send msg.
|
// NewIssueMsg - construct arbitrary multi-in, multi-out send msg.
|
||||||
func NewIssueMsg(banker crypto.Address, out []Output) IssueMsg {
|
func NewIssueMsg(banker sdk.Address, out []Output) IssueMsg {
|
||||||
return IssueMsg{Banker: banker, Outputs: out}
|
return IssueMsg{Banker: banker, Outputs: out}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,15 +131,15 @@ func (msg IssueMsg) GetSignBytes() []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Implements Msg.
|
// Implements Msg.
|
||||||
func (msg IssueMsg) GetSigners() []crypto.Address {
|
func (msg IssueMsg) GetSigners() []sdk.Address {
|
||||||
return []crypto.Address{msg.Banker}
|
return []sdk.Address{msg.Banker}
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
// Input
|
// Input
|
||||||
|
|
||||||
type Input struct {
|
type Input struct {
|
||||||
Address crypto.Address `json:"address"`
|
Address sdk.Address `json:"address"`
|
||||||
Coins sdk.Coins `json:"coins"`
|
Coins sdk.Coins `json:"coins"`
|
||||||
Sequence int64 `json:"sequence"`
|
Sequence int64 `json:"sequence"`
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ func (in Input) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewInput - create a transaction input, used with SendMsg
|
// NewInput - create a transaction input, used with SendMsg
|
||||||
func NewInput(addr crypto.Address, coins sdk.Coins) Input {
|
func NewInput(addr sdk.Address, coins sdk.Coins) Input {
|
||||||
input := Input{
|
input := Input{
|
||||||
Address: addr,
|
Address: addr,
|
||||||
Coins: coins,
|
Coins: coins,
|
||||||
|
@ -177,7 +177,7 @@ func NewInput(addr crypto.Address, coins sdk.Coins) Input {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewInputWithSequence - create a transaction input, used with SendMsg
|
// NewInputWithSequence - create a transaction input, used with SendMsg
|
||||||
func NewInputWithSequence(addr crypto.Address, coins sdk.Coins, seq int64) Input {
|
func NewInputWithSequence(addr sdk.Address, coins sdk.Coins, seq int64) Input {
|
||||||
input := NewInput(addr, coins)
|
input := NewInput(addr, coins)
|
||||||
input.Sequence = seq
|
input.Sequence = seq
|
||||||
return input
|
return input
|
||||||
|
@ -187,7 +187,7 @@ func NewInputWithSequence(addr crypto.Address, coins sdk.Coins, seq int64) Input
|
||||||
// Output
|
// Output
|
||||||
|
|
||||||
type Output struct {
|
type Output struct {
|
||||||
Address crypto.Address `json:"address"`
|
Address sdk.Address `json:"address"`
|
||||||
Coins sdk.Coins `json:"coins"`
|
Coins sdk.Coins `json:"coins"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +210,7 @@ func (out Output) String() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewOutput - create a transaction output, used with SendMsg
|
// NewOutput - create a transaction output, used with SendMsg
|
||||||
func NewOutput(addr crypto.Address, coins sdk.Coins) Output {
|
func NewOutput(addr sdk.Address, coins sdk.Coins) Output {
|
||||||
output := Output{
|
output := Output{
|
||||||
Address: addr,
|
Address: addr,
|
||||||
Coins: coins,
|
Coins: coins,
|
||||||
|
|
|
@ -6,8 +6,6 @@ import (
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
crypto "github.com/tendermint/go-crypto"
|
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,14 +16,14 @@ func TestSendMsgType(t *testing.T) {
|
||||||
var msg = SendMsg{
|
var msg = SendMsg{
|
||||||
Inputs: []Input{
|
Inputs: []Input{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("input")),
|
Address: sdk.Address([]byte("input")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
Sequence: 1,
|
Sequence: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Outputs: []Output{
|
Outputs: []Output{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("output")),
|
Address: sdk.Address([]byte("output")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -36,12 +34,12 @@ func TestSendMsgType(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestInputValidation(t *testing.T) {
|
func TestInputValidation(t *testing.T) {
|
||||||
addr1 := crypto.Address([]byte{1, 2})
|
addr1 := sdk.Address([]byte{1, 2})
|
||||||
addr2 := crypto.Address([]byte{7, 8})
|
addr2 := sdk.Address([]byte{7, 8})
|
||||||
someCoins := sdk.Coins{{"atom", 123}}
|
someCoins := sdk.Coins{{"atom", 123}}
|
||||||
multiCoins := sdk.Coins{{"atom", 123}, {"eth", 20}}
|
multiCoins := sdk.Coins{{"atom", 123}, {"eth", 20}}
|
||||||
|
|
||||||
var emptyAddr crypto.Address
|
var emptyAddr sdk.Address
|
||||||
emptyCoins := sdk.Coins{}
|
emptyCoins := sdk.Coins{}
|
||||||
emptyCoins2 := sdk.Coins{{"eth", 0}}
|
emptyCoins2 := sdk.Coins{{"eth", 0}}
|
||||||
someEmptyCoins := sdk.Coins{{"eth", 10}, {"atom", 0}}
|
someEmptyCoins := sdk.Coins{{"eth", 10}, {"atom", 0}}
|
||||||
|
@ -80,12 +78,12 @@ func TestInputValidation(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestOutputValidation(t *testing.T) {
|
func TestOutputValidation(t *testing.T) {
|
||||||
addr1 := crypto.Address([]byte{1, 2})
|
addr1 := sdk.Address([]byte{1, 2})
|
||||||
addr2 := crypto.Address([]byte{7, 8})
|
addr2 := sdk.Address([]byte{7, 8})
|
||||||
someCoins := sdk.Coins{{"atom", 123}}
|
someCoins := sdk.Coins{{"atom", 123}}
|
||||||
multiCoins := sdk.Coins{{"atom", 123}, {"eth", 20}}
|
multiCoins := sdk.Coins{{"atom", 123}, {"eth", 20}}
|
||||||
|
|
||||||
var emptyAddr crypto.Address
|
var emptyAddr sdk.Address
|
||||||
emptyCoins := sdk.Coins{}
|
emptyCoins := sdk.Coins{}
|
||||||
emptyCoins2 := sdk.Coins{{"eth", 0}}
|
emptyCoins2 := sdk.Coins{{"eth", 0}}
|
||||||
someEmptyCoins := sdk.Coins{{"eth", 10}, {"atom", 0}}
|
someEmptyCoins := sdk.Coins{{"eth", 10}, {"atom", 0}}
|
||||||
|
@ -122,8 +120,8 @@ func TestOutputValidation(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSendMsgValidation(t *testing.T) {
|
func TestSendMsgValidation(t *testing.T) {
|
||||||
addr1 := crypto.Address([]byte{1, 2})
|
addr1 := sdk.Address([]byte{1, 2})
|
||||||
addr2 := crypto.Address([]byte{7, 8})
|
addr2 := sdk.Address([]byte{7, 8})
|
||||||
atom123 := sdk.Coins{{"atom", 123}}
|
atom123 := sdk.Coins{{"atom", 123}}
|
||||||
atom124 := sdk.Coins{{"atom", 124}}
|
atom124 := sdk.Coins{{"atom", 124}}
|
||||||
eth123 := sdk.Coins{{"eth", 123}}
|
eth123 := sdk.Coins{{"eth", 123}}
|
||||||
|
@ -136,7 +134,7 @@ func TestSendMsgValidation(t *testing.T) {
|
||||||
output3 := NewOutput(addr2, eth123)
|
output3 := NewOutput(addr2, eth123)
|
||||||
outputMulti := NewOutput(addr2, atom123eth123)
|
outputMulti := NewOutput(addr2, atom123eth123)
|
||||||
|
|
||||||
var emptyAddr crypto.Address
|
var emptyAddr sdk.Address
|
||||||
|
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
valid bool
|
valid bool
|
||||||
|
@ -194,14 +192,14 @@ func TestSendMsgString(t *testing.T) {
|
||||||
var msg = SendMsg{
|
var msg = SendMsg{
|
||||||
Inputs: []Input{
|
Inputs: []Input{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("input")),
|
Address: sdk.Address([]byte("input")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
Sequence: 1,
|
Sequence: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Outputs: []Output{
|
Outputs: []Output{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("output")),
|
Address: sdk.Address([]byte("output")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -215,14 +213,14 @@ func TestSendMsgGet(t *testing.T) {
|
||||||
var msg = SendMsg{
|
var msg = SendMsg{
|
||||||
Inputs: []Input{
|
Inputs: []Input{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("input")),
|
Address: sdk.Address([]byte("input")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
Sequence: 1,
|
Sequence: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Outputs: []Output{
|
Outputs: []Output{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("output")),
|
Address: sdk.Address([]byte("output")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -235,14 +233,14 @@ func TestSendMsgGetSignBytes(t *testing.T) {
|
||||||
var msg = SendMsg{
|
var msg = SendMsg{
|
||||||
Inputs: []Input{
|
Inputs: []Input{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("input")),
|
Address: sdk.Address([]byte("input")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
Sequence: 1,
|
Sequence: 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Outputs: []Output{
|
Outputs: []Output{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("output")),
|
Address: sdk.Address([]byte("output")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -256,13 +254,13 @@ func TestSendMsgGetSigners(t *testing.T) {
|
||||||
var msg = SendMsg{
|
var msg = SendMsg{
|
||||||
Inputs: []Input{
|
Inputs: []Input{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("input1")),
|
Address: sdk.Address([]byte("input1")),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("input2")),
|
Address: sdk.Address([]byte("input2")),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("input3")),
|
Address: sdk.Address([]byte("input3")),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -273,7 +271,7 @@ func TestSendMsgGetSigners(t *testing.T) {
|
||||||
/*
|
/*
|
||||||
// what to do w/ this test?
|
// what to do w/ this test?
|
||||||
func TestSendMsgSigners(t *testing.T) {
|
func TestSendMsgSigners(t *testing.T) {
|
||||||
signers := []crypto.Address{
|
signers := []sdk.Address{
|
||||||
{1, 2, 3},
|
{1, 2, 3},
|
||||||
{4, 5, 6},
|
{4, 5, 6},
|
||||||
{7, 8, 9},
|
{7, 8, 9},
|
||||||
|
@ -300,10 +298,10 @@ func TestNewIssueMsg(t *testing.T) {
|
||||||
func TestIssueMsgType(t *testing.T) {
|
func TestIssueMsgType(t *testing.T) {
|
||||||
// Construct an IssueMsg
|
// Construct an IssueMsg
|
||||||
var msg = IssueMsg{
|
var msg = IssueMsg{
|
||||||
Banker: crypto.Address([]byte("input")),
|
Banker: sdk.Address([]byte("input")),
|
||||||
Outputs: []Output{
|
Outputs: []Output{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("loan-from-bank")),
|
Address: sdk.Address([]byte("loan-from-bank")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -320,10 +318,10 @@ func TestIssueMsgValidation(t *testing.T) {
|
||||||
func TestIssueMsgString(t *testing.T) {
|
func TestIssueMsgString(t *testing.T) {
|
||||||
// Construct a IssueMsg
|
// Construct a IssueMsg
|
||||||
var msg = IssueMsg{
|
var msg = IssueMsg{
|
||||||
Banker: crypto.Address([]byte("input")),
|
Banker: sdk.Address([]byte("input")),
|
||||||
Outputs: []Output{
|
Outputs: []Output{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("loan-from-bank")),
|
Address: sdk.Address([]byte("loan-from-bank")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -334,10 +332,10 @@ func TestIssueMsgString(t *testing.T) {
|
||||||
|
|
||||||
func TestIssueMsgGet(t *testing.T) {
|
func TestIssueMsgGet(t *testing.T) {
|
||||||
var msg = IssueMsg{
|
var msg = IssueMsg{
|
||||||
Banker: crypto.Address([]byte("input")),
|
Banker: sdk.Address([]byte("input")),
|
||||||
Outputs: []Output{
|
Outputs: []Output{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("loan-from-bank")),
|
Address: sdk.Address([]byte("loan-from-bank")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -348,10 +346,10 @@ func TestIssueMsgGet(t *testing.T) {
|
||||||
|
|
||||||
func TestIssueMsgGetSignBytes(t *testing.T) {
|
func TestIssueMsgGetSignBytes(t *testing.T) {
|
||||||
var msg = IssueMsg{
|
var msg = IssueMsg{
|
||||||
Banker: crypto.Address([]byte("input")),
|
Banker: sdk.Address([]byte("input")),
|
||||||
Outputs: []Output{
|
Outputs: []Output{
|
||||||
{
|
{
|
||||||
Address: crypto.Address([]byte("loan-from-bank")),
|
Address: sdk.Address([]byte("loan-from-bank")),
|
||||||
Coins: sdk.Coins{{"atom", 10}},
|
Coins: sdk.Coins{{"atom", 10}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -363,7 +361,7 @@ func TestIssueMsgGetSignBytes(t *testing.T) {
|
||||||
|
|
||||||
func TestIssueMsgGetSigners(t *testing.T) {
|
func TestIssueMsgGetSigners(t *testing.T) {
|
||||||
var msg = IssueMsg{
|
var msg = IssueMsg{
|
||||||
Banker: crypto.Address([]byte("onlyone")),
|
Banker: sdk.Address([]byte("onlyone")),
|
||||||
}
|
}
|
||||||
res := msg.GetSigners()
|
res := msg.GetSigners()
|
||||||
assert.Equal(t, fmt.Sprintf("%v", res), "[6F6E6C796F6E65]")
|
assert.Equal(t, fmt.Sprintf("%v", res), "[6F6E6C796F6E65]")
|
||||||
|
|
Loading…
Reference in New Issue