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, Global>,
message_ids: &[MessageId]
) -> FuelBlock
pub fn new(
header: PartialFuelBlockHeader,
transactions: Vec<Transaction, Global>,
message_ids: &[MessageId]
) -> FuelBlock
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, Global>
) -> FuelBlock
pub fn from_db_block(
db_block: FuelBlockDb,
transactions: Vec<Transaction, Global>
) -> FuelBlock
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.
Trait Implementations§
source§impl<'de> Deserialize<'de> for FuelBlock
impl<'de> Deserialize<'de> for FuelBlock
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<FuelBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<FuelBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for FuelBlock
impl Serialize for FuelBlock
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more