Struct fuel_core_interfaces::model::FuelBlock
source · pub struct FuelBlock { /* private fields */ }
Expand description
Fuel block with all transaction data included
Implementations§
source§impl FuelBlock
impl FuelBlock
sourcepub fn new(
header: PartialFuelBlockHeader,
transactions: Vec<Transaction>,
message_ids: &[MessageId]
) -> Self
pub fn new(
header: PartialFuelBlockHeader,
transactions: Vec<Transaction>,
message_ids: &[MessageId]
) -> Self
Create a new full fuel block from a PartialFuelBlockHeader
,
executed transactions and the [MessageId
]s.
The order of the transactions must be the same order they were executed in. The order of the messages must be the same as they were produced in.
Message ids are produced by executed the transactions and collecting the ids from the receipts of messages outputs.
sourcepub fn to_db_block(&self) -> FuelBlockDb
pub fn to_db_block(&self) -> FuelBlockDb
Create a database friendly fuel block.
sourcepub fn from_db_block(
db_block: FuelBlockDb,
transactions: Vec<Transaction>
) -> Self
pub fn from_db_block(
db_block: FuelBlockDb,
transactions: Vec<Transaction>
) -> Self
Convert from a previously stored block back to a full block
sourcepub fn transactions(&self) -> &[Transaction]
pub fn transactions(&self) -> &[Transaction]
Get the executed transactions.
sourcepub fn header(&self) -> &FuelBlockHeader
pub fn header(&self) -> &FuelBlockHeader
Get the complete header.