wallet search fix

This commit is contained in:
Stephan D
2025-12-26 14:09:16 +01:00
parent 34a565d86d
commit be7c965234
23 changed files with 180 additions and 188 deletions

View File

@@ -47,32 +47,32 @@ type onChainExecutor struct {
func (o *onChainExecutor) SubmitTransfer(ctx context.Context, transfer *model.Transfer, source *model.ManagedWallet, destinationAddress string, network shared.Network) (string, error) {
if o.keyManager == nil {
o.logger.Warn("key manager not configured")
o.logger.Warn("Key manager not configured")
return "", executorInternal("key manager is not configured", nil)
}
rpcURL := strings.TrimSpace(network.RPCURL)
if rpcURL == "" {
o.logger.Warn("network rpc url missing", zap.String("network", network.Name))
o.logger.Warn("Network rpc url missing", zap.String("network", network.Name))
return "", executorInvalid("network rpc url is not configured")
}
if source == nil || transfer == nil {
o.logger.Warn("transfer context missing")
o.logger.Warn("Transfer context missing")
return "", executorInvalid("transfer context missing")
}
if strings.TrimSpace(source.KeyReference) == "" {
o.logger.Warn("source wallet missing key reference", zap.String("wallet_ref", source.WalletRef))
o.logger.Warn("Source wallet missing key reference", zap.String("wallet_ref", source.WalletRef))
return "", executorInvalid("source wallet missing key reference")
}
if strings.TrimSpace(source.DepositAddress) == "" {
o.logger.Warn("source wallet missing deposit address", zap.String("wallet_ref", source.WalletRef))
o.logger.Warn("Source wallet missing deposit address", zap.String("wallet_ref", source.WalletRef))
return "", executorInvalid("source wallet missing deposit address")
}
if !common.IsHexAddress(destinationAddress) {
o.logger.Warn("invalid destination address", zap.String("transfer_ref", transfer.TransferRef), zap.String("address", destinationAddress))
o.logger.Warn("Invalid destination address", zap.String("transfer_ref", transfer.TransferRef), zap.String("address", destinationAddress))
return "", executorInvalid("invalid destination address " + destinationAddress)
}
o.logger.Info("submitting transfer",
o.logger.Info("Submitting transfer",
zap.String("transfer_ref", transfer.TransferRef),
zap.String("source_wallet_ref", source.WalletRef),
zap.String("network", network.Name),
@@ -162,7 +162,7 @@ func (o *onChainExecutor) SubmitTransfer(ctx context.Context, transfer *model.Tr
input, err := erc20ABI.Pack("transfer", destination, amountInt)
if err != nil {
o.logger.Warn("failed to encode transfer call",
o.logger.Warn("Failed to encode transfer call",
zap.String("transfer_ref", transfer.TransferRef),
zap.Error(err),
)