Method
new_release_msg
(
sub_id: &SubnetID,
from: &Address,
to: &Address,
value: TokenAmount,
)
Source from the content-addressed store, hash-verified
| 37 | |
| 38 | impl IpcEnvelope { |
| 39 | pub fn new_release_msg( |
| 40 | sub_id: &SubnetID, |
| 41 | from: &Address, |
| 42 | to: &Address, |
| 43 | value: TokenAmount, |
| 44 | ) -> anyhow::Result<Self> { |
| 45 | let to = IPCAddress::new( |
| 46 | &match sub_id.parent() { |
| 47 | Some(s) => s, |
| 48 | None => return Err(anyhow!("error getting parent for subnet addr")), |
| 49 | }, |
| 50 | to, |
| 51 | )?; |
| 52 | |
| 53 | let from = IPCAddress::new(sub_id, from)?; |
| 54 | Ok(Self { |
| 55 | kind: IpcMsgKind::Transfer, |
| 56 | from, |
| 57 | to, |
| 58 | value, |
| 59 | nonce: 0, |
| 60 | message: Default::default(), |
| 61 | }) |
| 62 | } |
| 63 | |
| 64 | pub fn new_fund_msg( |
| 65 | sub_id: &SubnetID, |
Callers
nothing calls this directly
Tested by
no test coverage detected