Skip to content

Commit

Permalink
feat: introduce the stacks-codec component (#1399)
Browse files Browse the repository at this point in the history
* feat: introduce the stacks-codec component

* refactor: remove poxinfo

* refactor: import chainhook from gh

* refactor: remove dead code

* refactor: revert poxinfo changes

* chore: update cargo.lock

* chore: update cargo.lock

* chore: use default branch for chainhook
  • Loading branch information
hugocaillard committed Mar 29, 2024
1 parent 175103e commit 83e1383
Show file tree
Hide file tree
Showing 18 changed files with 107 additions and 173 deletions.
108 changes: 39 additions & 69 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"components/clarity-repl",
"components/clarity-events",
"components/hiro-system-kit",
"components/stacks-codec",
"components/stacks-devnet-js",
"components/stacks-network",
"components/stacks-rpc-client",
Expand All @@ -19,3 +20,7 @@ default-members = ["components/clarinet-cli"]

# [patch.crates-io]
# "clarity-vm" = { path = "../stacks-blockchain/clarity" }

# [patch.'https://github.com/hirosystems/chainhook.git']
# chainhook-sdk = {path = "../chainhook/components/chainhook-sdk" }
# chainhook-types = {path = "../chainhook/components/chainhook-types-rs" }
3 changes: 2 additions & 1 deletion components/clarinet-deployments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ base64 = "0.21.3"
tiny-hderive = { version = "0.3.0", optional = true }
libsecp256k1 = { version = "0.7.0", optional = true }
clarinet_utils = { package = "clarinet-utils", path = "../clarinet-utils", optional = true }
stacks-codec = { path = "../stacks-codec", optional = true }

[features]
default = ["cli"]
cli = ["clarity-repl/cli", "clarinet-files/cli", "onchain"]
cli = ["clarity-repl/cli", "clarinet-files/cli", "stacks-codec", "onchain"]
wasm = ["clarity-repl/wasm", "clarinet-files/wasm"]
onchain = [
"stacks-rpc-client",
Expand Down
14 changes: 7 additions & 7 deletions components/clarinet-deployments/src/onchain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ use clarity_repl::clarity::vm::types::{
};
use clarity_repl::clarity::vm::{ClarityName, Value};
use clarity_repl::clarity::{ClarityVersion, ContractName, EvaluationResult};
use clarity_repl::codec::{
SinglesigHashMode, SinglesigSpendingCondition, StacksString, StacksTransactionSigner,
TokenTransferMemo, TransactionAuth, TransactionContractCall, TransactionPayload,
TransactionPostConditionMode, TransactionPublicKeyEncoding, TransactionSmartContract,
TransactionSpendingCondition, TransactionVersion,
};
use clarity_repl::codec::{StacksTransaction, TransactionAnchorMode};
use clarity_repl::repl::session::{
BOOT_MAINNET_ADDRESS, BOOT_TESTNET_ADDRESS, V1_BOOT_CONTRACTS, V2_BOOT_CONTRACTS,
V3_BOOT_CONTRACTS,
};
use clarity_repl::repl::{Session, SessionSettings};
use reqwest::Url;
use stacks_codec::codec::{
SinglesigHashMode, SinglesigSpendingCondition, StacksString, StacksTransactionSigner,
TokenTransferMemo, TransactionAuth, TransactionContractCall, TransactionPayload,
TransactionPostConditionMode, TransactionPublicKeyEncoding, TransactionSmartContract,
TransactionSpendingCondition, TransactionVersion,
};
use stacks_codec::codec::{StacksTransaction, TransactionAnchorMode};
use stacks_rpc_client::StacksRpc;
use std::collections::{BTreeMap, HashSet, VecDeque};
use std::str::FromStr;
Expand Down
2 changes: 1 addition & 1 deletion components/clarinet-files/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2021"
serde = "1"
serde_derive = "1"
# chainhook-types = "1.2"
chainhook-types = { version = "1.2", git = "https://github.com/hirosystems/chainhook.git", branch="chore/update-clarinet-and-clarity" }
chainhook-types = { version = "1.2", git = "https://github.com/hirosystems/chainhook.git" }
bip39 = { version = "1.0.1", default-features = false }
libsecp256k1 = "0.7.0"
toml = { version = "0.5.6", features = ["preserve_order"] }
Expand Down
7 changes: 2 additions & 5 deletions components/clarity-repl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ reqwest = { version = "0.11", default-features = false, features = [
"json",
"rustls-tls",
] }
wsts = { version = "8.1.0", default-features = false, optional = true }

# WASM
wasm-bindgen = { version = "0.2.91", optional = true }
Expand Down Expand Up @@ -87,16 +86,14 @@ cli = [
"clarity/log",
"hiro_system_kit/tokio_helpers",
"clar2wasm",
"pox-locking/default",
"wsts"
"pox-locking/default"
]
sdk = [
"clarity/canonical",
"clarity/developer-mode",
"clarity/log",
"hiro_system_kit/tokio_helpers",
"pox-locking/default",
"wsts"
"pox-locking/default"
]
dap = [
"tokio",
Expand Down
3 changes: 0 additions & 3 deletions components/clarity-repl/src/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ extern crate prettytable;
#[macro_use]
extern crate hiro_system_kit;

#[macro_use]
mod macros;

pub mod analysis;
pub mod frontend;
pub mod repl;
Expand Down
15 changes: 5 additions & 10 deletions components/clarity-repl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,19 @@ extern crate serde_derive;
#[macro_use]
extern crate hiro_system_kit;

#[macro_use]
mod macros;

pub mod analysis;
#[cfg(not(feature = "wasm"))]
pub mod codec;
pub mod repl;
pub mod utils;

#[cfg(test)]
pub mod test_fixtures;

pub mod clarity {
#![allow(ambiguous_glob_reexports)]
pub use ::clarity::types::*;
pub use ::clarity::vm::*;
pub use ::clarity::*;
}
pub mod repl;
pub mod utils;

#[cfg(test)]
pub mod test_fixtures;

#[cfg(feature = "cli")]
pub mod frontend;
Expand Down
Loading

0 comments on commit 83e1383

Please sign in to comment.