Skip to content

Latest commit

 

History

History
235 lines (122 loc) · 7.71 KB

TransactionTimeoutConfig.md

File metadata and controls

235 lines (122 loc) · 7.71 KB

Module 0x1::TransactionTimeoutConfig

Onchain configuration for timeout setting of transaction.

Struct TransactionTimeoutConfig

config structs.

struct TransactionTimeoutConfig has copy, drop, store
Fields
duration_seconds: u64
timeout in second.

Function initialize

Initialize function. Should only be called in genesis.

public fun initialize(account: &signer, duration_seconds: u64)
Implementation
public fun initialize(account: &signer, duration_seconds: u64) {
    Timestamp::assert_genesis();
    CoreAddresses::assert_genesis_address(account);

    Config::publish_new_config<Self::TransactionTimeoutConfig>(
        account,
        new_transaction_timeout_config(duration_seconds)
    );
}
Specification

Function new_transaction_timeout_config

Create a new timeout config used in dao proposal.

Implementation
public fun new_transaction_timeout_config(duration_seconds: u64) : TransactionTimeoutConfig {
    TransactionTimeoutConfig {duration_seconds: duration_seconds}
}
Specification
aborts_if false;

Function get_transaction_timeout_config

Get current timeout config.

Implementation
Specification

Function duration_seconds

Get current txn timeout in seconds.

public fun duration_seconds(): u64
Implementation
public fun duration_seconds() :u64 {
    let config = get_transaction_timeout_config();
    config.duration_seconds
}
Specification

Module Specification

pragma verify = false;
pragma aborts_if_is_strict = true;