Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 30 variants Account, Amount, Name, NotALedger, HashMismatch, Outpoint, ZeroTransfer, Insufficient { account: String, has: u64, wanted: u64, }, WithdrawalTooSmall, DepositLedgerHash, RequestLedgerHash, Op, NoDestination, NotARequest, Unverified, OtherLedger, OpAndId, PayoutTooSmall, Rate, NotCovered { held: u64, amount: u64, }, ScriptCheck { input: usize, reason: String, }, FeeBelowRate { vsize: u64, fee: u64, rate: u64, }, Key(&'static str), Address(String), Encoding { what: &'static str, reason: String, }, Sighash { input: usize, reason: &'static str, }, Event(String), NotALedgerEvent, LedgerContent(String), NotTheOperators,
}
Expand description

Everything the teller refuses, in its own words.

Variants§

§

Account

accountOf: not did:nostr:<x>, a bare x or a did:nostr Multikey.

§

Amount

sats: not a whole number of satoshis between 0 and 21 million coins.

§

Name

newLedger: the name is empty or longer than 80 characters.

§

NotALedger

checkLedger: not a WebLedger, or no genesis.

§

HashMismatch

checkLedger: the stored hash is not the hash of the genesis.

§

Outpoint

credit: the outpoint is not <64 lowercase hex>:<vout>.

§

ZeroTransfer

transfer: an amount of zero.

§

Insufficient

transfer, debit: the account holds less than the amount.

Fields

§account: String

The first 20 characters of the account’s did (did:nostr: and ten hex digits), as the teller writes it.

§has: u64

The balance the account holds.

§wanted: u64

The amount asked for.

§

WithdrawalTooSmall

debit: below crate::MIN_PAY.

§

DepositLedgerHash

depositAddress: the ledger hash is not 64 lowercase hex.

§

RequestLedgerHash

requestTags: the ledger hash is not 64 lowercase hex.

§

Op

requestTags: an op other than join, withdraw or transfer.

§

NoDestination

requestTags, parseRequest: a withdrawal or transfer with no to.

§

NotARequest

parseRequest: not kind 3700.

§

Unverified

parseRequest: the id or the signature does not verify.

§

OtherLedger

parseRequest: the ledger tag names another ledger.

§

OpAndId

parseRequest: no valid op, or no id of 8 to 64 lowercase hex.

§

PayoutTooSmall

planPayout: below crate::MIN_PAY.

§

Rate

planPayout: a fee rate outside 1 to 1000 sat/vB.

§

NotCovered

planPayout: every coin together cannot pay the amount and the fee.

Fields

§held: u64

The sum of every coin offered.

§amount: u64

The amount to pay.

§

ScriptCheck

signPayout: an input failed the chain’s script check.

Fields

§input: usize

The input’s index.

§reason: String

The verifier’s reason.

§

FeeBelowRate

signPayout: the signed transaction is bigger than the fee pays for.

Fields

§vsize: u64

The signed transaction’s virtual size.

§fee: u64

The plan’s fee.

§rate: u64

The plan’s rate.

§

Key(&'static str)

A key, point, tweak or scalar refused by the key rule (sidestr/spec siding/lib/keys.mjs), in its words.

§

Address(String)

Not a segwit script under that prefix (address.mjs scriptToAddress returns null; this port refuses).

§

Encoding

A script or txid that is not hex of the right shape (this port: the teller writes whatever it is given and the kernel’s codec refuses it).

Fields

§what: &'static str

Which field.

§reason: String

Why it was refused.

§

Sighash

The chain’s signature hash could not be computed for an input.

Fields

§input: usize

The input’s index.

§reason: &'static str

The reason the sighash refused.

§

Event(String)

A Nostr event could not be built or signed (sidestr-nostr’s reason).

§

NotALedgerEvent

This port’s reading of a ledger event (kind 30333), which the teller’s page does inline: not kind 30333.

§

LedgerContent(String)

This port: the ledger event’s content is not a ledger document.

§

NotTheOperators

This port: a ledger event not signed by the ledger’s operator, or for another ledger (the page drops both: “the operator’s own word only”).

Trait Implementations§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Self

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 Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Eq for Error

Source§

impl Error for Error

1.30.0 · 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
Source§

impl PartialEq for Error

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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.