Skip to content

Commit cda6a5e

Browse files
Merge pull request #6688 from Jiloc/chore/static-analysis-error-tests-3
test: third set of consensus tests for `CheckErrorKind` during contract analysis
2 parents f3f889f + 7d8bfb0 commit cda6a5e

File tree

16 files changed

+2069
-0
lines changed

16 files changed

+2069
-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: "3390089ac0826e8e5677d5093fa3d0db6081e88e6a1763017efc763d3cb96b16",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: bad-token-name-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: expecting an token name as an argument) [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: 5,
21+
write_count: 1,
22+
read_length: 1,
23+
read_count: 1,
24+
runtime: 1120,
25+
),
26+
),
27+
],
28+
total_block_cost: ExecutionCost(
29+
write_length: 5,
30+
write_count: 1,
31+
read_length: 1,
32+
read_count: 1,
33+
runtime: 1120,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "e5cab45ec9a8034bc8deefb862099bc775bad5bfca6bbe8896c5d4b69bd58773",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: bad-token-name-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: expecting an token name as an argument) [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: 5,
51+
write_count: 1,
52+
read_length: 1,
53+
read_count: 1,
54+
runtime: 1120,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 5,
60+
write_count: 1,
61+
read_length: 1,
62+
read_count: 1,
63+
runtime: 1120,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "dd195890bfe644b746de8f2d27e986a2cc8407929d3e7ca32ce18f1460a40348",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: bad-token-name-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: expecting an token name as an argument) [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: 5,
81+
write_count: 1,
82+
read_length: 1,
83+
read_count: 1,
84+
runtime: 1120,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 5,
90+
write_count: 1,
91+
read_length: 1,
92+
read_count: 1,
93+
runtime: 1120,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "bcc6deb5971a412ffbbf92f64405124ca3e0e0c1408e1da9d3da08d239e003a6",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: bad-token-name-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: expecting an token name as an argument) [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: 5,
111+
write_count: 1,
112+
read_length: 1,
113+
read_count: 1,
114+
runtime: 1120,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 5,
120+
write_count: 1,
121+
read_length: 1,
122+
read_count: 1,
123+
runtime: 1120,
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: "0baa8536816ea19016addf5641e710546c1337086d00ae90446b95d3cc4fab61",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: ccall-expect-name-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: missing contract name for call) [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: 2151,
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: 2151,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "2ed7c0c0aabed9df7b3fb279db73498156a063af779e047537f15f7d1a4fca97",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: ccall-expect-name-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: missing contract name for call) [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: 2151,
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: 2151,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "8f4226f89fa28f6cac5946c87e70301055d7bd8daf6e32545b99b6437a377940",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: ccall-expect-name-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: missing contract name for call) [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: 2151,
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: 2151,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "e294d7a75b14cf11124d8f842923b3e332b40c3fead74a57e2a224853c7d013b",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: ccall-expect-name-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: missing contract name for call) [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: 2151,
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: 2151,
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: "30261957397a00a1facce85f43fffe82dbd7cd0d962c822b904bec0ba1c73af3",
8+
evaluated_epoch: Epoch33,
9+
transactions: [
10+
ExpectedTransactionOutput(
11+
tx: "SmartContract(name: default-types-must-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
12+
vm_error: "Some(:0:0: expression types passed in \'default-to\' must match (got \'bool\' and \'int\')) [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: 28,
21+
write_count: 1,
22+
read_length: 1,
23+
read_count: 1,
24+
runtime: 4991,
25+
),
26+
),
27+
],
28+
total_block_cost: ExecutionCost(
29+
write_length: 28,
30+
write_count: 1,
31+
read_length: 1,
32+
read_count: 1,
33+
runtime: 4991,
34+
),
35+
)),
36+
Success(ExpectedBlockOutput(
37+
marf_hash: "3fab0f7cac72ffbd9fc0411401bdd99354e87f293ccfcfbe09bfbc9f2d8595a5",
38+
evaluated_epoch: Epoch33,
39+
transactions: [
40+
ExpectedTransactionOutput(
41+
tx: "SmartContract(name: default-types-must-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
42+
vm_error: "Some(:0:0: expression types passed in \'default-to\' must match (got \'bool\' and \'int\')) [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: 28,
51+
write_count: 1,
52+
read_length: 1,
53+
read_count: 1,
54+
runtime: 4991,
55+
),
56+
),
57+
],
58+
total_block_cost: ExecutionCost(
59+
write_length: 28,
60+
write_count: 1,
61+
read_length: 1,
62+
read_count: 1,
63+
runtime: 4991,
64+
),
65+
)),
66+
Success(ExpectedBlockOutput(
67+
marf_hash: "bdc2a354a99671fecc71486e56ce504660026e6c0b978621499dde9853d21b6b",
68+
evaluated_epoch: Epoch33,
69+
transactions: [
70+
ExpectedTransactionOutput(
71+
tx: "SmartContract(name: default-types-must-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
72+
vm_error: "Some(:0:0: expression types passed in \'default-to\' must match (got \'bool\' and \'int\')) [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: 28,
81+
write_count: 1,
82+
read_length: 1,
83+
read_count: 1,
84+
runtime: 4991,
85+
),
86+
),
87+
],
88+
total_block_cost: ExecutionCost(
89+
write_length: 28,
90+
write_count: 1,
91+
read_length: 1,
92+
read_count: 1,
93+
runtime: 4991,
94+
),
95+
)),
96+
Success(ExpectedBlockOutput(
97+
marf_hash: "7afcd0b4ec3fe54ff6b1f8d32e9c474a8221b0f26b0d9ffb166e9cfeec30c566",
98+
evaluated_epoch: Epoch33,
99+
transactions: [
100+
ExpectedTransactionOutput(
101+
tx: "SmartContract(name: default-types-must-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
102+
vm_error: "Some(:0:0: expression types passed in \'default-to\' must match (got \'bool\' and \'int\')) [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: 28,
111+
write_count: 1,
112+
read_length: 1,
113+
read_count: 1,
114+
runtime: 4991,
115+
),
116+
),
117+
],
118+
total_block_cost: ExecutionCost(
119+
write_length: 28,
120+
write_count: 1,
121+
read_length: 1,
122+
read_count: 1,
123+
runtime: 4991,
124+
),
125+
)),
126+
]

0 commit comments

Comments
 (0)