Skip to content

Commit d70d554

Browse files
authored
Merge branch 'develop' into feat/tx-replay-failsafe
2 parents 4cc0758 + f87444b commit d70d554

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+589
-309
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[alias]
22
stacks-node = "run --package stacks-node --"
33
fmt-stacks = "fmt -- --config group_imports=StdExternalCrate,imports_granularity=Module"
4-
clippy-stacks = "clippy -p stx-genesis -p libstackerdb -p stacks-signer -p pox-locking -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings"
4+
clippy-stacks = "clippy -p stx-genesis -p libstackerdb -p stacks-signer -p pox-locking -p clarity -p libsigner -p stacks-common --no-deps --tests --all-features -- -D warnings -A clippy::uninlined-format-args"
55

66
# Uncomment to improve performance slightly, at the cost of portability
77
# * Note that native binaries may not run on CPUs that are different from the build machine

.vscode/settings.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{
2-
"lldb.launch.sourceLanguages": [
3-
"rust"
4-
],
5-
"rust-analyzer.runnables.extraEnv": {
6-
"BITCOIND_TEST": "1"
7-
},
8-
"rust-analyzer.rustfmt.extraArgs": [
9-
"+nightly"
10-
],
11-
"files.eol": "\n"
12-
}
2+
"lldb.launch.sourceLanguages": ["rust"],
3+
"rust-analyzer.runnables.extraEnv": {
4+
"BITCOIND_TEST": "1"
5+
},
6+
"rust-analyzer.rustfmt.extraArgs": ["+nightly"],
7+
"files.eol": "\n"
8+
}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1414
- `stacks_node_miner_stop_reason_total`: Counts the number of times the miner stopped mining due to various reasons.
1515
- Always report the number of transactions mined in the last attempt, even if there were 0
1616

17+
- Added a new option `--hex-file <file_path>` to `blockstack-cli contract-call` command, that allows to pass a serialized Clarity value by file.
1718
- Added a new option `--postcondition-mode [allow, deny]` to `blockstack-cli publish` command, to set the post-condition mode to allow or deny on the transaction (default is deny)
1819

1920
### Changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clarity/src/vm/tests/assets.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,28 @@
1313
//
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16-
16+
#[cfg(test)]
1717
use stacks_common::types::StacksEpochId;
1818

19-
use crate::vm::ast::ASTRules;
20-
use crate::vm::contexts::{AssetMap, AssetMapEntry, OwnedEnvironment};
21-
use crate::vm::errors::{CheckErrors, Error, RuntimeErrorType};
19+
use crate::vm::contexts::{AssetMap, OwnedEnvironment};
20+
use crate::vm::errors::Error;
2221
use crate::vm::events::StacksTransactionEvent;
2322
use crate::vm::representations::SymbolicExpression;
24-
use crate::vm::tests::{
25-
execute, is_committed, is_err_code, symbols_from_values, test_clarity_versions, test_epochs,
26-
tl_env_factory as env_factory, TopLevelMemoryEnvironmentGenerator,
23+
use crate::vm::tests::{test_clarity_versions, test_epochs};
24+
use crate::vm::types::{PrincipalData, QualifiedContractIdentifier, Value};
25+
#[cfg(test)]
26+
use crate::vm::{
27+
ast::ASTRules,
28+
contexts::AssetMapEntry,
29+
errors::{CheckErrors, RuntimeErrorType},
30+
tests::{
31+
execute, is_committed, is_err_code, symbols_from_values, tl_env_factory as env_factory,
32+
TopLevelMemoryEnvironmentGenerator,
33+
},
34+
types::AssetIdentifier,
35+
version::ClarityVersion,
36+
ContractContext,
2737
};
28-
use crate::vm::types::{AssetIdentifier, PrincipalData, QualifiedContractIdentifier, Value};
29-
use crate::vm::version::ClarityVersion;
30-
use crate::vm::ContractContext;
3138

3239
const FIRST_CLASS_TOKENS: &str = "(define-fungible-token stackaroos)
3340
(define-read-only (my-ft-get-balance (account principal))

clarity/src/vm/tests/contracts.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@
1616

1717
#[cfg(any(test, feature = "testing"))]
1818
use rstest::rstest;
19-
use stacks_common::types::chainstate::BlockHeaderHash;
20-
use stacks_common::types::StacksEpochId;
19+
#[cfg(test)]
20+
use stacks_common::types::{chainstate::BlockHeaderHash, StacksEpochId};
2121

22-
use crate::vm::ast::errors::ParseErrors;
23-
use crate::vm::ast::ASTRules;
2422
use crate::vm::contexts::Environment;
25-
use crate::vm::errors::{CheckErrors, Error, RuntimeErrorType};
26-
use crate::vm::tests::{
27-
env_factory, execute, is_committed, is_err_code_i128 as is_err_code, symbols_from_values,
28-
test_clarity_versions, test_epochs, tl_env_factory, MemoryEnvironmentGenerator,
29-
TopLevelMemoryEnvironmentGenerator,
23+
use crate::vm::tests::{test_clarity_versions, test_epochs};
24+
use crate::vm::types::{PrincipalData, QualifiedContractIdentifier, StandardPrincipalData, Value};
25+
#[cfg(test)]
26+
use crate::vm::{
27+
ast::{errors::ParseErrors, ASTRules},
28+
errors::{CheckErrors, Error, RuntimeErrorType},
29+
tests::{
30+
env_factory, execute, is_committed, is_err_code_i128 as is_err_code, symbols_from_values,
31+
tl_env_factory, MemoryEnvironmentGenerator, TopLevelMemoryEnvironmentGenerator,
32+
},
33+
types::{OptionalData, ResponseData, TypeSignature},
34+
{execute as vm_execute, ClarityVersion, ContractContext},
3035
};
31-
use crate::vm::types::{
32-
OptionalData, PrincipalData, QualifiedContractIdentifier, ResponseData, StandardPrincipalData,
33-
TypeSignature, Value,
34-
};
35-
use crate::vm::{execute as vm_execute, ClarityVersion, ContractContext};
3636

3737
const FACTORIAL_CONTRACT: &str = "(define-map factorials { id: int } { current: int, index: int })
3838
(define-private (init-factorial (id int) (factorial int))

clarity/src/vm/tests/datamaps.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@
1313
//
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
16-
17-
use crate::vm::errors::{CheckErrors, Error, ShortReturnType};
18-
use crate::vm::types::{
19-
ListData, SequenceData, TupleData, TupleTypeSignature, TypeSignature, Value,
16+
use crate::vm::errors::Error;
17+
use crate::vm::types::{TupleData, Value};
18+
#[cfg(test)]
19+
use crate::vm::{
20+
errors::{CheckErrors, ShortReturnType},
21+
types::{ListData, SequenceData, TupleTypeSignature, TypeSignature},
2022
};
2123
use crate::vm::{execute, ClarityName};
2224

clarity/src/vm/tests/defines.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,21 @@
1818
use rstest::rstest;
1919
#[cfg(test)]
2020
use rstest_reuse::{self, *};
21+
#[cfg(test)]
2122
use stacks_common::types::StacksEpochId;
2223

23-
use crate::vm::ast::build_ast;
24-
use crate::vm::ast::errors::{ParseError, ParseErrors};
25-
use crate::vm::errors::{CheckErrors, Error, RuntimeErrorType};
24+
use crate::vm::errors::{CheckErrors, Error};
2625
use crate::vm::tests::test_clarity_versions;
27-
use crate::vm::types::{QualifiedContractIdentifier, TypeSignature, Value};
28-
use crate::vm::{execute, ClarityVersion};
26+
#[cfg(test)]
27+
use crate::vm::{
28+
ast::{
29+
build_ast,
30+
errors::{ParseError, ParseErrors},
31+
},
32+
errors::RuntimeErrorType,
33+
types::{QualifiedContractIdentifier, TypeSignature, Value},
34+
{execute, ClarityVersion},
35+
};
2936

3037
fn assert_eq_err(e1: CheckErrors, e2: Error) {
3138
let e1: Error = e1.into();

clarity/src/vm/tests/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
#![allow(unused_imports)]
18-
1917
use stacks_common::consts::{CHAIN_ID_MAINNET, CHAIN_ID_TESTNET};
2018
use stacks_common::types::StacksEpochId;
2119

2220
pub use super::test_util::*;
21+
#[cfg(test)]
2322
use super::ClarityVersion;
2423
use crate::vm::contexts::OwnedEnvironment;
2524
pub use crate::vm::database::BurnStateDB;
2625
use crate::vm::database::MemoryBackingStore;
27-
use crate::vm::errors::Error;
28-
use crate::vm::types::Value;
26+
#[cfg(test)]
27+
use crate::{vm::errors::Error, vm::types::Value};
2928

3029
mod assets;
3130
mod contracts;

clarity/src/vm/tests/principals.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
use hashbrown::HashMap;
21
use stacks_common::types::StacksEpochId;
32
use stacks_common::util::hash::hex_bytes;
43

54
use crate::vm::ast::ASTRules;
6-
use crate::vm::errors::CheckErrors;
7-
use crate::vm::functions::principals::PrincipalConstructErrorCode;
8-
use crate::vm::types::TypeSignature::PrincipalType;
95
use crate::vm::types::{
106
ASCIIData, BuffData, CharType, OptionalData, PrincipalData, QualifiedContractIdentifier,
11-
ResponseData, SequenceData, StandardPrincipalData, TupleData, TypeSignature, Value, BUFF_1,
12-
BUFF_20,
7+
SequenceData, StandardPrincipalData, TupleData, Value,
8+
};
9+
#[cfg(test)]
10+
use crate::vm::{
11+
errors::CheckErrors,
12+
functions::principals::PrincipalConstructErrorCode,
13+
types::TypeSignature::PrincipalType,
14+
types::{ResponseData, TypeSignature, BUFF_1, BUFF_20},
1315
};
1416
use crate::vm::{execute_with_parameters, ClarityVersion};
1517

0 commit comments

Comments
 (0)