@@ -8900,6 +8900,7 @@ mod error_mapping {
89008900 read_bytes_from_wasm, read_from_wasm_indirect, read_identifier_from_wasm,
89018901 signature_from_string,
89028902 } ;
8903+ use crate :: vm:: costs:: CostErrors ;
89038904 use crate :: vm:: errors:: { CheckErrors , Error , RuntimeErrorType , ShortReturnType , WasmError } ;
89048905 use crate :: vm:: types:: { OptionalData , ResponseData } ;
89058906 use crate :: vm:: { ClarityVersion , Value } ;
@@ -8974,6 +8975,21 @@ mod error_mapping {
89748975 /// Indicates an attempt to use a function with too many arguments
89758976 ArgumentCountAtMost = 15 ,
89768977
8978+ /// Indicates a runtime cost overrun
8979+ CostOverrunRuntime = 100 ,
8980+
8981+ /// Indicates a read count cost overrun
8982+ CostOverrunReadCount = 101 ,
8983+
8984+ /// Indicates a read length cost overrun
8985+ CostOverrunReadLength = 102 ,
8986+
8987+ /// Indicates a write count cost overrun
8988+ CostOverrunWriteCount = 103 ,
8989+
8990+ /// Indicates a write length cost overrun
8991+ CostOverrunWriteLength = 104 ,
8992+
89778993 /// A catch-all for errors that are not mapped to specific error codes.
89788994 /// This might be used for unexpected or unclassified errors.
89798995 NotMapped = 99 ,
@@ -8999,6 +9015,11 @@ mod error_mapping {
89999015 13 => ErrorMap :: ArgumentCountMismatch ,
90009016 14 => ErrorMap :: ArgumentCountAtLeast ,
90019017 15 => ErrorMap :: ArgumentCountAtMost ,
9018+ 100 => ErrorMap :: CostOverrunRuntime ,
9019+ 101 => ErrorMap :: CostOverrunReadCount ,
9020+ 102 => ErrorMap :: CostOverrunReadLength ,
9021+ 103 => ErrorMap :: CostOverrunWriteCount ,
9022+ 104 => ErrorMap :: CostOverrunWriteLength ,
90029023 _ => ErrorMap :: NotMapped ,
90039024 }
90049025 }
@@ -9179,6 +9200,11 @@ mod error_mapping {
91799200 let ( expected, got) = get_runtime_error_arg_lengths ( & instance, & mut store) ;
91809201 Error :: Unchecked ( CheckErrors :: RequiresAtMostArguments ( expected, got) )
91819202 }
9203+ ErrorMap :: CostOverrunRuntime => Error :: from ( CostErrors :: CostOverflow ) ,
9204+ ErrorMap :: CostOverrunReadCount => Error :: from ( CostErrors :: CostOverflow ) ,
9205+ ErrorMap :: CostOverrunReadLength => Error :: from ( CostErrors :: CostOverflow ) ,
9206+ ErrorMap :: CostOverrunWriteCount => Error :: from ( CostErrors :: CostOverflow ) ,
9207+ ErrorMap :: CostOverrunWriteLength => Error :: from ( CostErrors :: CostOverflow ) ,
91829208 _ => panic ! ( "Runtime error code {} not supported" , runtime_error_code) ,
91839209 }
91849210 }
0 commit comments