Skip to main content

TestkitError

Enum TestkitError 

Source
#[non_exhaustive]
pub enum TestkitError {
Show 46 variants MissingFaucet, FundingRequestMismatch { recipient: ContractAddress, }, ReceiptHashMismatch { expected: TxHash, receipt: Box<TransactionReceipt>, }, Submission { tx_hash: TxHash, signed_transaction: String, detail: String, source: Box<dyn Error + Send + Sync>, }, UnverifiedDeployment { tx_hash: TxHash, predicted_address: ContractAddress, signed_transaction: String, detail: Box<str>, source: Option<Box<TestkitError>>, receipt: Option<Box<TransactionReceipt>>, }, DeploymentRequestMismatch { name: String, }, NoNetwork, Rpc { method: &'static str, detail: String, }, Offline { operation: &'static str, }, ManifestLoad { path: String, detail: String, }, ManifestSchema { actual: u32, }, Manifest { field: &'static str, detail: String, }, UnsupportedDerivationScheme { scheme: String, }, NoBootstrapAccounts, BootstrapPublicKeyMismatch { index: u32, }, NotEnoughAccounts { needed: usize, available: usize, }, DuplicateAgent { name: String, }, AgentsFailed { failures: AgentFailures, }, NonceExhausted { index: u32, }, Signing { detail: String, }, Encode { detail: String, }, Decode { detail: String, }, InvalidContractVersion { version: String, }, Deploy { detail: String, }, Reverted { method: String, status: String, }, NoReturn { kind: &'static str, detail: String, }, ReceiptWait { source: Box<ReceiptPollError>, }, NativeCall { method: &'static str, source: Box<NativeClientError>, }, InvalidFundingEvidence { detail: String, retained: Option<Box<(TxHash, HexBytes)>>, source: Box<NativeClientError>, }, InvalidFundingResponse { retained: Option<Box<(TxHash, HexBytes)>>, response: Box<FundingSubmission>, detail: String, }, UnsupportedResponse { method: &'static str, raw: Value, }, NativeEndpoint { source: Box<NativeRpcError>, }, PendingTimeout { tx_hash: String, last_status: Box<TransactionStatus>, }, TransactionNotPending { tx_hash: String, status: Box<TransactionStatus>, }, ManualBlockProductionUnavailable, BlockProduction { source: BlockProductionError, }, ArtifactLoad { name: String, path: String, detail: String, }, UnknownArtifactExtension { path: String, }, DuplicateArtifact { name: String, }, UnknownArtifact { name: String, }, ArtifactRegistrationPending { name: String, tx_hash: TxHash, signed_transaction: String, }, NodeSupervisor { detail: String, }, MissingRuntimeManifest, UnknownAgent { name: String, }, MailboxClosed { name: String, }, AgentJoin { detail: String, },
}
Expand description

Errors returned by the harness while building or running a scenario.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MissingFaucet

The runtime manifest has no faucet account to fund test accounts.

§

FundingRequestMismatch

A pending request must be reconciled before changing its amount.

Fields

§recipient: ContractAddress

Recipient with retained funding intent.

§

ReceiptHashMismatch

A receipt belongs to another transaction.

Fields

§expected: TxHash

Locally computed transaction identity.

§receipt: Box<TransactionReceipt>

Complete conflicting receipt, including its claimed commitment and execution.

§

Submission

An ambiguous submission retains the exact original signed transaction.

Fields

§tx_hash: TxHash

Locally computed transaction identity.

§signed_transaction: String

Exact signed bytes. Observe the original hash before any further action.

§detail: String

Transport error or unexpected returned identity.

§source: Box<dyn Error + Send + Sync>

Original structured submission or funding failure.

§

UnverifiedDeployment

A submitted deployment could not be verified; preserve the original attempt.

Fields

§tx_hash: TxHash

Locally computed transaction identity.

§predicted_address: ContractAddress

Address predicted from the signed deployment effects.

§signed_transaction: String

Exact original signed bytes for reconciliation.

§detail: Box<str>

Failed receipt lookup or verification.

§source: Option<Box<TestkitError>>

Original receipt-wait evidence, when waiting stopped before validation.

§receipt: Option<Box<TransactionReceipt>>

Authoritative receipt whose deployment return did not match the prediction.

§

DeploymentRequestMismatch

Retained deployment effects differ from a new request by the same caller.

Fields

§name: String

Artifact with the retained attempt.

§

NoNetwork

A scenario was built without a network configuration.

§

Rpc

A JSON-RPC call to the target failed.

Fields

§method: &'static str

The RPC method that failed.

§detail: String

Underlying error description.

§

Offline

A chain operation was attempted against an offline target.

Fields

§operation: &'static str

The attempted operation.

§

ManifestLoad

The runtime manifest could not be read or parsed.

Fields

§path: String

Manifest path.

§detail: String

Underlying error description.

§

ManifestSchema

The runtime manifest declared an unsupported schema version.

Fields

§actual: u32

The version found in the manifest.

§

Manifest

A field could not be read from the runtime manifest.

Fields

§field: &'static str

The manifest field at fault.

§detail: String

Underlying error description.

§

UnsupportedDerivationScheme

The manifest used a bootstrap-account derivation scheme we do not support.

Fields

§scheme: String

The scheme string found in the manifest.

§

NoBootstrapAccounts

The manifest carried no bootstrap accounts to assign to agents.

§

BootstrapPublicKeyMismatch

A derived signer did not match the public key the manifest advertised.

Fields

§index: u32

The bootstrap account index at fault.

§

NotEnoughAccounts

The scenario has fewer accounts than it has agents.

Fields

§needed: usize

Number of agents that need accounts.

§available: usize

Number of accounts available.

§

DuplicateAgent

Two agents in one run were given the same name.

Fields

§name: String

The duplicated agent name.

§

AgentsFailed

One or more agent bodies returned errors.

Fields

§failures: AgentFailures

All returned agent errors, ordered by agent position.

§

NonceExhausted

An account exhausted its per-account nonce sequence.

Fields

§index: u32

The account index at fault.

§

Signing

Building or signing a transaction failed.

Fields

§detail: String

Underlying error description.

§

Encode

Encoding calldata or a contract failed.

Fields

§detail: String

Underlying error description.

§

Decode

Decoding a contract return value failed.

Fields

§detail: String

Underlying error description.

§

InvalidContractVersion

A contract interface version is not valid SemVer.

Fields

§version: String

Version string used to derive the method selector.

§

Deploy

A deploy transaction did not execute successfully.

Fields

§detail: String

Description of the failing execution status.

§

Reverted

A contract call executed but its status was not Ok.

Carries the method name; add call-site context with map_err where that alone does not identify which call reverted.

Fields

§method: String

The method that was called.

§status: String

Description of the failing execution status.

§

NoReturn

A contract call or view did not return successfully.

Fields

§kind: &'static str

Whether it was a call or a view.

§detail: String

Description of the non-returning status.

§

ReceiptWait

Receipt waiting stopped with retained status, commitment and read errors.

Fields

§source: Box<ReceiptPollError>

Wait cause plus the strongest observed commitment and status.

§

NativeCall

Native RPC failure, retaining the original application or malformed result.

Fields

§method: &'static str

Native method that failed.

§source: Box<NativeClientError>

Original RPC error or malformed result, including raw data.

§

InvalidFundingEvidence

Funding evidence could not be validated; retain the original RPC failure.

Fields

§detail: String

Why the supplied evidence could not be accepted.

§retained: Option<Box<(TxHash, HexBytes)>>

Original validated hash and signed bytes, if already retained.

§source: Box<NativeClientError>

Original RPC error carrying the conflicting or invalid evidence.

§

InvalidFundingResponse

A funding result conflicts with the retained request or its signed identity.

Fields

§retained: Option<Box<(TxHash, HexBytes)>>

Original validated hash and signed bytes, if already retained.

§response: Box<FundingSubmission>

Complete supplied result, retained without accepting its identity.

§detail: String

Why the response conflicts with the request or original evidence.

§

UnsupportedResponse

An unfamiliar response is retained without asserting its meaning.

Fields

§method: &'static str

Native method that returned an unfamiliar result.

§raw: Value

Complete result, retained without interpreting unknown variants.

§

NativeEndpoint

Endpoint compatibility or identity validation failed.

Fields

§source: Box<NativeRpcError>

Compatibility, identity or discovery failure with its original evidence.

§

PendingTimeout

A submitted transaction did not become pending before the polling budget elapsed.

Fields

§tx_hash: String

Transaction hash that never appeared as pending.

§last_status: Box<TransactionStatus>

Last status observed before timeout.

§

TransactionNotPending

A submitted transaction reached a terminal or unexpected state before becoming pending.

Fields

§tx_hash: String

Transaction hash whose status was observed.

§status: Box<TransactionStatus>

Status observed instead of Pending.

§

ManualBlockProductionUnavailable

Manual block production is unavailable for this target or driver mode.

§

BlockProduction

The local supervisor failed to produce a manually-requested block.

Fields

§source: BlockProductionError

Underlying supervisor block-production error.

§

ArtifactLoad

A contract artifact could not be read from disk.

Fields

§name: String

Registry name of the artifact.

§path: String

Path that failed to load.

§detail: String

Underlying error description.

§

UnknownArtifactExtension

A file artifact had an extension the harness does not recognize.

Fields

§path: String

The path whose extension was unrecognized.

§

DuplicateArtifact

Two artifacts were registered under the same name.

Fields

§name: String

The duplicated artifact name.

§

UnknownArtifact

An agent referenced an artifact name that was never registered.

Fields

§name: String

The unrecognized artifact name.

§

ArtifactRegistrationPending

An artifact registration transaction is still awaiting a receipt.

Fields

§name: String

Registry artifact name.

§tx_hash: TxHash

Transaction currently registering the artifact.

§signed_transaction: String

Original signed bytes for explicit caller-controlled reconciliation.

§

NodeSupervisor

The local node supervisor failed to start or stop the target.

Fields

§detail: String

Underlying error description.

§

MissingRuntimeManifest

A started local node did not advertise a runtime manifest.

§

UnknownAgent

A message was addressed to an agent that is not part of the scenario.

Fields

§name: String

The unrecognized recipient name.

§

MailboxClosed

The recipient agent’s mailbox was already closed.

Fields

§name: String

The recipient whose mailbox is closed.

§

AgentJoin

An agent task failed to join for a reason other than a panic.

Fields

§detail: String

Description of the join failure.

Trait Implementations§

Source§

impl Debug for TestkitError

Source§

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

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

impl Display for TestkitError

Source§

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

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

impl Error for TestkitError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> MaybeSend for T
where T: Send,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StaticIfNoAlloc for T

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more