Skip to content

Commit 46e72d8

Browse files
github-actions[bot]Paul Bellamyleighmcculloch
authored
Bump version to 0.3.0 (#291)
* Bump version to 0.3.0 * Bump soroban-rpc version to 0.3.0 * Don't publish soroban-tools * Remove soroban-tools * Remove soroban-tools * fix build.rs * fix build.rs * undo changing version that should be injected during build * Bugfixes for e2e tests in release/v0.3.0 branch (#294) * Fix account sequence numbers when deploy --wasm-hash Fixes #290 Fixes regression introduced in eadacec * Fix conflicting contract ids in e2e tests * Stop hard-coding salts in e2e tests to make them more robust This also means they are now independent, and do not need a clean network to run. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Paul Bellamy <paul@stellar.org> Co-authored-by: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com>
1 parent 36a0dd2 commit 46e72d8

File tree

12 files changed

+42
-119
lines changed

12 files changed

+42
-119
lines changed

Cargo.lock

Lines changed: 3 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,5 @@
1-
[package]
2-
name = "soroban-tools"
3-
description = "Soroban Tools"
4-
homepage = "https://github.com/stellar/soroban-cli"
5-
repository = "https://github.com/stellar/soroban-cli"
6-
authors = ["Stellar Development Foundation <info@stellar.org>"]
7-
license = "Apache-2.0"
8-
readme = "README.md"
9-
version = "0.2.1"
10-
edition = "2021"
11-
rust-version = "1.65"
12-
autobins = false
13-
build = "build.rs"
14-
15-
[build-dependencies]
16-
crate-git-revision = "0.0.4"
17-
18-
[[bin]]
19-
name = "soroban"
20-
path = "cmd/soroban-cli/src/main.rs"
21-
22-
[dependencies]
23-
soroban-env-host = { workspace = true, features = ["vm", "serde", "hostfn_log_fmt_values"] }
24-
soroban-spec = { workspace = true }
25-
soroban-token-spec = { workspace = true }
26-
stellar-strkey = { workspace = true }
27-
clap = { version = "3.1.18", features = ["derive", "env"] }
28-
base64 = "0.13.0"
29-
thiserror = "1.0.31"
30-
serde = "1.0.82"
31-
serde_derive = "1.0.82"
32-
serde_json = "1.0.82"
33-
hex = "0.4.3"
34-
tokio = { version = "1", features = ["full"] }
35-
warp = "0.3"
36-
clap_complete = "3.2.3"
37-
rand = "0.8.5"
38-
wasmparser = "0.90.0"
39-
sha2 = "0.10.6"
40-
csv = "1.1.6"
41-
ed25519-dalek = "1.0.1"
42-
jsonrpsee-http-client = "0.15.1"
43-
jsonrpsee-core = "0.15.1"
44-
regex = "1.6.0"
45-
wasm-opt = "0.110.1"
46-
47-
[dev_dependencies]
48-
assert_cmd = "2.0.4"
49-
assert_fs = "1.0.7"
50-
511
[workspace]
2+
resolver = "2"
523
members = [
534
"cmd/soroban-cli",
545
"cmd/soroban-cli/tests/fixtures/test-wasms/hello_world",

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ test: build-test-wasms
3030
cargo test --workspace
3131

3232
e2e-test:
33-
cargo test --test 'e2e*' -- --ignored
33+
cargo test --test it -- --ignored
3434

3535
check: Cargo.lock
3636
cargo clippy --all-targets

cmd/soroban-cli/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ repository = "https://github.com/stellar/soroban-cli"
66
authors = ["Stellar Development Foundation <info@stellar.org>"]
77
license = "Apache-2.0"
88
readme = "README.md"
9-
version = "0.1.2"
9+
version = "0.3.0"
1010
edition = "2021"
1111
rust-version = "1.64"
1212
autobins = false
13-
build = "../../build.rs"
1413

1514
[[bin]]
1615
name = "soroban"
File renamed without changes.

cmd/soroban-cli/src/deploy.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,13 @@ impl Cmd {
211211
// Get the account sequence number
212212
let public_strkey =
213213
stellar_strkey::StrkeyPublicKeyEd25519(key.public.to_bytes()).to_string();
214-
let account_details = client.get_account(&public_strkey).await?;
215214
// TODO: create a cmdline parameter for the fee instead of simply using the minimum fee
216215
let fee: u32 = 100;
217-
let sequence = account_details.sequence.parse::<i64>()?;
218216

219217
let wasm_hash = match contract_src {
220218
ContractSource::Wasm(wasm) => {
219+
let account_details = client.get_account(&public_strkey).await?;
220+
let sequence = account_details.sequence.parse::<i64>()?;
221221
let (tx, hash) = build_install_contract_code_tx(
222222
wasm,
223223
sequence + 1,
@@ -231,9 +231,11 @@ impl Cmd {
231231
ContractSource::WasmHash(wasm_hash) => Hash(wasm_hash),
232232
};
233233

234+
let account_details = client.get_account(&public_strkey).await?;
235+
let sequence = account_details.sequence.parse::<i64>()?;
234236
let (tx, contract_id) = build_create_contract_tx(
235237
wasm_hash,
236-
sequence + 2,
238+
sequence + 1,
237239
fee,
238240
self.network_passphrase.as_ref().unwrap(),
239241
salt,

cmd/soroban-cli/tests/fixtures/test-wasms/hello_world/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "test_hello_world"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = ["Stellar Development Foundation <info@stellar.org>"]
55
license = "Apache-2.0"
66
edition = "2021"

cmd/soroban-cli/tests/fixtures/test-wasms/invoker_account_exists/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "test_invoker_account_exists"
3-
version = "0.2.1"
3+
version = "0.3.0"
44
authors = ["Stellar Development Foundation <info@stellar.org>"]
55
license = "Apache-2.0"
66
edition = "2021"

tests/it/e2e_rpc_server.rs renamed to cmd/soroban-cli/tests/it/e2e_rpc_server.rs

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
use crate::util::{test_wasm, SorobanCommand, Standalone};
2+
use std::str;
23

34
// e2e tests are ignore by default
45
#[test]
56
#[ignore]
67
fn e2e_deploy_and_invoke_contract_against_rpc_server() {
78
// This test assumes a fresh standalone network rpc server on port 8000
89

9-
Standalone::new_cmd()
10+
let result = &Standalone::new_cmd()
1011
.arg("deploy")
1112
.arg("--wasm")
1213
.arg(test_wasm("test_hello_world"))
13-
.arg("--salt=0")
1414
.assert()
15-
.stdout("b392cd0044315873f32307bfd535a9cbbb0402a57133ff7283afcae66be8174b\n")
1615
.stderr("success\nsuccess\n")
1716
.success();
1817

18+
let id = str::from_utf8(&result.get_output().stdout).unwrap().trim();
19+
1920
Standalone::new_cmd()
2021
.arg("invoke")
21-
.arg("--id=b392cd0044315873f32307bfd535a9cbbb0402a57133ff7283afcae66be8174b")
22+
.arg("--id")
23+
.arg(id)
2224
.arg("--fn=hello")
2325
.arg("--arg=world")
2426
.assert()
@@ -32,27 +34,34 @@ fn e2e_deploy_and_invoke_contract_against_rpc_server() {
3234
#[ignore]
3335
fn e2e_install_deploy_and_invoke_contract_against_rpc_server() {
3436
// This test assumes a fresh standalone network rpc server on port 8000
35-
Standalone::new_cmd()
37+
let install_result = Standalone::new_cmd()
3638
.arg("install")
3739
.arg("--wasm")
3840
.arg(test_wasm("test_hello_world"))
3941
.assert()
40-
.stdout("86270dcca8dd4e7131c89dcc61223f096d7a1fa4a1d90c39dd6542b562369ecc\n")
4142
.stderr("success\n")
4243
.success();
4344

44-
Standalone::new_cmd()
45+
let wasm_hash = str::from_utf8(&install_result.get_output().stdout)
46+
.unwrap()
47+
.trim();
48+
49+
let deploy_result = &Standalone::new_cmd()
4550
.arg("deploy")
46-
.arg("--wasm-hash=86270dcca8dd4e7131c89dcc61223f096d7a1fa4a1d90c39dd6542b562369ecc")
47-
.arg("--salt=0")
51+
.arg("--wasm-hash")
52+
.arg(wasm_hash)
4853
.assert()
49-
.stdout("b392cd0044315873f32307bfd535a9cbbb0402a57133ff7283afcae66be8174b\n")
5054
.stderr("success\n")
5155
.success();
5256

57+
let id = str::from_utf8(&deploy_result.get_output().stdout)
58+
.unwrap()
59+
.trim();
60+
5361
Standalone::new_cmd()
5462
.arg("invoke")
55-
.arg("--id=b392cd0044315873f32307bfd535a9cbbb0402a57133ff7283afcae66be8174b")
63+
.arg("--id")
64+
.arg(id)
5665
.arg("--fn=hello")
5766
.arg("--arg=world")
5867
.assert()
@@ -66,25 +75,19 @@ fn e2e_install_deploy_and_invoke_contract_against_rpc_server() {
6675
fn create_and_invoke_token_contract_against_rpc_server() {
6776
// This test assumes a fresh standalone network rpc server on port 8000
6877

69-
Standalone::new_cmd()
70-
.args([
71-
"token",
72-
"create",
73-
"--name=Stellar Lumens",
74-
"--symbol=XLM",
75-
"--salt=1",
76-
])
78+
let result = Standalone::new_cmd()
79+
.args(["token", "create", "--name=Stellar Lumens", "--symbol=XLM"])
7780
.assert()
78-
.stdout("1bd2a2473623e73904d35a334476d1fe3cd192811bd823b7815fd9ce57c82232\n")
7981
.stderr("success\nsuccess\n")
8082
.success();
8183

84+
let id = str::from_utf8(&result.get_output().stdout).unwrap().trim();
85+
8286
Standalone::new_cmd()
83-
.args([
84-
"invoke",
85-
"--id=1bd2a2473623e73904d35a334476d1fe3cd192811bd823b7815fd9ce57c82232",
86-
"--fn=symbol",
87-
])
87+
.arg("invoke")
88+
.arg("--id")
89+
.arg(id)
90+
.arg("--fn=symbol")
8891
.assert()
8992
.stdout("[88,76,77]\n")
9093
.stderr("success\n")
File renamed without changes.

0 commit comments

Comments
 (0)