Skip to content

Commit

Permalink
Merge branch 'main' into durability-bump-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
KoxyG authored Oct 3, 2024
2 parents 6fc1f16 + 88a8ca9 commit a355216
Show file tree
Hide file tree
Showing 23 changed files with 337 additions and 200 deletions.
87 changes: 53 additions & 34 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ termcolor_output = "1.0.1"
ed25519-dalek = ">= 2.1.1"

# networking
http = "1.0.0"
jsonrpsee-http-client = "0.20.1"
jsonrpsee-core = "0.20.1"
tokio = "1.28.1"
Expand Down
8 changes: 2 additions & 6 deletions FULL_HELP_DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,14 @@ Utilities to deploy a Stellar Asset Contract or get its id

Get Id of builtin Soroban Asset Contract. Deprecated, use `stellar contract id asset` instead

**Usage:** `stellar contract asset id [OPTIONS] --asset <ASSET> --source-account <SOURCE_ACCOUNT>`
**Usage:** `stellar contract asset id [OPTIONS] --asset <ASSET>`

###### **Options:**

* `--asset <ASSET>` — ID of the Stellar classic asset to wrap, e.g. "USDC:G...5"
* `--rpc-url <RPC_URL>` — RPC server endpoint
* `--network-passphrase <NETWORK_PASSPHRASE>` — Network passphrase to sign the transaction sent to the rpc server
* `--network <NETWORK>` — Name of network to use from config
* `--source-account <SOURCE_ACCOUNT>` — Account that where transaction originates from. Alias `source`. Can be an identity (--source alice), a public key (--source GDKW...), a muxed account (--source MDA…), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). If `--build-only` or `--sim-only` flags were NOT provided, this key will also be used to sign the final transaction. In that case, trying to sign with public key will fail
* `--hd-path <HD_PATH>` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0`
* `--global` — Use global config
* `--config-dir <CONFIG_DIR>` — Location of config directory, default is "."

Expand Down Expand Up @@ -434,16 +432,14 @@ Generate the contract id for a given contract or asset

Deploy builtin Soroban Asset Contract

**Usage:** `stellar contract id asset [OPTIONS] --asset <ASSET> --source-account <SOURCE_ACCOUNT>`
**Usage:** `stellar contract id asset [OPTIONS] --asset <ASSET>`

###### **Options:**

* `--asset <ASSET>` — ID of the Stellar classic asset to wrap, e.g. "USDC:G...5"
* `--rpc-url <RPC_URL>` — RPC server endpoint
* `--network-passphrase <NETWORK_PASSPHRASE>` — Network passphrase to sign the transaction sent to the rpc server
* `--network <NETWORK>` — Name of network to use from config
* `--source-account <SOURCE_ACCOUNT>` — Account that where transaction originates from. Alias `source`. Can be an identity (--source alice), a public key (--source GDKW...), a muxed account (--source MDA…), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). If `--build-only` or `--sim-only` flags were NOT provided, this key will also be used to sign the final transaction. In that case, trying to sign with public key will fail
* `--hd-path <HD_PATH>` — If using a seed phrase, which hierarchical deterministic path to use, e.g. `m/44'/148'/{hd_path}`. Example: `--hd-path 1`. Default: `0`
* `--global` — Use global config
* `--config-dir <CONFIG_DIR>` — Location of config directory, default is "."

Expand Down
2 changes: 0 additions & 2 deletions cmd/crates/soroban-test/tests/it/integration/cookbook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ mod tests {
.arg("asset")
.arg("--asset")
.arg("native")
.arg("--source-account")
.arg(source)
.assert()
.stdout_as_str();
let contract_id = deploy_hello(&sandbox).await;
Expand Down
9 changes: 1 addition & 8 deletions cmd/crates/soroban-test/tests/it/integration/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,7 @@ pub async fn extend_contract(sandbox: &TestEnv, id: &str) {
}

pub async fn extend(sandbox: &TestEnv, id: &str, value: Option<&str>) {
let mut args = vec![
"--id",
id,
// "--durability",
// "persistent",
"--ledgers-to-extend",
"100001",
];

if let Some(value) = value {
args.push("--key");
args.push(value);
Expand Down
23 changes: 11 additions & 12 deletions cmd/soroban-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,18 @@ wasmparser = { workspace = true }
sha2 = { workspace = true }
csv = "1.1.6"
ed25519-dalek = { workspace = true }
reqwest = { version = "0.12.7", default-features = false, features = [
"rustls-tls",
"http2",
"json",
"blocking",
"stream",
] }
jsonrpsee-http-client = "0.20.1"
jsonrpsee-core = "0.20.1"
hyper = "0.14.27"
hyper-tls = "0.5"
http = "0.2.9"
regex = "1.6.0"
wasm-opt = { version = "0.114.0", optional = true }
chrono = { version = "0.4.27", features = ["serde"]}
chrono = { version = "0.4.27", features = ["serde"] }
rpassword = "7.2.0"
dirs = "4.0.0"
toml = "0.5.9"
Expand All @@ -107,13 +111,12 @@ gix = { version = "0.58.0", default-features = false, features = [
"blocking-http-transport-reqwest-rust-tls",
"worktree-mutation",
] }
ureq = { version = "2.9.1", features = ["json"] }
async-compression = { version = "0.4.12", features = [ "tokio", "gzip" ] }
async-compression = { version = "0.4.12", features = ["tokio", "gzip"] }

tempfile = "3.8.1"
toml_edit = "0.21.0"
rust-embed = { version = "8.2.0", features = ["debug-embed"] }
bollard = { workspace=true }
bollard = { workspace = true }
futures-util = "0.3.30"
futures = "0.3.30"
home = "0.5.9"
Expand All @@ -127,19 +130,15 @@ fqdn = "0.3.12"
open = "5.3.0"
url = "2.5.2"

# For hyper-tls
[target.'cfg(unix)'.dependencies]
openssl = { version = "=0.10.55", features = ["vendored"] }

[build-dependencies]
crate-git-revision = "0.0.4"
serde.workspace = true
thiserror.workspace = true
ureq = { version = "2.9.1", features = ["json"] }


[dev-dependencies]
assert_cmd = "2.0.4"
assert_fs = "1.0.7"
predicates = "2.1.5"
walkdir = "2.5.0"
mockito = "1.5.0"
5 changes: 2 additions & 3 deletions cmd/soroban-cli/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use clap::CommandFactory;
use dotenvy::dotenv;
use std::thread;
use tracing_subscriber::{fmt, EnvFilter};

use crate::upgrade_check::upgrade_check;
Expand Down Expand Up @@ -75,8 +74,8 @@ pub async fn main() {
// Spawn a thread to check if a new version exists.
// It depends on logger, so we need to place it after
// the code block that initializes the logger.
thread::spawn(move || {
upgrade_check(root.global_args.quiet);
tokio::spawn(async move {
upgrade_check(root.global_args.quiet).await;
});

let printer = print::Print::new(root.global_args.quiet);
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/contract/id/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct Cmd {
pub asset: builder::Asset,

#[command(flatten)]
pub config: config::Args,
pub config: config::ArgsLocatorAndNetwork,
}
#[derive(thiserror::Error, Debug)]
pub enum Error {
Expand Down
4 changes: 2 additions & 2 deletions cmd/soroban-cli/src/commands/contract/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use std::{
sync::atomic::AtomicBool,
};
use toml_edit::{Document, TomlError};
use ureq::get;

use crate::utils::http;
use crate::{commands::global, print};

const SOROBAN_EXAMPLES_URL: &str = "https://github.com/stellar/soroban-examples.git";
Expand Down Expand Up @@ -261,7 +261,7 @@ impl Runner {
}

fn check_internet_connection() -> bool {
if let Ok(_req) = get(GITHUB_URL).call() {
if let Ok(_req) = http::blocking_client().get(GITHUB_URL).send() {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-cli/src/commands/network/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub enum Error {
impl Cmd {
pub async fn run(&self, global_args: &global::Args) -> Result<(), Error> {
match &self {
Cmd::Logs(cmd) => cmd.run().await?,
Cmd::Logs(cmd) => cmd.run(global_args).await?,
Cmd::Start(cmd) => cmd.run(global_args).await?,
Cmd::Stop(cmd) => cmd.run(global_args).await?,
}
Expand Down
10 changes: 7 additions & 3 deletions cmd/soroban-cli/src/commands/network/container/logs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use futures_util::TryStreamExt;

use crate::commands::network::container::shared::Error as ConnectionError;
use crate::{
commands::{global, network::container::shared::Error as ConnectionError},
print,
};

use super::shared::{Args, Name};

Expand All @@ -23,9 +26,10 @@ pub struct Cmd {
}

impl Cmd {
pub async fn run(&self) -> Result<(), Error> {
pub async fn run(&self, global_args: &global::Args) -> Result<(), Error> {
let print = print::Print::new(global_args.quiet);
let container_name = Name(self.name.clone()).get_internal_container_name();
let docker = self.container_args.connect_to_docker().await?;
let docker = self.container_args.connect_to_docker(&print).await?;
let logs_stream = &mut docker.logs(
&container_name,
Some(bollard::container::LogsOptions {
Expand Down
Loading

0 comments on commit a355216

Please sign in to comment.