diff --git a/actors/market/src/v10/state.rs b/actors/market/src/v10/state.rs index 82f1d542..47f0cff9 100644 --- a/actors/market/src/v10/state.rs +++ b/actors/market/src/v10/state.rs @@ -901,22 +901,6 @@ impl State { ret } - pub fn escrow_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.escrow_table) - .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load escrow table") - } - - pub fn locked_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.locked_table) - .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load locked table") - } - // Return true when the funds in escrow for the input address can cover an additional lockup of amountToLock pub fn balance_covered( &self, @@ -927,8 +911,11 @@ impl State { where BS: Blockstore, { - let escrow_table = self.escrow_table(store)?; - let locked_table = self.locked_table(store)?; + let escrow_table = BalanceTable::from_root(store, &self.escrow_table) + .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load escrow table")?; + + let locked_table = BalanceTable::from_root(store, &self.locked_table) + .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load locked table")?; let escrow_balance = escrow_table .get(&addr) diff --git a/actors/market/src/v11/state.rs b/actors/market/src/v11/state.rs index 9930877e..fdcf4786 100644 --- a/actors/market/src/v11/state.rs +++ b/actors/market/src/v11/state.rs @@ -891,22 +891,6 @@ impl State { ret } - pub fn escrow_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.escrow_table) - .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load escrow table") - } - - pub fn locked_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.locked_table) - .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load locked table") - } - // Return true when the funds in escrow for the input address can cover an additional lockup of amountToLock pub fn balance_covered( &self, @@ -917,8 +901,11 @@ impl State { where BS: Blockstore, { - let escrow_table = self.escrow_table(store)?; - let locked_table = self.locked_table(store)?; + let escrow_table = BalanceTable::from_root(store, &self.escrow_table) + .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load escrow table")?; + + let locked_table = BalanceTable::from_root(store, &self.locked_table) + .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load locked table")?; let escrow_balance = escrow_table .get(&addr) diff --git a/actors/market/src/v12/state.rs b/actors/market/src/v12/state.rs index 1394996a..bf4ba6bf 100644 --- a/actors/market/src/v12/state.rs +++ b/actors/market/src/v12/state.rs @@ -858,20 +858,6 @@ impl State { ret } - pub fn escrow_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.escrow_table, "escrow table") - } - - pub fn locked_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.locked_table, "locked table") - } - // Return true when the funds in escrow for the input address can cover an additional lockup of amountToLock pub fn balance_covered( &self, @@ -882,8 +868,8 @@ impl State { where BS: Blockstore, { - let escrow_table = self.escrow_table(store)?; - let locked_table = self.locked_table(store)?; + let escrow_table = BalanceTable::from_root(store, &self.escrow_table, "escrow table")?; + let locked_table = BalanceTable::from_root(store, &self.locked_table, "locked table")?; let escrow_balance = escrow_table.get(&addr)?; let prev_locked = locked_table.get(&addr)?; diff --git a/actors/market/src/v13/state.rs b/actors/market/src/v13/state.rs index 13e334aa..c07bf51c 100644 --- a/actors/market/src/v13/state.rs +++ b/actors/market/src/v13/state.rs @@ -1186,20 +1186,6 @@ impl State { ret } - pub fn escrow_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.escrow_table, "escrow table") - } - - pub fn locked_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.locked_table, "locked table") - } - // Return true when the funds in escrow for the input address can cover an additional lockup of amountToLock pub fn balance_covered( &self, @@ -1207,8 +1193,8 @@ impl State { addr: Address, amount_to_lock: &TokenAmount, ) -> Result { - let escrow_table = self.escrow_table(store)?; - let locked_table = self.locked_table(store)?; + let escrow_table = BalanceTable::from_root(store, &self.escrow_table, "escrow table")?; + let locked_table = BalanceTable::from_root(store, &self.locked_table, "locked table")?; let escrow_balance = escrow_table.get(&addr)?; let prev_locked = locked_table.get(&addr)?; diff --git a/actors/market/src/v14/state.rs b/actors/market/src/v14/state.rs index 485cf14e..d4a1cd29 100644 --- a/actors/market/src/v14/state.rs +++ b/actors/market/src/v14/state.rs @@ -1174,20 +1174,6 @@ impl State { ret } - pub fn escrow_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.escrow_table, "escrow table") - } - - pub fn locked_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.locked_table, "locked table") - } - // Return true when the funds in escrow for the input address can cover an additional lockup of amountToLock pub fn balance_covered( &self, diff --git a/actors/market/src/v15/state.rs b/actors/market/src/v15/state.rs index 1a88f6b7..bfb4c152 100644 --- a/actors/market/src/v15/state.rs +++ b/actors/market/src/v15/state.rs @@ -663,20 +663,6 @@ impl State { Ok(removed) } - pub fn escrow_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.escrow_table, "escrow table") - } - - pub fn locked_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.locked_table, "locked table") - } - /// Verify that a given set of storage deals is valid for a sector currently being PreCommitted pub fn verify_deals_for_activation( &self, diff --git a/actors/market/src/v16/state.rs b/actors/market/src/v16/state.rs index 5f876379..3922e93b 100644 --- a/actors/market/src/v16/state.rs +++ b/actors/market/src/v16/state.rs @@ -664,20 +664,6 @@ impl State { Ok(removed) } - pub fn escrow_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.escrow_table, "escrow table") - } - - pub fn locked_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.locked_table, "locked table") - } - /// Verify that a given set of storage deals is valid for a sector currently being PreCommitted pub fn verify_deals_for_activation( &self, diff --git a/actors/market/src/v8/state.rs b/actors/market/src/v8/state.rs index 1461abf5..3c552e69 100644 --- a/actors/market/src/v8/state.rs +++ b/actors/market/src/v8/state.rs @@ -4,13 +4,12 @@ use super::balance_table::BalanceTable; use anyhow::anyhow; use cid::Cid; -use fil_actors_shared::v8::{make_empty_map, ActorError, Array, AsActorError as _, SetMultimap}; +use fil_actors_shared::v8::{make_empty_map, Array, SetMultimap}; use fvm_ipld_blockstore::Blockstore; use fvm_ipld_encoding::tuple::*; use fvm_shared::clock::{ChainEpoch, EPOCH_UNDEFINED}; use fvm_shared::deal::DealID; use fvm_shared::econ::TokenAmount; -use fvm_shared::error::ExitCode; use fvm_shared::HAMT_BIT_WIDTH; use super::types::*; @@ -97,20 +96,4 @@ impl State { + &self.total_provider_locked_collateral + &self.total_client_storage_fee } - - pub fn escrow_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.escrow_table) - .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load escrow table") - } - - pub fn locked_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.locked_table) - .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load locked table") - } } diff --git a/actors/market/src/v9/state.rs b/actors/market/src/v9/state.rs index 146f7dff..03b45d69 100644 --- a/actors/market/src/v9/state.rs +++ b/actors/market/src/v9/state.rs @@ -5,13 +5,12 @@ use super::balance_table::BalanceTable; use anyhow::anyhow; use cid::Cid; use fil_actor_verifreg_state::v9::AllocationID; -use fil_actors_shared::v9::{make_empty_map, ActorError, Array, AsActorError as _, SetMultimap}; +use fil_actors_shared::v9::{make_empty_map, Array, SetMultimap}; use fvm_ipld_blockstore::Blockstore; use fvm_ipld_encoding::tuple::*; use fvm_shared::clock::{ChainEpoch, EPOCH_UNDEFINED}; use fvm_shared::deal::DealID; use fvm_shared::econ::TokenAmount; -use fvm_shared::error::ExitCode; use fvm_shared::HAMT_BIT_WIDTH; use super::types::*; @@ -107,20 +106,4 @@ impl State { + &self.total_provider_locked_collateral + &self.total_client_storage_fee } - - pub fn escrow_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.escrow_table) - .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load escrow table") - } - - pub fn locked_table<'a, BS: Blockstore>( - &self, - store: &'a BS, - ) -> Result, ActorError> { - BalanceTable::from_root(store, &self.locked_table) - .context_code(ExitCode::USR_ILLEGAL_STATE, "failed to load locked table") - } } diff --git a/actors/reward/Cargo.toml b/actors/reward/Cargo.toml index 95914adf..6720681e 100644 --- a/actors/reward/Cargo.toml +++ b/actors/reward/Cargo.toml @@ -9,7 +9,6 @@ version.workspace = true keywords.workspace = true [dependencies] -fil_actor_miner_state = { workspace = true } fil_actors_shared = { workspace = true } fvm_ipld_encoding = { workspace = true } fvm_shared = { workspace = true } diff --git a/actors/reward/src/v11/state.rs b/actors/reward/src/v11/state.rs index cfd6e68b..a2ac02a5 100644 --- a/actors/reward/src/v11/state.rs +++ b/actors/reward/src/v11/state.rs @@ -145,19 +145,6 @@ impl State { pub fn into_total_storage_power_reward(self) -> TokenAmount { self.total_storage_power_reward } - - pub fn pre_commit_deposit_for_power( - &self, - reward_estimate: &FilterEstimate, - network_qa_power_estimate: &FilterEstimate, - qa_sector_power: &StoragePower, - ) -> TokenAmount { - fil_actor_miner_state::v11::pre_commit_deposit_for_power( - reward_estimate, - network_qa_power_estimate, - qa_sector_power, - ) - } } /// Defines vestion function type for reward actor. diff --git a/actors/reward/src/v12/state.rs b/actors/reward/src/v12/state.rs index 539395cb..c11f773f 100644 --- a/actors/reward/src/v12/state.rs +++ b/actors/reward/src/v12/state.rs @@ -135,19 +135,6 @@ impl State { pub fn into_total_storage_power_reward(self) -> TokenAmount { self.total_storage_power_reward } - - pub fn pre_commit_deposit_for_power( - &self, - reward_estimate: &FilterEstimate, - network_qa_power_estimate: &FilterEstimate, - qa_sector_power: &StoragePower, - ) -> TokenAmount { - fil_actor_miner_state::v12::pre_commit_deposit_for_power( - reward_estimate, - network_qa_power_estimate, - qa_sector_power, - ) - } } /// Defines vestion function type for reward actor. diff --git a/actors/reward/src/v13/state.rs b/actors/reward/src/v13/state.rs index 53120860..c11f773f 100644 --- a/actors/reward/src/v13/state.rs +++ b/actors/reward/src/v13/state.rs @@ -135,19 +135,6 @@ impl State { pub fn into_total_storage_power_reward(self) -> TokenAmount { self.total_storage_power_reward } - - pub fn pre_commit_deposit_for_power( - &self, - reward_estimate: &FilterEstimate, - network_qa_power_estimate: &FilterEstimate, - qa_sector_power: &StoragePower, - ) -> TokenAmount { - fil_actor_miner_state::v13::pre_commit_deposit_for_power( - reward_estimate, - network_qa_power_estimate, - qa_sector_power, - ) - } } /// Defines vestion function type for reward actor. diff --git a/actors/reward/src/v14/state.rs b/actors/reward/src/v14/state.rs index cb21cb73..be879f9d 100644 --- a/actors/reward/src/v14/state.rs +++ b/actors/reward/src/v14/state.rs @@ -150,19 +150,6 @@ impl State { pub fn into_total_storage_power_reward(self) -> TokenAmount { self.total_storage_power_reward } - - pub fn pre_commit_deposit_for_power( - &self, - reward_estimate: &FilterEstimate, - network_qa_power_estimate: &FilterEstimate, - qa_sector_power: &StoragePower, - ) -> TokenAmount { - fil_actor_miner_state::v14::pre_commit_deposit_for_power( - reward_estimate, - network_qa_power_estimate, - qa_sector_power, - ) - } } /// Defines vestion function type for reward actor. diff --git a/actors/reward/src/v15/state.rs b/actors/reward/src/v15/state.rs index 333ad63c..6407254a 100644 --- a/actors/reward/src/v15/state.rs +++ b/actors/reward/src/v15/state.rs @@ -151,19 +151,6 @@ impl State { pub fn into_total_storage_power_reward(self) -> TokenAmount { self.total_storage_power_reward } - - pub fn pre_commit_deposit_for_power( - &self, - reward_estimate: &FilterEstimate, - network_qa_power_estimate: &FilterEstimate, - qa_sector_power: &StoragePower, - ) -> TokenAmount { - fil_actor_miner_state::v15::pre_commit_deposit_for_power( - reward_estimate, - network_qa_power_estimate, - qa_sector_power, - ) - } } /// Defines vestion function type for reward actor. diff --git a/actors/reward/src/v16/state.rs b/actors/reward/src/v16/state.rs index bd7bf958..15356824 100644 --- a/actors/reward/src/v16/state.rs +++ b/actors/reward/src/v16/state.rs @@ -151,19 +151,6 @@ impl State { pub fn into_total_storage_power_reward(self) -> TokenAmount { self.total_storage_power_reward } - - pub fn pre_commit_deposit_for_power( - &self, - reward_estimate: &FilterEstimate, - network_qa_power_estimate: &FilterEstimate, - qa_sector_power: &StoragePower, - ) -> TokenAmount { - fil_actor_miner_state::v16::pre_commit_deposit_for_power( - reward_estimate, - network_qa_power_estimate, - qa_sector_power, - ) - } } /// Defines vestion function type for reward actor.