MCPcopy Create free account
hub / github.com/consensus-shipyard/ipc / new_fund_msg

Method new_fund_msg

ipc/api/src/cross.rs:67–92  ·  view source on GitHub ↗
(
        sub_id: &SubnetID,
        from: &Address,
        to: &Address,
        value: TokenAmount,
    )

Source from the content-addressed store, hash-verified

65 }
66
67 pub fn new_fund_msg(
68 sub_id: &SubnetID,
69 from: &Address,
70 to: &Address,
71 value: TokenAmount,
72 ) -> anyhow::Result<Self> {
73 let from = IPCAddress::new(
74 &match sub_id.parent() {
75 Some(s) => s,
76 None => return Err(anyhow!("error getting parent for subnet addr")),
77 },
78 from,
79 )?;
80 let to = IPCAddress::new(sub_id, to)?;
81
82 // the nonce and the rest of message fields are set when the message is committed.
83 Ok(Self {
84 kind: IpcMsgKind::Transfer,
85 from,
86 to,
87 value,
88 local_nonce: 0,
89 original_nonce: 0,
90 message: Default::default(),
91 })
92 }
93
94 pub fn ipc_type(&self) -> anyhow::Result<IPCMsgType> {
95 let sto = self.to.subnet()?;

Callers

nothing calls this directly

Calls 1

parentMethod · 0.45

Tested by

no test coverage detected