pub fn from_box_candidate(
        box_candidate: &ErgoBoxCandidate,
        transaction_id: TxId,
        index: u16,
    ) -> ErgoBox {
        let box_with_zero_id = ErgoBox {
            box_id: BoxId::zero(),
            value: box_candidate.value.clone(),
            ergo_tree: box_candidate.ergo_tree.clone(),
            tokens: box_candidate.tokens.clone(),
            additional_registers: box_candidate.additional_registers.clone(),
            creation_height: box_candidate.creation_height,
            transaction_id,
            index,
        };
        let box_id = box_with_zero_id.calc_box_id();
        ErgoBox {
            box_id,
            ..box_with_zero_id
        }
    }
/// Create ErgoBox from ErgoBoxCandidate by adding transaction id
/// and index of the box in the transaction
Create ErgoBox from ErgoBoxCandidate by adding transaction id
and index of the box in the transaction
Create ErgoBox from ErgoBoxCandidate by adding transaction id and index of the box in the transaction
pub fn from_box_candidate(
        box_candidate: &ErgoBoxCandidate,
        transaction_id: TxId,
        index: u16,
    ) -> ErgoBox {
        let box_with_zero_id = ErgoBox {
            box_id: BoxId::zero(),
            value: box_candidate.value.clone(),
            ergo_tree: box_candidate.ergo_tree.clone(),
            tokens: box_candidate.tokens.clone(),
            additional_registers: box_candidate.additional_registers.clone(),
            creation_height: box_candidate.creation_height,
            transaction_id,
            index,
        };
        let box_id = box_with_zero_id.calc_box_id();
        ErgoBox {
            box_id,
            ..box_with_zero_id
        }
    }
pub fn from_box_candidate ( box_candidate : & ErgoBoxCandidate , transaction_id : TxId , index : u16 , ) -> ErgoBox { let box_with_zero_id = ErgoBox { box_id : BoxId :: zero ( ) , value : box_candidate . value . clone ( ) , ergo_tree : box_candidate . ergo_tree . clone ( ) , tokens : box_candidate . tokens . clone ( ) , additional_registers : box_candidate . additional_registers . clone ( ) , creation_height : box_candidate . creation_height , transaction_id , index , } ; let box_id = box_with_zero_id . calc_box_id ( ) ; ErgoBox { box_id , .. box_with_zero_id } }
Create ErgoBox from ErgoBoxCandidate by adding transaction id
and index of the box in the transaction
Create ErgoBox from ErgoBoxCandidate by adding transaction id and index of the box in the transaction
box_candidate
&ErgoBoxCandidate
transaction_id
TxId
index
u16
box_candidate
&ErgoBoxCandidate
transaction_id
TxId
index
u16