Commit 3d1e43e8 authored by QM's avatar QM

update

parent 332419b5
......@@ -128,7 +128,7 @@ function TestETH2Chain33USDT_proxy() {
# shellcheck disable=SC2154
result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 12 * le8
# is_equal "${result}" "1200000000"
is_equal "${result}" "1200000000"
result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33Validatorsp})")
is_equal "${result}" "0"
......@@ -151,11 +151,11 @@ function TestETH2Chain33USDT_proxy() {
result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33ReceiverAddr})")
is_equal "${result}" "0"
result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33Validatorsp})")
# is_equal "${result}" "1200000000"
is_equal "${result}" "1200000000"
# 查询 ETH 这端 bridgeBank 地址 0
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumUSDTERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0"
cli_ret "${result}" "balance" ".balance" "12"
# 更新后的金额 12
result=$(${CLIA} ethereum balance -o "${ethReceiverAddr1}" -t "${ethereumUSDTERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "11"
......
......@@ -588,12 +588,6 @@ func (ethRelayer *Relayer4Ethereum) handleLogWithdraw(chain33Msg *events.Chain33
return
}
//检查用户提币权限是否得到满足:比如是否超过累计提币额度
var feeAmount *big.Int
if feeAmount, err = ethRelayer.checkPermissionWithinOneDay(withdrawTx); nil != err {
return
}
tokenAddr := common.HexToAddress(withdrawFromChain33TokenInfo.Address)
//从chain33进行withdraw回来的token需要根据精度进行相应的缩放
if 8 != withdrawFromChain33TokenInfo.Decimal {
......@@ -617,8 +611,15 @@ func (ethRelayer *Relayer4Ethereum) handleLogWithdraw(chain33Msg *events.Chain33
chain33Msg.Amount.Div(chain33Msg.Amount, big.NewInt(value))
}
}
withdrawTx.Amount = chain33Msg.Amount.String()
relayerLog.Info("handleLogWithdraw", "token address", tokenAddr.String(), "amount", chain33Msg.Amount.String(),
"Receiver on Ethereum", chain33Msg.EthereumReceiver.String())
//检查用户提币权限是否得到满足:比如是否超过累计提币额度
var feeAmount *big.Int
if feeAmount, err = ethRelayer.checkPermissionWithinOneDay(withdrawTx); nil != err {
return
}
if chain33Msg.Amount.Cmp(feeAmount) < 0 {
relayerLog.Error("handleLogWithdraw", "ErrWithdrawAmountLessThanFee feeAmount", feeAmount.String(), "Withdraw Amount", chain33Msg.Amount.String())
err = errors.New("ErrWithdrawAmountLessThanFee")
......
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