/// create enqeue for message
/// create envelope message
/// all fee from message
create enqeue for message
create envelope message
all fee from message
create enqeue for message create envelope message all fee from message
pub fn new(msg: &Message, shard: &ShardIdent) -> Result<Self> {
        let header = msg.int_header().ok_or_else(|| error!("message must be internal"))?;
        let fwd_fee = &header.fwd_fee;
        let created_lt = header.created_lt;
        let enqueued_lt = header.created_lt;
        let src_prefix = AccountIdPrefixFull::prefix(&msg.src().unwrap_or_default())?;
        let dst_prefix = AccountIdPrefixFull::prefix(&header.dst)?;
        let env = if !shard.contains_full_prefix(&dst_prefix) {
            MsgEnvelope::hypercube_routing(msg, shard, fwd_fee.clone())?
        } else {
            MsgEnvelope::with_message_and_fee(msg, fwd_fee.clone())?
        };
        let cur_prefix  = src_prefix.interpolate_addr_intermediate(&dst_prefix, env.cur_addr())?;
        let next_prefix = src_prefix.interpolate_addr_intermediate(&dst_prefix, env.next_addr())?;
        let msg = msg.clone();
        let enq = EnqueuedMsg::with_param(enqueued_lt, &env)?;
        Ok(Self{
            enq,
            env,
            msg,
            created_lt,
            enqueued_lt,
            src_prefix,
            dst_prefix,
            cur_prefix,
            next_prefix,
        })
    }
pub fn new ( msg : & Message , shard : & ShardIdent ) -> Result < Self > { let header = msg . int_header ( ) . ok_or_else ( | | error ! ( " " ) ) ? ; let fwd_fee = & header . fwd_fee ; let created_lt = header . created_lt ; let enqueued_lt = header . created_lt ; let src_prefix = AccountIdPrefixFull :: prefix ( & msg . src ( ) . unwrap_or_default ( ) ) ? ; let dst_prefix = AccountIdPrefixFull :: prefix ( & header . dst ) ? ; let env = if ! shard . contains_full_prefix ( & dst_prefix ) { MsgEnvelope :: hypercube_routing ( msg , shard , fwd_fee . clone ( ) ) ? } else { MsgEnvelope :: with_message_and_fee ( msg , fwd_fee . clone ( ) ) ? } ; let cur_prefix = src_prefix . interpolate_addr_intermediate ( & dst_prefix , env . cur_addr ( ) ) ? ; let next_prefix = src_prefix . interpolate_addr_intermediate ( & dst_prefix , env . next_addr ( ) ) ? ; let msg = msg . clone ( ) ; let enq = EnqueuedMsg :: with_param ( enqueued_lt , & env ) ? ; Ok ( Self { enq , env , msg , created_lt , enqueued_lt , src_prefix , dst_prefix , cur_prefix , next_prefix , } ) }
create enqeue for message
create envelope message
all fee from message
create enqeue for message create envelope message all fee from message
msg
&Message
shard
&ShardIdent