Skip to content

Commit bb145fa

Browse files
committed
Preserve caller
1 parent 7c989b5 commit bb145fa

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

fvm/src/call_manager/default.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ where
407407

408408
fn upgrade_actor<K: Kernel<CallManager = Self>>(
409409
&mut self,
410+
caller: ActorID,
410411
actor_id: ActorID,
411412
new_code_cid: Cid,
412413
params: Option<Block>,
@@ -437,7 +438,7 @@ where
437438

438439
// run the upgrade entrypoint
439440
let result = self.send::<K>(
440-
actor_id,
441+
caller,
441442
Address::new_id(actor_id),
442443
Entrypoint::Upgrade(UpgradeInfo { old_code_cid: code }),
443444
params,

fvm/src/call_manager/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ pub trait CallManager: 'static {
120120

121121
fn upgrade_actor<K>(
122122
&mut self,
123+
caller: ActorID,
123124
actor_id: ActorID,
124125
new_code_cid: Cid,
125126
params: Option<kernel::Block>,

fvm/src/kernel/default.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,9 @@ where
887887
Some(self.blocks.get(params_id)?.clone())
888888
};
889889

890-
let result = self
891-
.call_manager
892-
.with_transaction(|cm| cm.upgrade_actor::<Self>(self.actor_id, new_code_cid, params));
890+
let result = self.call_manager.with_transaction(|cm| {
891+
cm.upgrade_actor::<Self>(self.caller, self.actor_id, new_code_cid, params)
892+
});
893893

894894
match result {
895895
Ok(InvocationResult {

0 commit comments

Comments
 (0)