Skip to content

Commit

Permalink
release: 0.16.0 (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru authored Sep 24, 2021
1 parent 21b91e5 commit 3d68077
Show file tree
Hide file tree
Showing 12 changed files with 417 additions and 93 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ deno_core = { path = "./vendor/deno/core" }
deno_runtime = { path = "./vendor/deno/runtime" }
deno = { path = "./vendor/deno/cli" }
# clarity_repl = { package = "clarity-repl", path = "../../clarity-repl", features = ["cli"] }
clarity_repl = { package = "clarity-repl", version = "=0.14.2" }
clarity_repl = { package = "clarity-repl", version = "=0.16.0" }
bip39 = { version = "1.0.1", default-features = false }
aes = "0.6.0"
base64 = "0.13.0"
Expand Down
6 changes: 4 additions & 2 deletions deno/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,10 @@ export namespace types {
return `u"${val}"`;
}

export function buff(val: ArrayBuffer) {
const buff = new Uint8Array(val);
export function buff(val: ArrayBuffer | string) {

const buff = typeof val == "string" ? new TextEncoder().encode(val) : new Uint8Array(val);

const hexOctets = new Array(buff.length);

for (let i = 0; i < buff.length; ++i) {
Expand Down
4 changes: 2 additions & 2 deletions examples/counter/contracts/counter.clar
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
(define-public (decrement (step uint))
(let ((new-val (- step (var-get counter))))
(var-set counter new-val)
(print { object: "counter", action: "incremented", value: new-val })
(print { object: "counter", action: "decremented", value: new-val })
(ok new-val)))

(define-read-only (read-counter)
(ok (var-get counter)))
(ok (var-get counter)))
7 changes: 6 additions & 1 deletion src/frontend/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::generate::{
use crate::integrate::{self, DevnetOrchestrator};
use crate::poke::load_session;
use crate::publish::{publish_all_contracts, Network};
use crate::test::run_scripts;
use crate::runnner::run_scripts;
use crate::types::{MainConfig, MainConfigFile, RequirementConfig};
use clarity_repl::repl;

Expand Down Expand Up @@ -126,6 +126,9 @@ struct Test {
/// Generate coverage
#[clap(long = "coverage")]
pub coverage: bool,
/// Generate costs report
#[clap(long = "costs")]
pub costs_report: bool,
/// Path to Clarinet.toml
#[clap(long = "manifest-path")]
pub manifest_path: Option<String>,
Expand Down Expand Up @@ -311,6 +314,7 @@ pub fn main() {
run_scripts(
cmd.files,
cmd.coverage,
cmd.costs_report,
cmd.watch,
true,
false,
Expand All @@ -333,6 +337,7 @@ pub fn main() {
vec![cmd.script],
false,
false,
false,
cmd.allow_wallets,
cmd.allow_disk_write,
manifest_path,
Expand Down
6 changes: 3 additions & 3 deletions src/generate/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ history.txt
[project]
name = "{}"
[contracts]
[notebooks]
# [contracts.counter]
# path = "contracts/counter.clar"
# depends_on = []
"#,
self.project_name
);
Expand Down
3 changes: 2 additions & 1 deletion src/integrate/events_observer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::{DevnetEvent, NodeObserverEvent};
use crate::integrate::{BlockData, MempoolAdmissionData, ServiceStatusData, Status, Transaction};
use crate::poke::load_session;
use crate::publish::{publish_contract, Network};
use crate::test::deno;
use crate::runnner::deno;
use crate::types::{self, AccountConfig, DevnetConfig};
use crate::utils;
use crate::utils::stacks::{transactions, StacksRpc};
Expand Down Expand Up @@ -109,6 +109,7 @@ impl EventObserverConfig {
vec![cmd.script.clone()],
false,
false,
false,
cmd.allow_wallets,
cmd.allow_write,
self.manifest_path.clone(),
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod generate;
mod integrate;
mod poke;
mod publish;
mod test;
mod runnner;
mod types;
mod utils;

Expand Down
11 changes: 8 additions & 3 deletions src/poke/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,14 @@ pub fn load_session(
});
}

settings.include_boot_contracts =
vec!["pox".to_string(), "costs".to_string(), "bns".to_string()];
settings.include_boot_contracts = vec![
"pox".to_string(),
"costs-v1".to_string(),
"costs-v2".to_string(),
"bns".to_string(),
];
settings.initial_deployer = initial_deployer;
settings.costs_version = project_config.project.costs_version;

let session = if start_repl {
let mut terminal = Terminal::new(settings.clone());
Expand All @@ -105,7 +110,7 @@ pub fn load_session(
let mut session = repl::Session::new(settings.clone());
match session.start() {
Err(message) => {
println!("Error: {}", message);
println!("{}", message);
std::process::exit(1);
}
_ => {}
Expand Down
Loading

0 comments on commit 3d68077

Please sign in to comment.