Skip to content

Commit 1efff8e

Browse files
Merge pull request #6687 from Jiloc/chore/static-analysis-error-tests-2
test: second set of consensus tests for `CheckErrorKind` during contract analysis
2 parents 36389fe + 0e34ec2 commit 1efff8e

File tree

16 files changed

+1996
-1
lines changed

16 files changed

+1996
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
source: stackslib/src/chainstate/tests/static_analysis_tests.rs
3+
expression: result
4+
---
5+
[
6+
Success(ExpectedBlockOutput(
7+
marf_hash: "4cca742df63dfae2a6082353ebd9528d316f13ae99fb29442bb8e53cc7342565",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: bad-map-type-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: invalid map definition) [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: 10,
21+
write_count: 1,
22+
read_length: 1,
23+
read_count: 1,
24+
runtime: 1372,
25+
),
26+
),
27+
],
28+
total_block_cost: ExecutionCost(
29+
write_length: 10,
30+
write_count: 1,
31+
read_length: 1,
32+
read_count: 1,
33+
runtime: 1372,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "20140d78c081fb88aa6389b2a11c24b3f98e14832df47562e52210c5145d91cb",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: bad-map-type-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: invalid map definition) [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: 10,
51+
write_count: 1,
52+
read_length: 1,
53+
read_count: 1,
54+
runtime: 1372,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 10,
60+
write_count: 1,
61+
read_length: 1,
62+
read_count: 1,
63+
runtime: 1372,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "00c123e8a822408dad4879b7e9d4158887a1d2750862ed15d3b34cc4cd7cc70b",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: bad-map-type-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: invalid map definition) [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: 10,
81+
write_count: 1,
82+
read_length: 1,
83+
read_count: 1,
84+
runtime: 1372,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 10,
90+
write_count: 1,
91+
read_length: 1,
92+
read_count: 1,
93+
runtime: 1372,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "6feebdbc00848565df5f577460dcf3937f5518e4eb91d228d73d5ed09d3cb8b6",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: bad-map-type-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: invalid map definition) [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: 10,
111+
write_count: 1,
112+
read_length: 1,
113+
read_count: 1,
114+
runtime: 1372,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 10,
120+
write_count: 1,
121+
read_length: 1,
122+
read_count: 1,
123+
runtime: 1372,
124+
),
125+
)),
126+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
source: stackslib/src/chainstate/tests/static_analysis_tests.rs
3+
expression: result
4+
---
5+
[
6+
Success(ExpectedBlockOutput(
7+
marf_hash: "4865d7980ca587867066c6e012ef04e079a89b2e97ef78d3a2248b34c38e3f41",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: constructed-list-large-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: reached limit of elements in a sequence) [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: 29,
21+
write_count: 1,
22+
read_length: 1,
23+
read_count: 1,
24+
runtime: 7437,
25+
),
26+
),
27+
],
28+
total_block_cost: ExecutionCost(
29+
write_length: 29,
30+
write_count: 1,
31+
read_length: 1,
32+
read_count: 1,
33+
runtime: 7437,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "69fae186776e92cf6946ed6a4a83c28d0024e0390278df6e68a69e09482d16e7",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: constructed-list-large-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: reached limit of elements in a sequence) [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: 29,
51+
write_count: 1,
52+
read_length: 1,
53+
read_count: 1,
54+
runtime: 7436,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 29,
60+
write_count: 1,
61+
read_length: 1,
62+
read_count: 1,
63+
runtime: 7436,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "535d3cb64b5043bc386984fce0b0e71ad7c2f703b2f4a91bac5865227642b788",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: constructed-list-large-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: reached limit of elements in a sequence) [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: 29,
81+
write_count: 1,
82+
read_length: 1,
83+
read_count: 1,
84+
runtime: 7436,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 29,
90+
write_count: 1,
91+
read_length: 1,
92+
read_count: 1,
93+
runtime: 7436,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "7b61f5697e66a568a248c80b83cae3df329c6ef279c3076d441c5d833b71c898",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: constructed-list-large-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: reached limit of elements in a sequence) [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: 29,
111+
write_count: 1,
112+
read_length: 1,
113+
read_count: 1,
114+
runtime: 7436,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 29,
120+
write_count: 1,
121+
read_length: 1,
122+
read_count: 1,
123+
runtime: 7436,
124+
),
125+
)),
126+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
source: stackslib/src/chainstate/tests/static_analysis_tests.rs
3+
expression: result
4+
---
5+
[
6+
Success(ExpectedBlockOutput(
7+
marf_hash: "b3b9782ccbe1bf3a66f1c34fe50c83c418fd9d6265761b0a82ffe9950dc8e30f",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: serialization-type-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: use of unresolved function \'to-consensus-buff?\') [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: 0,
21+
write_count: 0,
22+
read_length: 0,
23+
read_count: 0,
24+
runtime: 7374,
25+
),
26+
),
27+
],
28+
total_block_cost: ExecutionCost(
29+
write_length: 0,
30+
write_count: 0,
31+
read_length: 0,
32+
read_count: 0,
33+
runtime: 7374,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "32e8a7c15c537c7cbffb74e28705816f8c607bd37d5b2fe9db78f24c697d506f",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: serialization-type-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: could not determine the input type for the serialization function) [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: 41,
51+
write_count: 1,
52+
read_length: 1,
53+
read_count: 1,
54+
runtime: 7759,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 41,
60+
write_count: 1,
61+
read_length: 1,
62+
read_count: 1,
63+
runtime: 7759,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "a9b3550d29aff9a7a271ee1cb981e4bb3e1948d49026511cc8183fbe2aaeb8af",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: serialization-type-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: could not determine the input type for the serialization function) [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: 41,
81+
write_count: 1,
82+
read_length: 1,
83+
read_count: 1,
84+
runtime: 7759,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 41,
90+
write_count: 1,
91+
read_length: 1,
92+
read_count: 1,
93+
runtime: 7759,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "a390adec582f30b5d9b8cb0dec54acb082db7823cd7d55a11992fda3f5f96479",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: serialization-type-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: could not determine the input type for the serialization function) [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: 41,
111+
write_count: 1,
112+
read_length: 1,
113+
read_count: 1,
114+
runtime: 7759,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 41,
120+
write_count: 1,
121+
read_length: 1,
122+
read_count: 1,
123+
runtime: 7759,
124+
),
125+
)),
126+
]

0 commit comments

Comments
 (0)