Struct near_primitives::receipt::Receipt
source · pub struct Receipt {
pub predecessor_id: AccountId,
pub receiver_id: AccountId,
pub receipt_id: CryptoHash,
pub receipt: ReceiptEnum,
}
Expand description
Receipts are used for a cross-shard communication.
Receipts could be 2 types (determined by a ReceiptEnum
): ReceiptEnum::Action
of ReceiptEnum::Data
.
Fields§
§predecessor_id: AccountId
An issuer account_id of a particular receipt.
predecessor_id
could be either Transaction
signer_id
or intermediate contract’s account_id
.
receiver_id: AccountId
receiver_id
is a receipt destination.
receipt_id: CryptoHash
An unique id for the receipt
receipt: ReceiptEnum
A receipt type
Implementations§
source§impl Receipt
impl Receipt
sourcepub fn get_hash(&self) -> CryptoHash
pub fn get_hash(&self) -> CryptoHash
It’s not a content hash, but receipt_id is unique.
sourcepub fn new_balance_refund(receiver_id: &AccountId, refund: Balance) -> Self
pub fn new_balance_refund(receiver_id: &AccountId, refund: Balance) -> Self
Generates a receipt with a transfer from system for a given balance without a receipt_id.
This should be used for token refunds instead of gas refunds. It doesn’t refund the
allowance of the access key. For gas refunds use new_gas_refund
.
sourcepub fn new_gas_refund(
receiver_id: &AccountId,
refund: Balance,
signer_public_key: PublicKey
) -> Self
pub fn new_gas_refund( receiver_id: &AccountId, refund: Balance, signer_public_key: PublicKey ) -> Self
Generates a receipt with a transfer action from system for a given balance without a
receipt_id. It contains signer_id
and signer_public_key
to indicate this is a gas
refund. The execution of this receipt will try to refund the allowance of the
access key with the given public key.
NOTE: The access key may be replaced by the owner, so the execution can’t rely that the
access key is the same and it should use best effort for the refund.
Trait Implementations§
source§impl Borrow<CryptoHash> for Receipt
impl Borrow<CryptoHash> for Receipt
source§fn borrow(&self) -> &CryptoHash
fn borrow(&self) -> &CryptoHash
source§impl BorshDeserialize for Receipt
impl BorshDeserialize for Receipt
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for Receipt
impl BorshSerialize for Receipt
source§impl<'de> Deserialize<'de> for Receipt
impl<'de> Deserialize<'de> for Receipt
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<Receipt> for ReceiptView
impl From<Receipt> for ReceiptView
source§impl PartialEq for Receipt
impl PartialEq for Receipt
source§impl TryFrom<ReceiptView> for Receipt
impl TryFrom<ReceiptView> for Receipt
impl Eq for Receipt
impl StructuralPartialEq for Receipt
Auto Trait Implementations§
impl Freeze for Receipt
impl RefUnwindSafe for Receipt
impl Send for Receipt
impl Sync for Receipt
impl Unpin for Receipt
impl UnwindSafe for Receipt
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more