Skip to content

Commit 77f1583

Browse files
Merge pull request #6703 from Jiloc/chore/static-analysis-error-tests-4
test: fourth set of consensus tests for `CheckErrorKind` during contract analysis
2 parents ad4a4e2 + d7345b4 commit 77f1583

File tree

16 files changed

+2086
-0
lines changed

16 files changed

+2086
-0
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: "9a7b61f181ef8592a441f9ecc91bbc12f9a1793cfbec3513e4721f18d67d759c",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: bad-let-syntax-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: invalid syntax of \'let\') [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: 396,
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: 396,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "bd7f849c2ca3f82215077ff231c5b9ab2aabab13ffe6dde893ac874934486e89",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: bad-let-syntax-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: invalid syntax of \'let\') [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: 0,
51+
write_count: 0,
52+
read_length: 0,
53+
read_count: 0,
54+
runtime: 396,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 0,
60+
write_count: 0,
61+
read_length: 0,
62+
read_count: 0,
63+
runtime: 396,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "b9892b671586d1a137bce485d61a9413be9835ac270bc2b9d8e012d14148cda6",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: bad-let-syntax-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: invalid syntax of \'let\') [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: 0,
81+
write_count: 0,
82+
read_length: 0,
83+
read_count: 0,
84+
runtime: 396,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 0,
90+
write_count: 0,
91+
read_length: 0,
92+
read_count: 0,
93+
runtime: 396,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "88bca3a73fff95a22e4108e03d3e75b391b62baca8ea07fbed2f76889b099110",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: bad-let-syntax-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: invalid syntax of \'let\') [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: 0,
111+
write_count: 0,
112+
read_length: 0,
113+
read_count: 0,
114+
runtime: 396,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 0,
120+
write_count: 0,
121+
read_length: 0,
122+
read_count: 0,
123+
runtime: 396,
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: "5757a72059ef9758e18238aad508b3c505548d4ec91c188b0331abbf516231e2",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: bad-syntax-binding-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: invalid syntax binding: Let-binding item #1 is not a two-element list) [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: 666,
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: 666,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "23abed8e414c422c7eaaf6981863e16f9e36f83e6588787e3b366d45a476d380",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: bad-syntax-binding-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: invalid syntax binding: Let-binding item #1 is not a two-element list) [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: 0,
51+
write_count: 0,
52+
read_length: 0,
53+
read_count: 0,
54+
runtime: 666,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 0,
60+
write_count: 0,
61+
read_length: 0,
62+
read_count: 0,
63+
runtime: 666,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "32a47e26e9953fa3451bfcdf8ba00395b5d574b6e6472f8458774c3b29959ab4",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: bad-syntax-binding-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: invalid syntax binding: Let-binding item #1 is not a two-element list) [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: 0,
81+
write_count: 0,
82+
read_length: 0,
83+
read_count: 0,
84+
runtime: 666,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 0,
90+
write_count: 0,
91+
read_length: 0,
92+
read_count: 0,
93+
runtime: 666,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "1cf5ce609cb847dd7558af25d631a1a12549c1ac377527d15fcb2a9db607aa0d",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: bad-syntax-binding-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: invalid syntax binding: Let-binding item #1 is not a two-element list) [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: 0,
111+
write_count: 0,
112+
read_length: 0,
113+
read_count: 0,
114+
runtime: 666,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 0,
120+
write_count: 0,
121+
read_length: 0,
122+
read_count: 0,
123+
runtime: 666,
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: "f80d8825cf580fda2e36a975d7c02e0c227051a0f56ae0ee50ede8ea2e4266fb",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: def-trait-bad-sign-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: invalid trait 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: 9,
21+
write_count: 1,
22+
read_length: 1,
23+
read_count: 1,
24+
runtime: 1397,
25+
),
26+
),
27+
],
28+
total_block_cost: ExecutionCost(
29+
write_length: 9,
30+
write_count: 1,
31+
read_length: 1,
32+
read_count: 1,
33+
runtime: 1397,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "13cfd665a9fdb72caef26e86e8eb3697aa282c89e6aba8a08230aa50d7225dcb",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: def-trait-bad-sign-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: invalid trait 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: 9,
51+
write_count: 1,
52+
read_length: 1,
53+
read_count: 1,
54+
runtime: 1397,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 9,
60+
write_count: 1,
61+
read_length: 1,
62+
read_count: 1,
63+
runtime: 1397,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "c4f2a04a75fcf53d1e4d31f6d308b026e00eb60f56e3f621536ce9e6754b2c2b",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: def-trait-bad-sign-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: invalid trait 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: 9,
81+
write_count: 1,
82+
read_length: 1,
83+
read_count: 1,
84+
runtime: 1397,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 9,
90+
write_count: 1,
91+
read_length: 1,
92+
read_count: 1,
93+
runtime: 1397,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "345cd8885c37d1ac1c4e261aab67cd0e620d5edc5c13cdaa59948a9d9f21fa07",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: def-trait-bad-sign-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: invalid trait 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: 9,
111+
write_count: 1,
112+
read_length: 1,
113+
read_count: 1,
114+
runtime: 1397,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 9,
120+
write_count: 1,
121+
read_length: 1,
122+
read_count: 1,
123+
runtime: 1397,
124+
),
125+
)),
126+
]

0 commit comments

Comments
 (0)