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
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.
ScriptCheck
signPayout: an input failed the chain’s script check.
FeeBelowRate
signPayout: the signed transaction is bigger than the fee pays for.
Fields
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).
Sighash
The chain’s signature hash could not be computed for an input.
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§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
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> 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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.