Skip to content

Commit 1df034d

Browse files
authored
rename test_vm::VM to test_vm::TestVM (#1258)
1 parent 39571e2 commit 1df034d

21 files changed

+170
-145
lines changed

test_vm/src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ use std::ops::Add;
7474

7575
pub mod util;
7676

77-
pub struct VM<'bs> {
77+
pub struct TestVM<'bs> {
7878
pub store: &'bs MemoryBlockstore,
7979
pub state_root: RefCell<Cid>,
8080
total_fil: TokenAmount,
@@ -121,10 +121,10 @@ pub const TEST_FAUCET_ADDR: Address = Address::new_id(FIRST_NON_SINGLETON_ADDR +
121121
pub const FIRST_TEST_USER_ADDR: ActorID = FIRST_NON_SINGLETON_ADDR + 3;
122122

123123
// accounts for verifreg root signer and msig
124-
impl<'bs> VM<'bs> {
125-
pub fn new(store: &'bs MemoryBlockstore) -> VM<'bs> {
124+
impl<'bs> TestVM<'bs> {
125+
pub fn new(store: &'bs MemoryBlockstore) -> TestVM<'bs> {
126126
let mut actors = Hamt::<&'bs MemoryBlockstore, Actor, BytesKey, Sha256>::new(store);
127-
VM {
127+
TestVM {
128128
store,
129129
state_root: RefCell::new(actors.flush().unwrap()),
130130
total_fil: TokenAmount::zero(),
@@ -140,11 +140,11 @@ impl<'bs> VM<'bs> {
140140
Self { total_fil, ..self }
141141
}
142142

143-
pub fn new_with_singletons(store: &'bs MemoryBlockstore) -> VM<'bs> {
143+
pub fn new_with_singletons(store: &'bs MemoryBlockstore) -> TestVM<'bs> {
144144
let reward_total = TokenAmount::from_whole(1_100_000_000i64);
145145
let faucet_total = TokenAmount::from_whole(1_000_000_000i64);
146146

147-
let v = VM::new(store).with_total_fil(&reward_total + &faucet_total);
147+
let v = TestVM::new(store).with_total_fil(&reward_total + &faucet_total);
148148

149149
// system
150150
let sys_st = SystemState::new(store).unwrap();
@@ -283,9 +283,9 @@ impl<'bs> VM<'bs> {
283283
v
284284
}
285285

286-
pub fn with_epoch(self, epoch: ChainEpoch) -> VM<'bs> {
286+
pub fn with_epoch(self, epoch: ChainEpoch) -> TestVM<'bs> {
287287
self.checkpoint();
288-
VM {
288+
TestVM {
289289
store: self.store,
290290
state_root: self.state_root.clone(),
291291
total_fil: self.total_fil,
@@ -599,7 +599,7 @@ pub const TEST_VM_RAND_ARRAY: [u8; 32] = [
599599
pub const TEST_VM_INVALID_POST: &str = "i_am_invalid_post";
600600

601601
pub struct InvocationCtx<'invocation, 'bs> {
602-
v: &'invocation VM<'bs>,
602+
v: &'invocation TestVM<'bs>,
603603
top: TopCtx,
604604
msg: InternalMessage,
605605
allow_side_effects: RefCell<bool>,
@@ -1123,7 +1123,7 @@ impl<'invocation, 'bs> Runtime for InvocationCtx<'invocation, 'bs> {
11231123
}
11241124
}
11251125

1126-
impl Primitives for VM<'_> {
1126+
impl Primitives for TestVM<'_> {
11271127
// A "valid" signature has its bytes equal to the plaintext.
11281128
// Anything else is considered invalid.
11291129
fn verify_signature(

0 commit comments

Comments
 (0)