Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/node/dkg/src/ceremony.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ pub struct DkgCeremony {

impl DkgCeremony {
/// Create a new DKG ceremony.
#[must_use]
pub const fn new(config: DkgConfig) -> Self {
Self { config, force_restart: false }
}

/// Create a new DKG ceremony with force restart (ignores existing state).
#[must_use]
pub const fn new_with_force_restart(config: DkgConfig, force_restart: bool) -> Self {
Self { config, force_restart }
}
Expand Down
1 change: 1 addition & 0 deletions crates/node/domain/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct AllocationJson {

impl BootstrapConfig {
/// Create a new bootstrap configuration.
#[must_use]
pub const fn new(genesis_alloc: Vec<(Address, U256)>, bootstrap_txs: Vec<Tx>) -> Self {
Self { genesis_alloc, bootstrap_txs }
}
Expand Down
1 change: 1 addition & 0 deletions crates/node/domain/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ impl Tx {
}

/// Create a new transaction from encoded bytes.
#[must_use]
pub const fn new(bytes: Bytes) -> Self {
Self { bytes }
}
Expand Down
2 changes: 2 additions & 0 deletions crates/node/executor/src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ pub struct StateDbAdapter<S> {

impl<S> StateDbAdapter<S> {
/// Create a new adapter wrapping the given state.
#[must_use]
pub const fn new(state: S) -> Self {
Self { state }
}

/// Get the underlying state reference.
#[must_use]
pub const fn state(&self) -> &S {
&self.state
}
Expand Down
1 change: 1 addition & 0 deletions crates/node/executor/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub struct BlockContext {

impl BlockContext {
/// Create a new block context.
#[must_use]
pub const fn new(header: Header, parent_hash: B256, prevrandao: B256) -> Self {
Self { header, parent_hash, prevrandao, blob_base_fee: None }
}
Expand Down
2 changes: 2 additions & 0 deletions crates/node/executor/src/revm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ pub struct RevmExecutor {

impl RevmExecutor {
/// Create a new REVM executor with the given chain ID.
#[must_use]
pub const fn new(chain_id: u64) -> Self {
Self { config: ExecutionConfig::new(chain_id) }
}

/// Create a new REVM executor with full configuration.
#[must_use]
pub const fn with_config(config: ExecutionConfig) -> Self {
Self { config }
}
Expand Down
1 change: 1 addition & 0 deletions crates/node/rpc/src/indexed_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub struct IndexedStateProvider<S> {

impl<S> IndexedStateProvider<S> {
/// Creates a new indexed state provider.
#[must_use]
pub const fn new(index: Arc<BlockIndex>, state: S) -> Self {
Self { index, state }
}
Expand Down
1 change: 1 addition & 0 deletions crates/node/rpc/src/kora.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub struct KoraApiImpl {

impl KoraApiImpl {
/// Create a new Kora API implementation.
#[must_use]
pub const fn new(state: Arc<NodeState>) -> Self {
Self { state }
}
Expand Down
7 changes: 7 additions & 0 deletions crates/storage/backend/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl std::fmt::Debug for CommonwareRootProvider {

impl CommonwareRootProvider {
/// Create a new root provider from the given context and config.
#[must_use]
pub const fn new(context: Context, config: QmdbBackendConfig) -> Self {
Self { context, config }
}
Expand All @@ -69,31 +70,37 @@ impl CommonwareBackend {
}

/// Get a reference to the accounts store.
#[must_use]
pub const fn accounts(&self) -> &AccountStore {
&self.accounts
}

/// Get a mutable reference to the accounts store.
#[must_use]
pub const fn accounts_mut(&mut self) -> &mut AccountStore {
&mut self.accounts
}

/// Get a reference to the storage store.
#[must_use]
pub const fn storage(&self) -> &StorageStore {
&self.storage
}

/// Get a mutable reference to the storage store.
#[must_use]
pub const fn storage_mut(&mut self) -> &mut StorageStore {
&mut self.storage
}

/// Get a reference to the code store.
#[must_use]
pub const fn code(&self) -> &CodeStore {
&self.code
}

/// Get a mutable reference to the code store.
#[must_use]
pub const fn code_mut(&mut self) -> &mut CodeStore {
&mut self.code
}
Expand Down
1 change: 1 addition & 0 deletions crates/storage/qmdb/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub struct StorageKey {

impl StorageKey {
/// Create a new storage key.
#[must_use]
pub const fn new(address: Address, generation: u64, slot: U256) -> Self {
Self { address, generation, slot }
}
Expand Down