@@ -18,7 +18,7 @@ use fil_actors_runtime::cbor::serialize;
18
18
use fil_actors_runtime:: runtime:: builtins:: Type ;
19
19
use fil_actors_runtime:: runtime:: {
20
20
ActorCode , DomainSeparationTag , MessageInfo , Policy , Primitives , Runtime , RuntimePolicy ,
21
- Verifier ,
21
+ Verifier , EMPTY_ARR_CID ,
22
22
} ;
23
23
use fil_actors_runtime:: test_utils:: * ;
24
24
use fil_actors_runtime:: MessageAccumulator ;
@@ -70,7 +70,6 @@ pub struct VM<'bs> {
70
70
total_fil : TokenAmount ,
71
71
actors_dirty : RefCell < bool > ,
72
72
actors_cache : RefCell < HashMap < Address , Actor > > ,
73
- empty_obj_cid : Cid ,
74
73
network_version : NetworkVersion ,
75
74
curr_epoch : ChainEpoch ,
76
75
invocations : RefCell < Vec < InvocationTrace > > ,
@@ -115,14 +114,12 @@ pub const FIRST_TEST_USER_ADDR: ActorID = FIRST_NON_SINGLETON_ADDR + 3;
115
114
impl < ' bs > VM < ' bs > {
116
115
pub fn new ( store : & ' bs MemoryBlockstore ) -> VM < ' bs > {
117
116
let mut actors = Hamt :: < & ' bs MemoryBlockstore , Actor , BytesKey , Sha256 > :: new ( store) ;
118
- let empty = store. put_cbor ( & ( ) , Code :: Blake2b256 ) . unwrap ( ) ;
119
117
VM {
120
118
store,
121
119
state_root : RefCell :: new ( actors. flush ( ) . unwrap ( ) ) ,
122
120
total_fil : TokenAmount :: zero ( ) ,
123
121
actors_dirty : RefCell :: new ( false ) ,
124
122
actors_cache : RefCell :: new ( HashMap :: new ( ) ) ,
125
- empty_obj_cid : empty,
126
123
network_version : NetworkVersion :: V16 ,
127
124
curr_epoch : ChainEpoch :: zero ( ) ,
128
125
invocations : RefCell :: new ( vec ! [ ] ) ,
@@ -260,7 +257,6 @@ impl<'bs> VM<'bs> {
260
257
total_fil : self . total_fil ,
261
258
actors_dirty : RefCell :: new ( false ) ,
262
259
actors_cache : RefCell :: new ( HashMap :: new ( ) ) ,
263
- empty_obj_cid : self . empty_obj_cid ,
264
260
network_version : self . network_version ,
265
261
curr_epoch : epoch,
266
262
invocations : RefCell :: new ( vec ! [ ] ) ,
@@ -691,7 +687,7 @@ impl<'invocation, 'bs> Runtime<&'bs MemoryBlockstore> for InvocationCtx<'invocat
691
687
"attempt to create new actor at existing address" . to_string ( ) ,
692
688
) ) ;
693
689
}
694
- let a = actor ( code_id, self . v . empty_obj_cid , 0 , TokenAmount :: zero ( ) ) ;
690
+ let a = actor ( code_id, EMPTY_ARR_CID , 0 , TokenAmount :: zero ( ) ) ;
695
691
self . v . set_actor ( addr, a) ;
696
692
Ok ( ( ) )
697
693
}
@@ -846,7 +842,7 @@ impl<'invocation, 'bs> Runtime<&'bs MemoryBlockstore> for InvocationCtx<'invocat
846
842
"failed to create state" . to_string ( ) ,
847
843
) ) ,
848
844
Some ( mut act) => {
849
- if act. head != self . v . empty_obj_cid {
845
+ if act. head != EMPTY_ARR_CID {
850
846
Err ( ActorError :: unchecked (
851
847
ExitCode :: SYS_ASSERTION_FAILED ,
852
848
"failed to construct state: already initialized" . to_string ( ) ,
0 commit comments