Commit 77762595 authored by hezhengjun's avatar hezhengjun

correct log info

parent 59965d2c
...@@ -40,27 +40,35 @@ func checkMintPara(mint *evmxgotypes.EvmxgoMint, tx2lock *types.Transaction, db ...@@ -40,27 +40,35 @@ func checkMintPara(mint *evmxgotypes.EvmxgoMint, tx2lock *types.Transaction, db
return err return err
} }
var recipient, bridgeToken string
var amount int64
correct := 0 correct := 0
for _, para := range unpack { for _, para := range unpack {
switch para.Name { switch para.Name {
case "_recipient": case "_recipient":
if mint.Recipient != para.Value { recipient = para.Value.(string)
if mint.Recipient != recipient {
return errors.New("Not consitent recipient address") return errors.New("Not consitent recipient address")
} }
correct++ correct++
case "_amount": case "_amount":
if mint.Amount != para.Value.(*big.Int).Int64() { amount = para.Value.(*big.Int).Int64()
if mint.Amount != amount {
return errors.New("Not consitent Amount") return errors.New("Not consitent Amount")
} }
correct++ correct++
case "_token": case "_token":
if mint.BridgeToken != para.Value { bridgeToken = para.Value.(string)
if mint.BridgeToken != bridgeToken {
return errors.New("Not consitent token Address") return errors.New("Not consitent token Address")
} }
correct++ correct++
} }
} }
elog.Info("checkMintPara", "lock parameter unpacked ", unpack) elog.Info("checkMintPara", "lock parameter unpacked _recipient ", recipient, "bridgeToken", bridgeToken,
"amount", amount)
if correct != 3 { if correct != 3 {
return errors.New("not check all the points: _recipient, _amount, _token") return errors.New("not check all the points: _recipient, _amount, _token")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment