Skip to content

Commit

Permalink
add check
Browse files Browse the repository at this point in the history
  • Loading branch information
wincenteam committed Jun 15, 2019
1 parent 23fc765 commit 6823374
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/ethapi/api_exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func isString(input []byte) bool {

type ReceptionArgs struct {
Addr hexutil.Bytes
Currency string
Currency Smbol
Value *Big
}

Expand All @@ -114,6 +114,9 @@ func (args GenTxArgs) check() error {
if err != nil {
return err
}
if rec.Currency.IsEmpty() {
return errors.Errorf("%v reception currency is nil", hexutil.Encode(rec.Addr[:]))
}
if rec.Value == nil {
return errors.Errorf("%v reception value is nil", hexutil.Encode(rec.Addr[:]))
}
Expand Down Expand Up @@ -145,7 +148,7 @@ func (args GenTxArgs) toTxParam() exchange.TxParam {
pkr := byteToPkr(rec.Addr)
receptions = append(receptions, exchange.Reception{
pkr,
rec.Currency,
string(rec.Currency),
(*big.Int)(rec.Value),
})
}
Expand Down

0 comments on commit 6823374

Please sign in to comment.