fixed balance fetch
This commit is contained in:
@@ -155,7 +155,11 @@ func Balance(ctx context.Context, deps driver.Deps, network shared.Network, wall
|
||||
return nil, merrors.Internal("network rpc url is not configured")
|
||||
}
|
||||
|
||||
contract := strings.TrimSpace(wallet.ContractAddress)
|
||||
contract, err := tronBase58ToHex(strings.TrimSpace(wallet.ContractAddress))
|
||||
if err != nil {
|
||||
logger.Warn("Failed to convert contract address", zap.String("contract_address", wallet.ContractAddress))
|
||||
return nil, err
|
||||
}
|
||||
if contract == "" {
|
||||
logger.Debug("Native balance requested", logFields...)
|
||||
return NativeBalance(ctx, deps, network, wallet, normalizedAddress)
|
||||
|
||||
Reference in New Issue
Block a user