@@ -52,6 +52,9 @@ pub enum ScriptContextError {
52
52
/// The Miniscript (under p2sh context) corresponding Script would be
53
53
/// larger than `MAX_SCRIPT_ELEMENT_SIZE` bytes.
54
54
MaxRedeemScriptSizeExceeded ,
55
+ /// The Miniscript(under bare context) corresponding
56
+ /// Script would be larger than `MAX_SCRIPT_SIZE` bytes.
57
+ MaxBareScriptSizeExceeded ,
55
58
/// The policy rules of bitcoin core only permit Script size upto 1650 bytes
56
59
MaxScriptSigSizeExceeded ,
57
60
/// Impossible to satisfy the miniscript under the current context
@@ -80,6 +83,7 @@ impl error::Error for ScriptContextError {
80
83
| MaxOpCountExceeded
81
84
| MaxWitnessScriptSizeExceeded
82
85
| MaxRedeemScriptSizeExceeded
86
+ | MaxBareScriptSizeExceeded
83
87
| MaxScriptSigSizeExceeded
84
88
| ImpossibleSatisfaction
85
89
| TaprootMultiDisabled
@@ -127,6 +131,11 @@ impl fmt::Display for ScriptContextError {
127
131
"The Miniscript corresponding Script would be larger than \
128
132
MAX_SCRIPT_ELEMENT_SIZE bytes."
129
133
) ,
134
+ ScriptContextError :: MaxBareScriptSizeExceeded => write ! (
135
+ f,
136
+ "The Miniscript corresponding Script would be larger than \
137
+ MAX_SCRIPT_SIZE bytes."
138
+ ) ,
130
139
ScriptContextError :: MaxScriptSigSizeExceeded => write ! (
131
140
f,
132
141
"At least one satisfaction in Miniscript would be larger than \
@@ -740,7 +749,7 @@ impl ScriptContext for BareCtx {
740
749
match node_checked {
741
750
Ok ( _) => {
742
751
if ms. ext . pk_cost > MAX_SCRIPT_SIZE {
743
- Err ( ScriptContextError :: MaxWitnessScriptSizeExceeded )
752
+ Err ( ScriptContextError :: MaxBareScriptSizeExceeded )
744
753
} else {
745
754
Ok ( ( ) )
746
755
}
0 commit comments