@@ -443,8 +443,6 @@ pub enum Error {
443
443
Unexpected ( String ) ,
444
444
/// Name of a fragment contained `:` multiple times
445
445
MultiColon ( String ) ,
446
- /// Name of a fragment contained `@` multiple times
447
- MultiAt ( String ) ,
448
446
/// Name of a fragment contained `@` but we were not parsing an OR
449
447
AtOutsideOr ( String ) ,
450
448
/// Encountered a wrapping character that we don't recognize
@@ -453,16 +451,8 @@ pub enum Error {
453
451
NonTopLevel ( String ) ,
454
452
/// Parsed a miniscript but there were more script opcodes after it
455
453
Trailing ( String ) ,
456
- /// Failed to parse a push as a public key
457
- BadPubkey ( bitcoin:: key:: Error ) ,
458
- /// Could not satisfy a script (fragment) because of a missing hash preimage
459
- MissingHash ( sha256:: Hash ) ,
460
454
/// Could not satisfy a script (fragment) because of a missing signature
461
455
MissingSig ( bitcoin:: PublicKey ) ,
462
- /// Could not satisfy, relative locktime not met
463
- RelativeLocktimeNotMet ( u32 ) ,
464
- /// Could not satisfy, absolute locktime not met
465
- AbsoluteLocktimeNotMet ( u32 ) ,
466
456
/// General failure to satisfy
467
457
CouldNotSatisfy ,
468
458
/// Typechecking failed
@@ -482,8 +472,6 @@ pub enum Error {
482
472
ContextError ( miniscript:: context:: ScriptContextError ) ,
483
473
/// Recursion depth exceeded when parsing policy/miniscript from string
484
474
MaxRecursiveDepthExceeded ,
485
- /// Script size too large
486
- ScriptSizeTooLarge ,
487
475
/// Anything but c:pk(key) (P2PK), c:pk_h(key) (P2PKH), and thresh_m(k,...)
488
476
/// up to n=3 is invalid by standardness (bare)
489
477
NonStandardBareScript ,
@@ -495,12 +483,8 @@ pub enum Error {
495
483
BareDescriptorAddr ,
496
484
/// PubKey invalid under current context
497
485
PubKeyCtxError ( miniscript:: decode:: KeyParseError , & ' static str ) ,
498
- /// Attempted to call function that requires PreComputed taproot info
499
- TaprootSpendInfoUnavialable ,
500
486
/// No script code for Tr descriptors
501
487
TrNoScriptCode ,
502
- /// No explicit script for Tr descriptors
503
- TrNoExplicitScript ,
504
488
/// At least two BIP389 key expressions in the descriptor contain tuples of
505
489
/// derivation indexes of different lengths.
506
490
MultipathDescLenMismatch ,
@@ -512,8 +496,6 @@ pub enum Error {
512
496
513
497
// https://github.com/sipa/miniscript/pull/5 for discussion on this number
514
498
const MAX_RECURSION_DEPTH : u32 = 402 ;
515
- // https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki
516
- const MAX_SCRIPT_SIZE : u32 = 10000 ;
517
499
518
500
impl fmt:: Display for Error {
519
501
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
@@ -531,23 +513,12 @@ impl fmt::Display for Error {
531
513
Error :: UnexpectedStart => f. write_str ( "unexpected start of script" ) ,
532
514
Error :: Unexpected ( ref s) => write ! ( f, "unexpected «{}»" , s) ,
533
515
Error :: MultiColon ( ref s) => write ! ( f, "«{}» has multiple instances of «:»" , s) ,
534
- Error :: MultiAt ( ref s) => write ! ( f, "«{}» has multiple instances of «@»" , s) ,
535
516
Error :: AtOutsideOr ( ref s) => write ! ( f, "«{}» contains «@» in non-or() context" , s) ,
536
517
Error :: UnknownWrapper ( ch) => write ! ( f, "unknown wrapper «{}:»" , ch) ,
537
518
Error :: NonTopLevel ( ref s) => write ! ( f, "non-T miniscript: {}" , s) ,
538
519
Error :: Trailing ( ref s) => write ! ( f, "trailing tokens: {}" , s) ,
539
- Error :: MissingHash ( ref h) => write ! ( f, "missing preimage of hash {}" , h) ,
540
520
Error :: MissingSig ( ref pk) => write ! ( f, "missing signature for key {:?}" , pk) ,
541
- Error :: RelativeLocktimeNotMet ( n) => {
542
- write ! ( f, "required relative locktime CSV of {} blocks, not met" , n)
543
- }
544
- Error :: AbsoluteLocktimeNotMet ( n) => write ! (
545
- f,
546
- "required absolute locktime CLTV of {} blocks, not met" ,
547
- n
548
- ) ,
549
521
Error :: CouldNotSatisfy => f. write_str ( "could not satisfy" ) ,
550
- Error :: BadPubkey ( ref e) => fmt:: Display :: fmt ( e, f) ,
551
522
Error :: TypeCheck ( ref e) => write ! ( f, "typecheck: {}" , e) ,
552
523
Error :: BadDescriptor ( ref e) => write ! ( f, "Invalid descriptor: {}" , e) ,
553
524
Error :: Secp ( ref e) => fmt:: Display :: fmt ( e, f) ,
@@ -561,11 +532,6 @@ impl fmt::Display for Error {
561
532
"Recursive depth over {} not permitted" ,
562
533
MAX_RECURSION_DEPTH
563
534
) ,
564
- Error :: ScriptSizeTooLarge => write ! (
565
- f,
566
- "Standardness rules imply bitcoin than {} bytes" ,
567
- MAX_SCRIPT_SIZE
568
- ) ,
569
535
Error :: NonStandardBareScript => write ! (
570
536
f,
571
537
"Anything but c:pk(key) (P2PK), c:pk_h(key) (P2PKH), and thresh_m(k,...) \
@@ -579,9 +545,7 @@ impl fmt::Display for Error {
579
545
write ! ( f, "Pubkey error: {} under {} scriptcontext" , pk, ctx)
580
546
}
581
547
Error :: MultiATooManyKeys ( k) => write ! ( f, "MultiA too many keys {}" , k) ,
582
- Error :: TaprootSpendInfoUnavialable => write ! ( f, "Taproot Spend Info not computed." ) ,
583
548
Error :: TrNoScriptCode => write ! ( f, "No script code for Tr descriptors" ) ,
584
- Error :: TrNoExplicitScript => write ! ( f, "No script code for Tr descriptors" ) ,
585
549
Error :: MultipathDescLenMismatch => write ! ( f, "At least two BIP389 key expressions in the descriptor contain tuples of derivation indexes of different lengths" ) ,
586
550
Error :: AbsoluteLockTime ( ref e) => e. fmt ( f) ,
587
551
Error :: RelativeLockTime ( ref e) => e. fmt ( f) ,
@@ -605,30 +569,22 @@ impl error::Error for Error {
605
569
| UnexpectedStart
606
570
| Unexpected ( _)
607
571
| MultiColon ( _)
608
- | MultiAt ( _)
609
572
| AtOutsideOr ( _)
610
573
| UnknownWrapper ( _)
611
574
| NonTopLevel ( _)
612
575
| Trailing ( _)
613
- | MissingHash ( _)
614
576
| MissingSig ( _)
615
- | RelativeLocktimeNotMet ( _)
616
- | AbsoluteLocktimeNotMet ( _)
617
577
| CouldNotSatisfy
618
578
| TypeCheck ( _)
619
579
| BadDescriptor ( _)
620
580
| MaxRecursiveDepthExceeded
621
- | ScriptSizeTooLarge
622
581
| NonStandardBareScript
623
582
| ImpossibleSatisfaction
624
583
| BareDescriptorAddr
625
- | TaprootSpendInfoUnavialable
626
584
| TrNoScriptCode
627
- | TrNoExplicitScript
628
585
| MultipathDescLenMismatch => None ,
629
586
Script ( e) => Some ( e) ,
630
587
AddrError ( e) => Some ( e) ,
631
- BadPubkey ( e) => Some ( e) ,
632
588
Secp ( e) => Some ( e) ,
633
589
#[ cfg( feature = "compiler" ) ]
634
590
CompilerError ( e) => Some ( e) ,
0 commit comments