Skip to content

Commit

Permalink
Update VM trait (#1340)
Browse files Browse the repository at this point in the history
* update VM trait to align with anorth/fvm-workbench

* update tests to check invariants on the concrete types

* Revert "update tests to check invariants on the concrete types"

This reverts commit 8351d66.

* wip

* extract policy out of VM trait

* add set circulating supply onto the trait

* use static builtin-actors manifest
  • Loading branch information
alexytsu authored Jul 31, 2023
1 parent a77674d commit 64a103e
Show file tree
Hide file tree
Showing 19 changed files with 325 additions and 242 deletions.
6 changes: 3 additions & 3 deletions state/src/check.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::collections::BTreeMap;
use std::collections::HashMap;
use std::fmt::Debug;

use anyhow::bail;
use bimap::BiBTreeMap;
use cid::Cid;
use fil_actor_account::State as AccountState;
use fil_actor_cron::State as CronState;
Expand Down Expand Up @@ -114,7 +114,7 @@ macro_rules! get_state {
// It could be replaced with a custom mapping trait (while Rust doesn't support
// abstract collection traits).
pub fn check_state_invariants<BS: Blockstore>(
manifest: &BiBTreeMap<Cid, Type>,
manifest: &BTreeMap<Cid, Type>,
policy: &Policy,
tree: Tree<'_, BS>,
expected_balance_total: &TokenAmount,
Expand Down Expand Up @@ -143,7 +143,7 @@ pub fn check_state_invariants<BS: Blockstore>(
}
total_fil += &actor.balance;

match manifest.get_by_left(&actor.code) {
match manifest.get(&actor.code) {
Some(Type::System) => (),
Some(Type::Init) => {
let state = get_state!(tree, actor, InitState);
Expand Down
Loading

0 comments on commit 64a103e

Please sign in to comment.