pub fn from_sql_issue(
        table_value: SqlIssue,
        fraction_bits: u8,
    ) -> Result<Issue, SqlCacheError> {
        Ok(Issue {
            id: NodeId::from_hex(&table_value.node_id[..])?,
            asset_id: ContractId::from_hex(&table_value.contract_id[..])?,
            amount: AccountingAmount::from_fractioned_accounting_value(
                fraction_bits,
                table_value.amount as AccountingValue,
            ),
            origin: match (table_value.origin_txid, table_value.origin_vout) {
                (Some(txid), Some(vout)) => Some(OutPoint {
                    txid: Txid::from_hex(&txid[..])?,
                    vout: vout as u32,
                }),
                _ => None,
            },
        })
    }
/// Create an Issue structure from reading the corresponding
/// Issue table entry in the database.
Create an Issue structure from reading the corresponding
Issue table entry in the database.
Create an Issue structure from reading the corresponding Issue table entry in the database .
pub fn from_sql_issue(
        table_value: SqlIssue,
        fraction_bits: u8,
    ) -> Result<Issue, SqlCacheError> {
        Ok(Issue {
            id: NodeId::from_hex(&table_value.node_id[..])?,
            asset_id: ContractId::from_hex(&table_value.contract_id[..])?,
            amount: AccountingAmount::from_fractioned_accounting_value(
                fraction_bits,
                table_value.amount as AccountingValue,
            ),
            origin: match (table_value.origin_txid, table_value.origin_vout) {
                (Some(txid), Some(vout)) => Some(OutPoint {
                    txid: Txid::from_hex(&txid[..])?,
                    vout: vout as u32,
                }),
                _ => None,
            },
        })
    }
pub fn from_sql_issue ( table_value : SqlIssue , fraction_bits : u8 , ) -> Result < Issue , SqlCacheError > { Ok ( Issue { id : NodeId :: from_hex ( & table_value . node_id [ .. ] ) ? , asset_id : ContractId :: from_hex ( & table_value . contract_id [ .. ] ) ? , amount : AccountingAmount :: from_fractioned_accounting_value ( fraction_bits , table_value . amount as AccountingValue , ) , origin : match ( table_value . origin_txid , table_value . origin_vout ) { ( Some ( txid ) , Some ( vout ) ) => Some ( OutPoint { txid : Txid :: from_hex ( & txid [ .. ] ) ? , vout : vout as u32 , } ) , _ => None , } , } ) }
Create an Issue structure from reading the corresponding
Issue table entry in the database.
Create an Issue structure from reading the corresponding Issue table entry in the database .
table_value
SqlIssue
fraction_bits
u8
table_value
SqlIssue
fraction_bits
u8