API doesnt accept pool txs without to

This commit is contained in:
arnaubennassar
2021-03-04 18:24:30 +01:00
parent 9e96bc89f0
commit 81690039da
2 changed files with 77 additions and 0 deletions

View File

@@ -101,6 +101,8 @@ func (tx *PoolL2Tx) SetType() error {
tx.Type = TxTypeTransferToBJJ
} else if tx.ToEthAddr != FFAddr && tx.ToEthAddr != EmptyAddr {
tx.Type = TxTypeTransferToEthAddr
} else {
return tracerr.Wrap(errors.New("malformed transaction"))
}
} else {
return tracerr.Wrap(errors.New("malformed transaction"))