MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / new_fund_msg

Method new_fund_msg

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

parentMethod · 0.45

Tested by

no test coverage detected