Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove lock file from template and update sdk version #1500

Merged
merged 10 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
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"
willemneal marked this conversation as resolved.
Show resolved Hide resolved
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
Loading