Merge pull request #615 from hermeznetwork/fix/l2txs-all-tonull

API doesnt accept pool txs without to
This commit is contained in:
Eduard S
2021-03-08 15:24:35 +01:00
committed by GitHub
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"))