Skip to content

Commit 44fdf84

Browse files
Merge pull request #6715 from Jiloc/chore/static-analysis-error-tests-5
test: fifth set of consensus tests for `CheckErrorKind` during contract analysis
2 parents 76936b5 + 3002fc4 commit 44fdf84

File tree

16 files changed

+1323
-0
lines changed

16 files changed

+1323
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
source: stackslib/src/chainstate/tests/static_analysis_tests.rs
3+
expression: result
4+
---
5+
[
6+
Success(ExpectedBlockOutput(
7+
marf_hash: "eb32387df909f2eadd0d7a1063b569712b8c3a35df55a36c76728a41d601db1b",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: allow-expr-not-allo-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
12+
vm_error: "Some(:0:0: allowance expressions are only allowed in the context of a `restrict-assets?` or `as-contract?`) [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: 4,
21+
write_count: 1,
22+
read_length: 1,
23+
read_count: 1,
24+
runtime: 605,
25+
),
26+
),
27+
],
28+
total_block_cost: ExecutionCost(
29+
write_length: 4,
30+
write_count: 1,
31+
read_length: 1,
32+
read_count: 1,
33+
runtime: 605,
34+
),
35+
)),
36+
]
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: "dfe63494e41a728bb312b67505cf3e630fa0d8c56f6a6653e979de854e75044b",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: closure-must-be-ro-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: (at-block ...) closures expect read-only statements, but detected a writing operation) [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: 3966,
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: 3966,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "2e049a4b1768177abbc1c07666ef5c95cfbb1a57d792513f19c28e989aed3e17",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: closure-must-be-ro-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: (at-block ...) closures expect read-only statements, but detected a writing operation) [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: 3966,
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: 3966,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "def986371d12dab1abd72cf648c74e5bb9e543005a629289d69282c188353e94",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: closure-must-be-ro-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: (at-block ...) closures expect read-only statements, but detected a writing operation) [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: 3966,
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: 3966,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "77abee8f88c8661a041465269b184208ab433a283a5c22c1abd3396138f90180",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: closure-must-be-ro-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: (at-block ...) closures expect read-only statements, but detected a writing operation) [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: 3966,
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: 3966,
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: "c7325ae92d1ef974494c13e18014778fbe87f74a3c654eb5f9461aa7d38fcc34",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: bad-tuple-constr-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: invalid tuple syntax: defining \'name\' conflicts with previous value) [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: 1030,
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: 1030,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "64981f31580117d55d9f3527ee4300d55d1eccb084965bcfa5ce6d86827635cf",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: bad-tuple-constr-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: invalid tuple syntax: defining \'name\' conflicts with previous value) [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: 1030,
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: 1030,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "875b8f5f914d202184bd3bb618319af5d88c1692b902e069561e75a1b0da05d4",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: bad-tuple-constr-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: invalid tuple syntax: defining \'name\' conflicts with previous value) [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: 1030,
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: 1030,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "779ea49997c7f6b76972ba2c855d0adf03dbb91ee5b60923421d72142e81a70f",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: bad-tuple-constr-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: invalid tuple syntax: defining \'name\' conflicts with previous value) [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: 1030,
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: 1030,
124+
),
125+
)),
126+
]

0 commit comments

Comments
 (0)