Skip to content

Commit 3b893d3

Browse files
CRC: add deploy time tests to all possible error types
Signed-off-by: Jacinta Ferrant <jacinta@stackslabs.com>
1 parent 11b5a6d commit 3b893d3

File tree

27 files changed

+1791
-45
lines changed

27 files changed

+1791
-45
lines changed

stackslib/src/chainstate/tests/runtime_tests.rs

Lines changed: 231 additions & 45 deletions
Large diffs are not rendered by default.
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
source: stackslib/src/chainstate/tests/runtime_tests.rs
3+
expression: result
4+
---
5+
[
6+
Success(ExpectedBlockOutput(
7+
marf_hash: "080e462a7a4181ec7a8eeecef8d0902641c1d9e71e8c70416c7dd1816231d41f",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: log2-neg-deploy-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(Arithmetic(\"log2 must be passed a positive integer\")) [NON-CONSENSUS BREAKING]",
13+
return_type: Response(ResponseData(
14+
committed: false,
15+
data: Optional(OptionalData(
16+
data: None,
17+
)),
18+
)),
19+
cost: ExecutionCost(
20+
write_length: 44,
21+
write_count: 2,
22+
read_length: 1,
23+
read_count: 1,
24+
runtime: 9137,
25+
),
26+
),
27+
],
28+
total_block_cost: ExecutionCost(
29+
write_length: 44,
30+
write_count: 2,
31+
read_length: 1,
32+
read_count: 1,
33+
runtime: 9137,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "0b0c1dab2f9ec50bcb1d2bf863ca009a2f9cab84528f939ad04d62ec5a76a106",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: log2-neg-deploy-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(Arithmetic(\"log2 must be passed a positive integer\")) [NON-CONSENSUS BREAKING]",
43+
return_type: Response(ResponseData(
44+
committed: false,
45+
data: Optional(OptionalData(
46+
data: None,
47+
)),
48+
)),
49+
cost: ExecutionCost(
50+
write_length: 44,
51+
write_count: 2,
52+
read_length: 1,
53+
read_count: 1,
54+
runtime: 9137,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 44,
60+
write_count: 2,
61+
read_length: 1,
62+
read_count: 1,
63+
runtime: 9137,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "1e63a8e4853f64eef0bb25be4b768b75c99d3b20355659e75aa14d93e665eccf",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: log2-neg-deploy-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(Arithmetic(\"log2 must be passed a positive integer\")) [NON-CONSENSUS BREAKING]",
73+
return_type: Response(ResponseData(
74+
committed: false,
75+
data: Optional(OptionalData(
76+
data: None,
77+
)),
78+
)),
79+
cost: ExecutionCost(
80+
write_length: 44,
81+
write_count: 2,
82+
read_length: 1,
83+
read_count: 1,
84+
runtime: 9137,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 44,
90+
write_count: 2,
91+
read_length: 1,
92+
read_count: 1,
93+
runtime: 9137,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "828ee8c46b553b4236d3e1cc5118f240d17fe17c86e50f45a340f651b4512ebe",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: log2-neg-deploy-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(Arithmetic(\"log2 must be passed a positive integer\")) [NON-CONSENSUS BREAKING]",
103+
return_type: Response(ResponseData(
104+
committed: false,
105+
data: Optional(OptionalData(
106+
data: None,
107+
)),
108+
)),
109+
cost: ExecutionCost(
110+
write_length: 44,
111+
write_count: 2,
112+
read_length: 1,
113+
read_count: 1,
114+
runtime: 9137,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 44,
120+
write_count: 2,
121+
read_length: 1,
122+
read_count: 1,
123+
runtime: 9137,
124+
),
125+
)),
126+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
source: stackslib/src/chainstate/tests/runtime_tests.rs
3+
expression: result
4+
---
5+
[
6+
Success(ExpectedBlockOutput(
7+
marf_hash: "0baa8536816ea19016addf5641e710546c1337086d00ae90446b95d3cc4fab61",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: overflow-add-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(ArithmeticOverflow) [NON-CONSENSUS BREAKING]",
13+
return_type: Response(ResponseData(
14+
committed: false,
15+
data: Optional(OptionalData(
16+
data: None,
17+
)),
18+
)),
19+
cost: ExecutionCost(
20+
write_length: 83,
21+
write_count: 2,
22+
read_length: 1,
23+
read_count: 1,
24+
runtime: 10722,
25+
),
26+
),
27+
],
28+
total_block_cost: ExecutionCost(
29+
write_length: 83,
30+
write_count: 2,
31+
read_length: 1,
32+
read_count: 1,
33+
runtime: 10722,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "4d0b8a9994273ba64c02da838af9ea8fe923c37f33148fb4ffa7945d8f3db8c0",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: overflow-add-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(ArithmeticOverflow) [NON-CONSENSUS BREAKING]",
43+
return_type: Response(ResponseData(
44+
committed: false,
45+
data: Optional(OptionalData(
46+
data: None,
47+
)),
48+
)),
49+
cost: ExecutionCost(
50+
write_length: 83,
51+
write_count: 2,
52+
read_length: 1,
53+
read_count: 1,
54+
runtime: 10722,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 83,
60+
write_count: 2,
61+
read_length: 1,
62+
read_count: 1,
63+
runtime: 10722,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "e9c40ceaa2c130c43a92bc6e9483bcce93fca77ff003b88a33393f63ea079d36",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: overflow-add-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(ArithmeticOverflow) [NON-CONSENSUS BREAKING]",
73+
return_type: Response(ResponseData(
74+
committed: false,
75+
data: Optional(OptionalData(
76+
data: None,
77+
)),
78+
)),
79+
cost: ExecutionCost(
80+
write_length: 83,
81+
write_count: 2,
82+
read_length: 1,
83+
read_count: 1,
84+
runtime: 10722,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 83,
90+
write_count: 2,
91+
read_length: 1,
92+
read_count: 1,
93+
runtime: 10722,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "1b1178d5b1dcdc140033836f80645c93ef56533e2d86abcb0da2ad298901b810",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: overflow-add-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(ArithmeticOverflow) [NON-CONSENSUS BREAKING]",
103+
return_type: Response(ResponseData(
104+
committed: false,
105+
data: Optional(OptionalData(
106+
data: None,
107+
)),
108+
)),
109+
cost: ExecutionCost(
110+
write_length: 83,
111+
write_count: 2,
112+
read_length: 1,
113+
read_count: 1,
114+
runtime: 10722,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 83,
120+
write_count: 2,
121+
read_length: 1,
122+
read_count: 1,
123+
runtime: 10722,
124+
),
125+
)),
126+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
source: stackslib/src/chainstate/tests/runtime_tests.rs
3+
expression: result
4+
---
5+
[
6+
Success(ExpectedBlockOutput(
7+
marf_hash: "0baa8536816ea19016addf5641e710546c1337086d00ae90446b95d3cc4fab61",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: overflow-mul-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(ArithmeticOverflow) [NON-CONSENSUS BREAKING]",
13+
return_type: Response(ResponseData(
14+
committed: false,
15+
data: Optional(OptionalData(
16+
data: None,
17+
)),
18+
)),
19+
cost: ExecutionCost(
20+
write_length: 83,
21+
write_count: 2,
22+
read_length: 1,
23+
read_count: 1,
24+
runtime: 10726,
25+
),
26+
),
27+
],
28+
total_block_cost: ExecutionCost(
29+
write_length: 83,
30+
write_count: 2,
31+
read_length: 1,
32+
read_count: 1,
33+
runtime: 10726,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "a461d9962bfd766d0212f6828b47e700749ffa7508b238fa525c3caeddb0ea76",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: overflow-mul-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(ArithmeticOverflow) [NON-CONSENSUS BREAKING]",
43+
return_type: Response(ResponseData(
44+
committed: false,
45+
data: Optional(OptionalData(
46+
data: None,
47+
)),
48+
)),
49+
cost: ExecutionCost(
50+
write_length: 83,
51+
write_count: 2,
52+
read_length: 1,
53+
read_count: 1,
54+
runtime: 10726,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 83,
60+
write_count: 2,
61+
read_length: 1,
62+
read_count: 1,
63+
runtime: 10726,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "8922675b93c8ace92260b435321b76f9cd4b4d5e83fe5235cfa288d6ca9944f0",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: overflow-mul-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(ArithmeticOverflow) [NON-CONSENSUS BREAKING]",
73+
return_type: Response(ResponseData(
74+
committed: false,
75+
data: Optional(OptionalData(
76+
data: None,
77+
)),
78+
)),
79+
cost: ExecutionCost(
80+
write_length: 83,
81+
write_count: 2,
82+
read_length: 1,
83+
read_count: 1,
84+
runtime: 10726,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 83,
90+
write_count: 2,
91+
read_length: 1,
92+
read_count: 1,
93+
runtime: 10726,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "b60558e3327e6d0dda25a9bdbd245e21a01eb27ba73f4c29820d79beae422aa8",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: overflow-mul-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(ArithmeticOverflow) [NON-CONSENSUS BREAKING]",
103+
return_type: Response(ResponseData(
104+
committed: false,
105+
data: Optional(OptionalData(
106+
data: None,
107+
)),
108+
)),
109+
cost: ExecutionCost(
110+
write_length: 83,
111+
write_count: 2,
112+
read_length: 1,
113+
read_count: 1,
114+
runtime: 10726,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 83,
120+
write_count: 2,
121+
read_length: 1,
122+
read_count: 1,
123+
runtime: 10726,
124+
),
125+
)),
126+
]

0 commit comments

Comments
 (0)