Skip to main content

TxStatus

Enum TxStatus 

Source
pub enum TxStatus {
    Success,
    InvalidSignature,
    InvalidNonce,
    InsufficientBalance,
    InvalidChainId,
    Failed(u32),
}
Expand description

Status of a transaction after execution

Variants§

§

Success

Transaction executed successfully

§

InvalidSignature

Transaction failed - invalid signature

§

InvalidNonce

Transaction failed - wrong nonce

§

InsufficientBalance

Transaction failed - insufficient balance

§

InvalidChainId

Transaction failed - invalid chain ID

§

Failed(u32)

Transaction failed - other reason

Implementations§

Source§

impl TxStatus

Source

pub fn is_success(&self) -> bool

Check if transaction succeeded

Source

pub fn description(&self) -> &'static str

Get a human-readable description.

Failed(u32) codes are mapped here so chain_getTransactionStatus (and any other receipt-surfacing path) emits the specific reason. Allocated codes:

  • 22 — V2 RegisterEncryptionKey: rejected a low/small-order X25519 public key. Validation lives in sumchain_crypto::is_low_order_x25519_public_key (separate crate; sumchain-primitives does not depend on sumchain-crypto, so this is a plain reference rather than an intra-doc link).

Allocated codes (kept in sync with executor dispatch):

  • 20 — V2 NodeRegistry dispatch failed (generic) — falls through to "failed" until per-op reasons are added.
  • 21 — V2 StorageMetadata dispatch failed (generic) — falls through.
  • 22RegisterEncryptionKey rejected a low/small-order X25519 public key. See sumchain_crypto::is_low_order_x25519_public_key.
  • 30RegisterFilePendingV2 validity failure (size/chunk caps, visibility/bundle/owner rules, recipient X25519 missing, collision).
  • 31AbandonFileV2 validity failure (state/owner/grace).
  • 32 — V2 storage op accepted by the dispatcher but not yet implemented in the current checkpoint (placeholder for 1c stubs).
  • 33AcceptAssignmentV2 validity failure (file state, snapshot membership, per-tx cap, index range, index-not-assigned).
  • 34ActivateFileV2 validity failure (state/owner/incomplete chunk coverage).
  • 35AddAccessV2 / RemoveAccessV2 / UpdateAccessV2 validity failure (file state/owner/visibility-bundle/X25519/duplicate/missing/ byte-cap).
  • 40 — V2 storage protocol not enabled at this block height. Set v2_enabled_from_height in the chain’s genesis to opt in. Distinct from validity codes 30–35: this is a chain-level gate rejection, no fee consumed; safe to retry after activation.

Trait Implementations§

Source§

impl Clone for TxStatus

Source§

fn clone(&self) -> TxStatus

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TxStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TxStatus

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TxStatus

Source§

fn eq(&self, other: &TxStatus) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TxStatus

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for TxStatus

Source§

impl Eq for TxStatus

Source§

impl StructuralPartialEq for TxStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,