Skip to content

Commit

Permalink
Merge pull request #1 from jiangjinyuan/okcoin
Browse files Browse the repository at this point in the history
Okcoin
  • Loading branch information
jiangjinyuan authored Aug 15, 2023
2 parents d5caf8c + eca88e8 commit e99fd7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ userPathJson-*
*_address_balance.csv
venv/
origin/
package.sh
proof-of-reserves-*
*.pyc
venv
zk_STARK/build/
Expand All @@ -15,4 +17,4 @@ zk_STARK/inclusion_proof_data/*
zk_STARK/sum_proof_data/batches/*
zk_STARK/sum_proof_data/trunk/*
zk_STARK/user_data/*
.DS_Store
.DS_Store
7 changes: 4 additions & 3 deletions cmd/checkbalance/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ func VerifyCoinAddressTotalBalance(validator *common.AddressBalanceValidator, co
return
}
coinAmount, _ := decimal.NewFromString(amount)
// USDC-OKC20 precision is 18, convert to 6
if coinTemp == "USDC-OKC20" {
// USDC-OKC20/USDT-OKC20 precision is 18, convert to 6
if coinTemp == "USDC-OKC20" || coinTemp == "USDT-OKC20" {
coinAmountDecimal, _ := decimal.NewFromString(convertCoinBalanceToBaseUnit(coinTemp, coinAmount.String(), -1))
totalBalance = totalBalance.Add(coinAmountDecimal.Mul(decimal.NewFromInt(1000000)))
} else {
Expand All @@ -310,7 +310,8 @@ func VerifyCoinAddressTotalBalance(validator *common.AddressBalanceValidator, co
}

// convert coin balance to base unit
toalBalance := convertCoinBalanceToBaseUnit(coin, totalBalance.String(), -1)
dCoin := common.PorCoinUnitMap[strings.ToUpper(coin)]
toalBalance := convertCoinBalanceToBaseUnit(dCoin, totalBalance.String(), -1)
// compare
if isCoinBalanceEqual(toalBalance, totalPorBalance.String()) {
log.Infof("verify coin %s total address balance success, in chain balance: %s, in por balance: %s", coin, toalBalance, totalPorBalance.String())
Expand Down

0 comments on commit e99fd7b

Please sign in to comment.