Merge pull request 'fixed tron address conversion' (#427) from tron-425 into main
All checks were successful
ci/woodpecker/push/gateway_tron Pipeline was successful
All checks were successful
ci/woodpecker/push/gateway_tron Pipeline was successful
Reviewed-on: #427
This commit was merged in pull request #427.
This commit is contained in:
@@ -62,7 +62,7 @@ const erc20ABIJSON = `
|
||||
}
|
||||
]`
|
||||
|
||||
func TronBase58ToHex(addr string) (string, error) {
|
||||
func tronBase58ToHex(addr string) (string, error) {
|
||||
const (
|
||||
tronAddrLen = 25
|
||||
tronPrefix = byte(0x41)
|
||||
@@ -467,7 +467,11 @@ func SubmitTransfer(ctx context.Context, deps driver.Deps, network shared.Networ
|
||||
|
||||
chainID := new(big.Int).SetUint64(network.ChainID)
|
||||
|
||||
contract := strings.TrimSpace(transfer.ContractAddress)
|
||||
contract, err := tronBase58ToHex(strings.TrimSpace(transfer.ContractAddress))
|
||||
if err != nil {
|
||||
logger.Warn("Failed to convert contract address", zap.String("contract_address", transfer.ContractAddress))
|
||||
return "", err
|
||||
}
|
||||
amount := transfer.NetAmount
|
||||
if amount == nil || strings.TrimSpace(amount.Amount) == "" {
|
||||
logger.Warn("Transfer missing net amount", zap.String("transfer_ref", transfer.TransferRef))
|
||||
|
||||
Reference in New Issue
Block a user