Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stackslib/src/chainstate/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pub mod consensus;
mod parse_tests;
mod static_analysis_tests;

use std::fs;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
source: stackslib/src/chainstate/tests/static_analysis_tests.rs
expression: result
---
[
Success(ExpectedBlockOutput(
marf_hash: "0263830e8d5e8a47c31382256d9608d41fb6d53b95ef85e3da06d70dc2cf5095",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-input-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
vm_error: "Some(:0:0: match requires an input of either a response or optional, found input: \'int\') [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 14,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1662,
),
),
],
total_block_cost: ExecutionCost(
write_length: 14,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1662,
),
)),
Success(ExpectedBlockOutput(
marf_hash: "4b39ac7225cca66a1fb2df3e471a3178d9fa54063fa3957bb40b84199f4af98d",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-input-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
vm_error: "Some(:0:0: match requires an input of either a response or optional, found input: \'int\') [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 14,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1662,
),
),
],
total_block_cost: ExecutionCost(
write_length: 14,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1662,
),
)),
Success(ExpectedBlockOutput(
marf_hash: "b936b54305cae864335b0b489fa4d6afb0001e7fed2f82df339bd1beca72af2a",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-input-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
vm_error: "Some(:0:0: match requires an input of either a response or optional, found input: \'int\') [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 14,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1662,
),
),
],
total_block_cost: ExecutionCost(
write_length: 14,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1662,
),
)),
Success(ExpectedBlockOutput(
marf_hash: "016e673aebdbb7cc7370029c118a8f5216574b7d2d8b4310f172be7666811262",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-input-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
vm_error: "Some(:0:0: match requires an input of either a response or optional, found input: \'int\') [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 14,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1662,
),
),
],
total_block_cost: ExecutionCost(
write_length: 14,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1662,
),
)),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
source: stackslib/src/chainstate/tests/static_analysis_tests.rs
expression: result
---
[
Success(ExpectedBlockOutput(
marf_hash: "97bdd398cc2e587a4a544054de83f26b716c28ba576ce0b73baf59227bf34f95",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-option-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expecting 4 arguments, got 3) [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1538,
),
),
],
total_block_cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1538,
),
)),
Success(ExpectedBlockOutput(
marf_hash: "c534c204ed354f05c2959377e96d25477fdfff0dc8133c8fc2425af464f46f5c",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-option-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expecting 4 arguments, got 3) [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1538,
),
),
],
total_block_cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1538,
),
)),
Success(ExpectedBlockOutput(
marf_hash: "769e0f2174f193dcae9cdbb5e80e0d8c8162a618f95a8be0ce98430ddf55e935",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-option-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expecting 4 arguments, got 3) [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1538,
),
),
],
total_block_cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1538,
),
)),
Success(ExpectedBlockOutput(
marf_hash: "8650a9ad98ee134b8ccdbabab4742e07f7a0fb64e7bfadb8eddbbcb597367b4e",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-option-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expecting 4 arguments, got 3) [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1538,
),
),
],
total_block_cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1538,
),
)),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
source: stackslib/src/chainstate/tests/static_analysis_tests.rs
expression: result
---
[
Success(ExpectedBlockOutput(
marf_hash: "5a73aac7831befd63163ac6f9a6ad5a0be69013687380f767e21afd1f0cac873",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-response-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
vm_error: "Some(:0:0: match on a result type uses the following syntax: (match input ok-name if-ok-expression err-name if-err-expression). Caused by: expecting 5 arguments, got 3) [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1485,
),
),
],
total_block_cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1485,
),
)),
Success(ExpectedBlockOutput(
marf_hash: "aaa3ebe5b7074a85bd68dc9bc9bb7d64bfeb8ea43916c35caecfa6804969c169",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-response-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
vm_error: "Some(:0:0: match on a result type uses the following syntax: (match input ok-name if-ok-expression err-name if-err-expression). Caused by: expecting 5 arguments, got 3) [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1485,
),
),
],
total_block_cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1485,
),
)),
Success(ExpectedBlockOutput(
marf_hash: "37e6347d1073a867b149d6dbb2093f29796d87d0a170762a261ca829248c6c4a",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-response-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
vm_error: "Some(:0:0: match on a result type uses the following syntax: (match input ok-name if-ok-expression err-name if-err-expression). Caused by: expecting 5 arguments, got 3) [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1485,
),
),
],
total_block_cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1485,
),
)),
Success(ExpectedBlockOutput(
marf_hash: "42b191d1207c0aa4a43f35887fbd7625df62f017bce9c016e74e5cad481b6971",
evaluated_epoch: Epoch33,
transactions: [
ExpectedTransactionOutput(
tx: "SmartContract(name: bad-match-response-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
vm_error: "Some(:0:0: match on a result type uses the following syntax: (match input ok-name if-ok-expression err-name if-err-expression). Caused by: expecting 5 arguments, got 3) [NON-CONSENSUS BREAKING]",
return_type: Response(ResponseData(
committed: false,
data: Optional(OptionalData(
data: None,
)),
)),
cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1485,
),
),
],
total_block_cost: ExecutionCost(
write_length: 11,
write_count: 1,
read_length: 1,
read_count: 1,
runtime: 1485,
),
)),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
source: stackslib/src/chainstate/tests/static_analysis_tests.rs
expression: result
---
[
Failure("Invalid Stacks block a58fcb42e51e055d3c11754df7c62976f69a02e9e4ffd7c83033fa7f670f229b: CostOverflowError(ExecutionCost { write_length: 0, write_count: 0, read_length: 0, read_count: 0, runtime: 0 }, ExecutionCost { write_length: 75013, write_count: 1, read_length: 1020001, read_count: 15001, runtime: 135183501 }, ExecutionCost { write_length: 15000000, write_count: 15000, read_length: 100000000, read_count: 15000, runtime: 5000000000 })"),
Failure("Invalid Stacks block 0b0d94606ac3b7adb14e1ae8dd5efb49504774555b3984eced1ab733da004fac: CostOverflowError(ExecutionCost { write_length: 0, write_count: 0, read_length: 0, read_count: 0, runtime: 0 }, ExecutionCost { write_length: 75013, write_count: 1, read_length: 1020001, read_count: 15001, runtime: 135168502 }, ExecutionCost { write_length: 15000000, write_count: 15000, read_length: 100000000, read_count: 15000, runtime: 5000000000 })"),
Failure("Invalid Stacks block 99c326760a910f67d9695673b15cce43602a161b31362d9e2ef388ab444306e2: CostOverflowError(ExecutionCost { write_length: 0, write_count: 0, read_length: 0, read_count: 0, runtime: 0 }, ExecutionCost { write_length: 75013, write_count: 1, read_length: 1020001, read_count: 15001, runtime: 135168502 }, ExecutionCost { write_length: 15000000, write_count: 15000, read_length: 100000000, read_count: 15000, runtime: 5000000000 })"),
Failure("Invalid Stacks block 92bd5f026210bd6c018ac4761cd4fb3d3968dec0fbda129673338933512b78bc: CostOverflowError(ExecutionCost { write_length: 0, write_count: 0, read_length: 0, read_count: 0, runtime: 0 }, ExecutionCost { write_length: 75013, write_count: 1, read_length: 1020001, read_count: 15001, runtime: 135168502 }, ExecutionCost { write_length: 15000000, write_count: 15000, read_length: 100000000, read_count: 15000, runtime: 5000000000 })"),
]
Loading
Loading