dash_sdk/platform/transition/
put_settings.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use std::time::Duration;

use dpp::prelude::UserFeeIncrease;
use rs_dapi_client::RequestSettings;

/// The options when putting something to platform
#[derive(Debug, Clone, Copy, Default)]
pub struct PutSettings {
    pub request_settings: RequestSettings,
    pub identity_nonce_stale_time_s: Option<u64>,
    pub user_fee_increase: Option<UserFeeIncrease>,
    /// Soft limit of total time to wait for state transition to be executed (included in a block).
    ///
    /// This is an upper limit, and other settings may affect the actual wait time
    /// (like DAPI timeouts, [RequestSettings::timeout], [RequestSettings::retries], etc.).
    /// If you want to use `wait_timeout`, tune `retries` accordingly.
    ///
    /// It can be exceeded due to execution of non-cancellable parts of the Sdk.
    // TODO: Simplify timeout logic when waiting for response in Sdk, as having 3 different timeouts is confusing.
    pub wait_timeout: Option<Duration>,
}

impl From<PutSettings> for RequestSettings {
    fn from(settings: PutSettings) -> Self {
        settings.request_settings
    }
}