Skip to content

Commit

Permalink
fix(init): rm lockfile; update js-stellar-sdk (#1500)
Browse files Browse the repository at this point in the history
Co-authored-by: Chad Ostrowski <221614+chadoh@users.noreply.github.com>
  • Loading branch information
leighmcculloch and chadoh authored Aug 5, 2024
1 parent 0344571 commit 7902caf
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 1,490 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
SYSTEM_TEST_VERBOSE_OUTPUT: "true"

# the soroban test cases will compile various contracts from the examples repo
SYSTEM_TEST_SOROBAN_EXAMPLES_GIT_HASH: "782458d31395b0191ac40c9572ac53f13f573aa3"
SYSTEM_TEST_SOROBAN_EXAMPLES_GIT_HASH: "main"
SYSTEM_TEST_SOROBAN_EXAMPLES_GIT_REPO: "https://github.com/stellar/soroban-examples.git"

steps:
Expand Down
26 changes: 26 additions & 0 deletions cmd/crates/soroban-test/tests/it/init.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use assert_fs::prelude::*;
use predicates::prelude::predicate;
use soroban_test::TestEnv;

#[test]
fn init() {
let sandbox = TestEnv::default();
let major = soroban_cli::commands::version::pkg()
.split('.')
.next()
.unwrap();
sandbox
.new_assert_cmd("contract")
.arg("init")
.arg(".")
.assert()
.success();
sandbox
.dir()
.child("Cargo.toml")
.assert(predicate::function(|c: &str| {
let table = toml::from_str::<toml::Table>(c).unwrap();
table["workspace"]["dependencies"]["soroban-sdk"].as_str()
== Some(&format!("{major}.0.0"))
}));
}
1 change: 1 addition & 0 deletions cmd/crates/soroban-test/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod arg_parsing;
mod build;
mod config;
mod help;
mod init;
#[cfg(feature = "it")]
mod integration;
mod plugin;
Expand Down
12 changes: 9 additions & 3 deletions cmd/soroban-cli/src/commands/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ use clap::Parser;
use soroban_env_host::meta;
use std::fmt::Debug;

const GIT_REVISION: &str = env!("GIT_REVISION");

#[derive(Parser, Debug, Clone)]
#[group(skip)]
pub struct Cmd;
Expand All @@ -15,11 +13,19 @@ impl Cmd {
}
}

pub fn pkg() -> &'static str {
env!("CARGO_PKG_VERSION")
}

pub fn git() -> &'static str {
env!("GIT_REVISION")
}

pub fn long() -> String {
let env = soroban_env_host::VERSION;
let xdr = soroban_env_host::VERSION.xdr;
[
format!("{} ({GIT_REVISION})", env!("CARGO_PKG_VERSION")),
format!("{} ({})", pkg(), git()),
format!("soroban-env {} ({})", env.pkg, env.rev),
format!("soroban-env interface version {}", meta::INTERFACE_VERSION),
format!(
Expand Down
Loading

0 comments on commit 7902caf

Please sign in to comment.