@@ -8900,6 +8900,7 @@ mod error_mapping {
8900
8900
read_bytes_from_wasm, read_from_wasm_indirect, read_identifier_from_wasm,
8901
8901
signature_from_string,
8902
8902
} ;
8903
+ use crate :: vm:: costs:: CostErrors ;
8903
8904
use crate :: vm:: errors:: { CheckErrors , Error , RuntimeErrorType , ShortReturnType , WasmError } ;
8904
8905
use crate :: vm:: types:: { OptionalData , ResponseData } ;
8905
8906
use crate :: vm:: { ClarityVersion , Value } ;
@@ -8974,6 +8975,21 @@ mod error_mapping {
8974
8975
/// Indicates an attempt to use a function with too many arguments
8975
8976
ArgumentCountAtMost = 15 ,
8976
8977
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
+
8977
8993
/// A catch-all for errors that are not mapped to specific error codes.
8978
8994
/// This might be used for unexpected or unclassified errors.
8979
8995
NotMapped = 99 ,
@@ -8999,6 +9015,11 @@ mod error_mapping {
8999
9015
13 => ErrorMap :: ArgumentCountMismatch ,
9000
9016
14 => ErrorMap :: ArgumentCountAtLeast ,
9001
9017
15 => ErrorMap :: ArgumentCountAtMost ,
9018
+ 100 => ErrorMap :: CostOverrunRuntime ,
9019
+ 101 => ErrorMap :: CostOverrunReadCount ,
9020
+ 102 => ErrorMap :: CostOverrunReadLength ,
9021
+ 103 => ErrorMap :: CostOverrunWriteCount ,
9022
+ 104 => ErrorMap :: CostOverrunWriteLength ,
9002
9023
_ => ErrorMap :: NotMapped ,
9003
9024
}
9004
9025
}
@@ -9179,6 +9200,11 @@ mod error_mapping {
9179
9200
let ( expected, got) = get_runtime_error_arg_lengths ( & instance, & mut store) ;
9180
9201
Error :: Unchecked ( CheckErrors :: RequiresAtMostArguments ( expected, got) )
9181
9202
}
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 ) ,
9182
9208
_ => panic ! ( "Runtime error code {} not supported" , runtime_error_code) ,
9183
9209
}
9184
9210
}
0 commit comments