pub struct Contract(_);
Expand description
Deployable representation of a contract code.
Implementations
sourceimpl Contract
impl Contract
sourcepub fn root(&self) -> Bytes32
pub fn root(&self) -> Bytes32
Calculate the code root of the contract, using Self::root_from_code
.
sourcepub fn root_from_code<B>(bytes: B) -> Bytes32where
B: AsRef<[u8]>,
pub fn root_from_code<B>(bytes: B) -> Bytes32where
B: AsRef<[u8]>,
Calculate the code root from a contract.
https://github.com/FuelLabs/fuel-specs/blob/master/specs/protocol/identifiers.md#contract-id
sourcepub fn initial_state_root<'a, I>(storage_slots: I) -> Bytes32where
I: Iterator<Item = &'a StorageSlot>,
pub fn initial_state_root<'a, I>(storage_slots: I) -> Bytes32where
I: Iterator<Item = &'a StorageSlot>,
Calculate the root of the initial storage slots for this contract
sourcepub fn default_state_root() -> Bytes32
pub fn default_state_root() -> Bytes32
The default state root value without any entries
sourcepub fn id(&self, salt: &Salt, root: &Bytes32, state_root: &Bytes32) -> ContractId
pub fn id(&self, salt: &Salt, root: &Bytes32, state_root: &Bytes32) -> ContractId
Calculate and return the contract id, provided a salt, code root and state root.
https://github.com/FuelLabs/fuel-specs/blob/master/specs/protocol/identifiers.md#contract-id
Trait Implementations
sourceimpl TryFrom<&Transaction> for Contract
impl TryFrom<&Transaction> for Contract
type Error = CheckError
type Error = CheckError
The type returned in the event of a conversion error.
sourcefn try_from(tx: &Transaction) -> Result<Self, Self::Error>
fn try_from(tx: &Transaction) -> Result<Self, Self::Error>
Performs the conversion.
impl Eq for Contract
impl StructuralEq for Contract
impl StructuralPartialEq for Contract
Auto Trait Implementations
impl RefUnwindSafe for Contract
impl Send for Contract
impl Sync for Contract
impl Unpin for Contract
impl UnwindSafe for Contract
Blanket Implementations
impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T> StorageAsMut for T
impl<'a, T> StorageAsMut for T
fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where
Type: Mappable,
impl<'a, T> StorageAsRef for T
impl<'a, T> StorageAsRef for T
fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where
Type: Mappable,
sourceimpl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere
T: AsRef<[u8]>,
sourcefn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
) Read moresourcefn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
) Read more