extended logging + timeout setting
This commit is contained in:
@@ -15,6 +15,7 @@ type Deps struct {
|
||||
Networks *rpcclient.Registry
|
||||
Storage storage.Repository
|
||||
Clock clockpkg.Clock
|
||||
RPCTimeout time.Duration
|
||||
EnsureRepository func(context.Context) error
|
||||
LaunchExecution func(transferRef, sourceWalletRef string, network shared.Network)
|
||||
}
|
||||
|
||||
@@ -122,7 +122,11 @@ func estimateNetworkFee(ctx context.Context, logger mlogger.Logger, network shar
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
timeoutCtx, cancel := context.WithTimeout(ctx, 15*time.Second)
|
||||
timeout := c.deps.RPCTimeout
|
||||
if timeout <= 0 {
|
||||
timeout = 15 * time.Second
|
||||
}
|
||||
timeoutCtx, cancel := context.WithTimeout(ctx, timeout)
|
||||
defer cancel()
|
||||
|
||||
tokenABI, err := abi.JSON(strings.NewReader(erc20TransferABI))
|
||||
|
||||
@@ -18,6 +18,7 @@ type Deps struct {
|
||||
Storage storage.Repository
|
||||
Clock clockpkg.Clock
|
||||
BalanceCacheTTL time.Duration
|
||||
RPCTimeout time.Duration
|
||||
EnsureRepository func(context.Context) error
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,11 @@ func onChainWalletBalance(ctx context.Context, deps Deps, wallet *model.ManagedW
|
||||
return nil, err
|
||||
}
|
||||
|
||||
timeoutCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
|
||||
timeout := deps.RPCTimeout
|
||||
if timeout <= 0 {
|
||||
timeout = 10 * time.Second
|
||||
}
|
||||
timeoutCtx, cancel := context.WithTimeout(ctx, timeout)
|
||||
defer cancel()
|
||||
|
||||
tokenABI, err := abi.JSON(strings.NewReader(erc20ABIJSON))
|
||||
|
||||
Reference in New Issue
Block a user