pub fn from_sql_allocation(
        table_value: &SqlAllocation,
        outpoint: &SqlAllocationUtxo,
    ) -> Result<Self, SqlCacheError> {
        Ok(Self {
            node_id: NodeId::from_hex(&table_value.node_id[..])?,
            index: table_value.assignment_index as u16,
            outpoint: OutPoint {
                txid: Txid::from_hex(&outpoint.txid[..])?,
                vout: outpoint.vout as u32,
            },
            value: value::Revealed {
                value: table_value.amount as AtomicValue,
                blinding: SecretKey::from_slice(
                    &Secp256k1::new(),
                    &Vec::<u8>::from_hex(&table_value.blinding[..])?[..],
                )?,
            },
        })
    }
/// Create an Allocation structure by reading the
/// corresponding Allocation and AllocationUtxo table entries.
Create an Allocation structure by reading the
corresponding Allocation and AllocationUtxo table entries.
Create an Allocation structure by reading the corresponding Allocation and AllocationUtxo table entries .
pub fn from_sql_allocation(
        table_value: &SqlAllocation,
        outpoint: &SqlAllocationUtxo,
    ) -> Result<Self, SqlCacheError> {
        Ok(Self {
            node_id: NodeId::from_hex(&table_value.node_id[..])?,
            index: table_value.assignment_index as u16,
            outpoint: OutPoint {
                txid: Txid::from_hex(&outpoint.txid[..])?,
                vout: outpoint.vout as u32,
            },
            value: value::Revealed {
                value: table_value.amount as AtomicValue,
                blinding: SecretKey::from_slice(
                    &Secp256k1::new(),
                    &Vec::<u8>::from_hex(&table_value.blinding[..])?[..],
                )?,
            },
        })
    }
pub fn from_sql_allocation ( table_value : & SqlAllocation , outpoint : & SqlAllocationUtxo , ) -> Result < Self , SqlCacheError > { Ok ( Self { node_id : NodeId :: from_hex ( & table_value . node_id [ .. ] ) ? , index : table_value . assignment_index as u16 , outpoint : OutPoint { txid : Txid :: from_hex ( & outpoint . txid [ .. ] ) ? , vout : outpoint . vout as u32 , } , value : value :: Revealed { value : table_value . amount as AtomicValue , blinding : SecretKey :: from_slice ( & Secp256k1 :: new ( ) , & Vec :: < u8 > :: from_hex ( & table_value . blinding [ .. ] ) ? [ .. ] , ) ? , } , } ) }
Create an Allocation structure by reading the
corresponding Allocation and AllocationUtxo table entries.
Create an Allocation structure by reading the corresponding Allocation and AllocationUtxo table entries .
table_value
&SqlAllocation
outpoint
&SqlAllocationUtxo
table_value
&SqlAllocation
outpoint
&SqlAllocationUtxo