Fix up the tx parsing for chain ids in address
This commit is contained in:
parent
4b815f4289
commit
6dc3aedc25
|
@ -123,12 +123,12 @@ func (txOut TxOutput) ChainAndAddress() ([]byte, []byte, abci.Result) {
|
|||
var chainPrefix []byte
|
||||
address := txOut.Address
|
||||
if len(address) > 20 {
|
||||
spl := bytes.Split(address, []byte("/"))
|
||||
if len(spl) < 2 {
|
||||
spl := bytes.SplitN(address, []byte("/"), 2)
|
||||
if len(spl) != 2 {
|
||||
return nil, nil, abci.ErrBaseInvalidOutput.AppendLog("Invalid address format")
|
||||
}
|
||||
chainPrefix = spl[0]
|
||||
address = bytes.Join(spl[1:], nil)
|
||||
address = spl[1]
|
||||
}
|
||||
|
||||
if len(address) != 20 {
|
||||
|
|
|
@ -133,7 +133,7 @@ func TestSendTxIBC(t *testing.T) {
|
|||
require.Nil(err)
|
||||
short, err := hex.DecodeString("1960CA7E170862837AA8F22F947194F41F610B")
|
||||
require.Nil(err)
|
||||
long, err := hex.DecodeString("1960CA7E170862837AA8F22A947194F41F6186120B")
|
||||
long, err := hex.DecodeString("1960CA7E170862837AA8F22F947194F41F6186120B")
|
||||
require.Nil(err)
|
||||
slash, err := hex.DecodeString("F40ECECEA86F29D0FDF2980EF72F1708687BD4BF")
|
||||
require.Nil(err)
|
||||
|
|
Loading…
Reference in New Issue