@@ -200,11 +200,7 @@ pub enum CommonCheckErrorKind {
200200 // Unexpected interpreter behavior
201201 /// Unexpected condition or failure in the type-checker, indicating a bug or invalid state.
202202 /// This error indicates a transaction would invalidate a block if included.
203- ExpectsRejectable ( String ) ,
204- // Unexpected interpreter behavior
205- /// Unexpected condition or failure in the type-checker, indicating a bug or invalid state.
206- /// This error does NOT indicate a transaction would invalidate a block if included.
207- ExpectsAcceptable ( String ) ,
203+ Expects ( String ) ,
208204
209205 // Type mismatch errors
210206 /// Expected type does not match the actual type during analysis.
@@ -293,24 +289,16 @@ impl CommonCheckErrorKind {
293289 | ClarityTypeError :: QualifiedContractMissingDot
294290 | ClarityTypeError :: InvalidPrincipalEncoding ( _)
295291 | ClarityTypeError :: InvalidPrincipalLength ( _)
296- | ClarityTypeError :: ResponseTypeMismatch { .. } => {
297- CommonCheckErrorKind :: ExpectsAcceptable ( format ! (
298- "Unexpected error type during analysis: {err}"
299- ) )
300- }
301- ClarityTypeError :: InvariantViolation ( _)
292+ | ClarityTypeError :: ResponseTypeMismatch { .. }
293+ | ClarityTypeError :: InvariantViolation ( _)
302294 | ClarityTypeError :: InvalidPrincipalVersion ( _) => {
303- CommonCheckErrorKind :: ExpectsRejectable ( format ! (
304- "Unexpected error type during analysis: {err}"
305- ) )
295+ CommonCheckErrorKind :: Expects ( format ! ( "Unexpected error during analysis: {err}" ) )
306296 }
307297 ClarityTypeError :: UnsupportedTypeInEpoch ( ty, epoch) => {
308- CommonCheckErrorKind :: ExpectsRejectable ( format ! (
309- "{ty} should not be used in {epoch}"
310- ) )
298+ CommonCheckErrorKind :: Expects ( format ! ( "{ty} should not be used in {epoch}" ) )
311299 }
312300 ClarityTypeError :: UnsupportedEpoch ( epoch) => {
313- CommonCheckErrorKind :: ExpectsRejectable ( format ! ( "{epoch} is not supported" ) )
301+ CommonCheckErrorKind :: Expects ( format ! ( "{epoch} is not supported" ) )
314302 }
315303 }
316304 }
@@ -352,11 +340,7 @@ pub enum StaticCheckErrorKind {
352340 // Unexpected interpreter behavior
353341 /// Unexpected condition or failure in the type-checker, indicating a bug or invalid state.
354342 /// This error indicates a transaction would invalidate a block if included.
355- ExpectsRejectable ( String ) ,
356- // Unexpected interpreter behavior
357- /// Unexpected condition or failure in the type-checker, indicating a bug or invalid state.
358- /// This error does NOT indicate a transaction would invalidate a block if included.
359- ExpectsAcceptable ( String ) ,
343+ Expects ( String ) ,
360344
361345 // Match expression errors
362346 /// Invalid syntax in an `option` match expression.
@@ -669,11 +653,7 @@ pub enum CheckErrorKind {
669653 // Unexpected interpreter behavior
670654 /// Unexpected condition or failure in the type-checker, indicating a bug or invalid state.
671655 /// This error indicates a transaction would invalidate a block if included.
672- ExpectsRejectable ( String ) ,
673- // Unexpected interpreter behavior
674- /// Unexpected condition or failure in the type-checker, indicating a bug or invalid state.
675- /// This error does NOT indicate a transaction would invalidate a block if included.
676- ExpectsAcceptable ( String ) ,
656+ Expects ( String ) ,
677657
678658 // Match expression errors
679659 /// Invalid syntax in an `option` match expression.
@@ -930,7 +910,7 @@ impl CheckErrorKind {
930910 pub fn rejectable ( & self ) -> bool {
931911 matches ! (
932912 self ,
933- CheckErrorKind :: SupertypeTooLarge | CheckErrorKind :: ExpectsRejectable ( _)
913+ CheckErrorKind :: SupertypeTooLarge | CheckErrorKind :: Expects ( _)
934914 )
935915 }
936916
@@ -965,19 +945,17 @@ impl CheckErrorKind {
965945 | ClarityTypeError :: QualifiedContractMissingDot
966946 | ClarityTypeError :: InvalidPrincipalEncoding ( _)
967947 | ClarityTypeError :: InvalidPrincipalLength ( _)
968- | ClarityTypeError :: ResponseTypeMismatch { .. } => CheckErrorKind :: ExpectsAcceptable (
969- format ! ( "Unexpected error type during runtime analysis: {err}" ) ,
970- ) ,
971- ClarityTypeError :: InvariantViolation ( _)
972- | ClarityTypeError :: InvalidPrincipalVersion ( _) => CheckErrorKind :: ExpectsRejectable (
973- format ! ( "Unexpected error type during runtime analysis: {err}" ) ,
974- ) ,
948+ | ClarityTypeError :: ResponseTypeMismatch { .. }
949+ | ClarityTypeError :: InvariantViolation ( _)
950+ | ClarityTypeError :: InvalidPrincipalVersion ( _) => CheckErrorKind :: Expects ( format ! (
951+ "Unexpected error type during runtime analysis: {err}"
952+ ) ) ,
975953 ClarityTypeError :: CouldNotDetermineType => CheckErrorKind :: CouldNotDetermineType ,
976954 ClarityTypeError :: UnsupportedTypeInEpoch ( ty, epoch) => {
977- CheckErrorKind :: ExpectsRejectable ( format ! ( "{ty} should not be used in {epoch}" ) )
955+ CheckErrorKind :: Expects ( format ! ( "{ty} should not be used in {epoch}" ) )
978956 }
979957 ClarityTypeError :: UnsupportedEpoch ( epoch) => {
980- CheckErrorKind :: ExpectsRejectable ( format ! ( "{epoch} is not supported" ) )
958+ CheckErrorKind :: Expects ( format ! ( "{epoch} is not supported" ) )
981959 }
982960 }
983961 }
@@ -988,7 +966,7 @@ impl StaticCheckErrorKind {
988966 pub fn rejectable ( & self ) -> bool {
989967 matches ! (
990968 self ,
991- StaticCheckErrorKind :: SupertypeTooLarge | StaticCheckErrorKind :: ExpectsRejectable ( _)
969+ StaticCheckErrorKind :: SupertypeTooLarge | StaticCheckErrorKind :: Expects ( _)
992970 )
993971 }
994972
@@ -1024,26 +1002,20 @@ impl StaticCheckErrorKind {
10241002 | ClarityTypeError :: TypeMismatchValue ( _, _)
10251003 | ClarityTypeError :: ResponseTypeMismatch { .. }
10261004 | ClarityTypeError :: InvalidAsciiCharacter ( _)
1027- | ClarityTypeError :: InvalidUtf8Encoding => StaticCheckErrorKind :: ExpectsAcceptable (
1005+ | ClarityTypeError :: InvalidUtf8Encoding
1006+ | ClarityTypeError :: InvariantViolation ( _)
1007+ | ClarityTypeError :: InvalidPrincipalVersion ( _) => StaticCheckErrorKind :: Expects (
10281008 format ! ( "Unexpected error type during static analysis: {err}" ) ,
10291009 ) ,
1030- ClarityTypeError :: InvariantViolation ( _)
1031- | ClarityTypeError :: InvalidPrincipalVersion ( _) => {
1032- StaticCheckErrorKind :: ExpectsRejectable ( format ! (
1033- "Unexpected error type during static analysis: {err}"
1034- ) )
1035- }
10361010 ClarityTypeError :: CouldNotDetermineSerializationType => {
10371011 StaticCheckErrorKind :: CouldNotDetermineSerializationType
10381012 }
10391013 ClarityTypeError :: CouldNotDetermineType => StaticCheckErrorKind :: CouldNotDetermineType ,
10401014 ClarityTypeError :: UnsupportedTypeInEpoch ( ty, epoch) => {
1041- StaticCheckErrorKind :: ExpectsRejectable ( format ! (
1042- "{ty} should not be used in {epoch}"
1043- ) )
1015+ StaticCheckErrorKind :: Expects ( format ! ( "{ty} should not be used in {epoch}" ) )
10441016 }
10451017 ClarityTypeError :: UnsupportedEpoch ( epoch) => {
1046- StaticCheckErrorKind :: ExpectsRejectable ( format ! ( "{epoch} is not supported" ) )
1018+ StaticCheckErrorKind :: Expects ( format ! ( "{epoch} is not supported" ) )
10471019 }
10481020 }
10491021 }
@@ -1158,10 +1130,10 @@ impl From<CostErrors> for StaticCheckErrorKind {
11581130 CostErrors :: CostContractLoadFailure => {
11591131 StaticCheckErrorKind :: CostComputationFailed ( "Failed to load cost contract" . into ( ) )
11601132 }
1161- CostErrors :: InterpreterFailure => StaticCheckErrorKind :: ExpectsRejectable (
1133+ CostErrors :: InterpreterFailure => StaticCheckErrorKind :: Expects (
11621134 "Unexpected interpreter failure in cost computation" . into ( ) ,
11631135 ) ,
1164- CostErrors :: Expect ( s) => StaticCheckErrorKind :: ExpectsRejectable ( s) ,
1136+ CostErrors :: Expect ( s) => StaticCheckErrorKind :: Expects ( s) ,
11651137 CostErrors :: ExecutionTimeExpired => StaticCheckErrorKind :: ExecutionTimeExpired ,
11661138 }
11671139 }
@@ -1177,10 +1149,10 @@ impl From<CostErrors> for CheckErrorKind {
11771149 CostErrors :: CostContractLoadFailure => {
11781150 CheckErrorKind :: CostComputationFailed ( "Failed to load cost contract" . into ( ) )
11791151 }
1180- CostErrors :: InterpreterFailure => CheckErrorKind :: ExpectsRejectable (
1181- "Unexpected interpreter failure in cost computation" . into ( ) ,
1182- ) ,
1183- CostErrors :: Expect ( s) => CheckErrorKind :: ExpectsRejectable ( s) ,
1152+ CostErrors :: InterpreterFailure => {
1153+ CheckErrorKind :: Expects ( "Unexpected interpreter failure in cost computation" . into ( ) )
1154+ }
1155+ CostErrors :: Expect ( s) => CheckErrorKind :: Expects ( s) ,
11841156 CostErrors :: ExecutionTimeExpired => CheckErrorKind :: ExecutionTimeExpired ,
11851157 }
11861158 }
@@ -1200,10 +1172,10 @@ impl From<CostErrors> for CommonCheckErrorKind {
12001172 CostErrors :: CostContractLoadFailure => {
12011173 CommonCheckErrorKind :: CostComputationFailed ( "Failed to load cost contract" . into ( ) )
12021174 }
1203- CostErrors :: InterpreterFailure => CommonCheckErrorKind :: ExpectsRejectable (
1175+ CostErrors :: InterpreterFailure => CommonCheckErrorKind :: Expects (
12041176 "Unexpected interpreter failure in cost computation" . into ( ) ,
12051177 ) ,
1206- CostErrors :: Expect ( s) => CommonCheckErrorKind :: ExpectsRejectable ( s) ,
1178+ CostErrors :: Expect ( s) => CommonCheckErrorKind :: Expects ( s) ,
12071179 CostErrors :: ExecutionTimeExpired => CommonCheckErrorKind :: ExecutionTimeExpired ,
12081180 }
12091181 }
@@ -1272,8 +1244,7 @@ impl From<CommonCheckErrorKind> for CheckErrorKind {
12721244 CommonCheckErrorKind :: ExpectedTraitIdentifier => {
12731245 CheckErrorKind :: ExpectedTraitIdentifier
12741246 }
1275- CommonCheckErrorKind :: ExpectsRejectable ( s) => CheckErrorKind :: ExpectsRejectable ( s) ,
1276- CommonCheckErrorKind :: ExpectsAcceptable ( s) => CheckErrorKind :: ExpectsAcceptable ( s) ,
1247+ CommonCheckErrorKind :: Expects ( s) => CheckErrorKind :: Expects ( s) ,
12771248 CommonCheckErrorKind :: CouldNotDetermineType => CheckErrorKind :: CouldNotDetermineType ,
12781249 CommonCheckErrorKind :: ValueTooLarge => CheckErrorKind :: ValueTooLarge ,
12791250 CommonCheckErrorKind :: TypeSignatureTooDeep => CheckErrorKind :: TypeSignatureTooDeep ,
@@ -1333,12 +1304,7 @@ impl From<CommonCheckErrorKind> for StaticCheckErrorKind {
13331304 CommonCheckErrorKind :: ExpectedTraitIdentifier => {
13341305 StaticCheckErrorKind :: ExpectedTraitIdentifier
13351306 }
1336- CommonCheckErrorKind :: ExpectsRejectable ( s) => {
1337- StaticCheckErrorKind :: ExpectsRejectable ( s)
1338- }
1339- CommonCheckErrorKind :: ExpectsAcceptable ( s) => {
1340- StaticCheckErrorKind :: ExpectsAcceptable ( s)
1341- }
1307+ CommonCheckErrorKind :: Expects ( s) => StaticCheckErrorKind :: Expects ( s) ,
13421308 CommonCheckErrorKind :: CouldNotDetermineType => {
13431309 StaticCheckErrorKind :: CouldNotDetermineType
13441310 }
@@ -1439,8 +1405,7 @@ impl DiagnosableError for StaticCheckErrorKind {
14391405 fn message ( & self ) -> String {
14401406 match & self {
14411407 StaticCheckErrorKind :: SupertypeTooLarge => "supertype of two types is too large" . into ( ) ,
1442- StaticCheckErrorKind :: ExpectsRejectable ( s) => format ! ( "unexpected interpreter behavior: {s}" ) ,
1443- StaticCheckErrorKind :: ExpectsAcceptable ( s) => s. clone ( ) ,
1408+ StaticCheckErrorKind :: Expects ( s) => format ! ( "unexpected interpreter behavior: {s}" ) ,
14441409 StaticCheckErrorKind :: BadMatchOptionSyntax ( source) =>
14451410 format ! ( "match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: {}" ,
14461411 source. message( ) ) ,
0 commit comments