Fix broken API
This commit is contained in:
parent
54b162f5c3
commit
0eed032a75
|
@ -39,25 +39,33 @@ type sendCommander struct {
|
|||
}
|
||||
|
||||
func (c sendCommander) sendIBCTransfer(cmd *cobra.Command, args []string) error {
|
||||
// get the from address
|
||||
from, err := builder.GetFromAddress()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// build the message
|
||||
msg, err := buildMsg(from)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("%+v\n", msg)
|
||||
// get password
|
||||
name := viper.GetString(client.FlagName)
|
||||
buf := client.BufferStdin()
|
||||
prompt := fmt.Sprintf("Password to sign with '%s':", name)
|
||||
passphrase, err := client.GetPassword(prompt, buf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
res, err := builder.SignBuildBroadcast(msg, c.cdc)
|
||||
res, err := builder.SignBuildBroadcast(name, passphrase, msg, c.cdc)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("Committed at block %d. Hash: %s\n", res.Height, res.Hash.String())
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -147,12 +147,22 @@ func (c relayCommander) refine(bz []byte, sequence int64) []byte {
|
|||
panic(err)
|
||||
}
|
||||
|
||||
// get password
|
||||
name := viper.GetString(client.FlagName)
|
||||
buf := client.BufferStdin()
|
||||
prompt := fmt.Sprintf("Password to sign with '%s':", name)
|
||||
passphrase, err := client.GetPassword(prompt, buf)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
msg := ibc.IBCReceiveMsg{
|
||||
IBCPacket: packet,
|
||||
Relayer: c.address,
|
||||
Sequence: sequence,
|
||||
}
|
||||
res, err := builder.SignAndBuild(msg, c.cdc)
|
||||
|
||||
res, err := builder.SignAndBuild(name, passphrase, msg, c.cdc)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue