From 501379da86286918f4953fe7323038ea5d264ada Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 2 Dec 2022 01:08:51 -0800 Subject: [PATCH] Bump version to 0.3.0 (#779) --- .github/workflows/rust.yml | 2 +- Cargo.lock | 58 ++++++++++++++++---------------- Cargo.toml | 30 ++++++++--------- Makefile | 12 +++++++ soroban-auth/Cargo.toml | 2 +- soroban-auth/README.md | 15 +++++++++ soroban-sdk/Cargo.toml | 2 +- soroban-sdk/README.md | 34 +++++++++++++++++++ soroban-sdk/src/lib.rs | 2 +- tests/add_i128/Cargo.toml | 2 +- tests/add_u128/Cargo.toml | 2 +- tests/add_u64/Cargo.toml | 2 +- tests/contract_data/Cargo.toml | 2 +- tests/empty/Cargo.toml | 2 +- tests/errors/Cargo.toml | 2 +- tests/events/Cargo.toml | 2 +- tests/import_contract/Cargo.toml | 2 +- tests/invoke_contract/Cargo.toml | 2 +- tests/logging/Cargo.toml | 2 +- tests/udt/Cargo.toml | 2 +- 20 files changed, 120 insertions(+), 59 deletions(-) create mode 100644 soroban-auth/README.md create mode 100644 soroban-sdk/README.md diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ef3ef8d06..df29d39c3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -77,5 +77,5 @@ jobs: uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@main with: runs-on: ${{ matrix.sys.os }} - target: ${ matrix.sys.target }} + target: ${{ matrix.sys.target }} cargo-hack-feature-options: ${{ matrix.sys.cargo-hack-feature-options }} diff --git a/Cargo.lock b/Cargo.lock index be4084a0e..26bb4b71a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -872,7 +872,7 @@ dependencies = [ [[package]] name = "soroban-auth" -version = "0.2.1" +version = "0.3.0" dependencies = [ "ed25519-dalek", "rand 0.7.3", @@ -881,8 +881,8 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "0.0.9" -source = "git+https://github.com/stellar/rs-soroban-env?rev=eda2ab70#eda2ab70fbc2a9f78a12f54a211e308d1b6ac1b7" +version = "0.0.10" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c1480516#c14805161b54ba272108ba0503057683f2a688a2" dependencies = [ "crate-git-revision", "serde", @@ -894,8 +894,8 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "0.0.9" -source = "git+https://github.com/stellar/rs-soroban-env?rev=eda2ab70#eda2ab70fbc2a9f78a12f54a211e308d1b6ac1b7" +version = "0.0.10" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c1480516#c14805161b54ba272108ba0503057683f2a688a2" dependencies = [ "soroban-env-common", "static_assertions", @@ -903,8 +903,8 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "0.0.9" -source = "git+https://github.com/stellar/rs-soroban-env?rev=eda2ab70#eda2ab70fbc2a9f78a12f54a211e308d1b6ac1b7" +version = "0.0.10" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c1480516#c14805161b54ba272108ba0503057683f2a688a2" dependencies = [ "backtrace", "curve25519-dalek", @@ -926,8 +926,8 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "0.0.9" -source = "git+https://github.com/stellar/rs-soroban-env?rev=eda2ab70#eda2ab70fbc2a9f78a12f54a211e308d1b6ac1b7" +version = "0.0.10" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c1480516#c14805161b54ba272108ba0503057683f2a688a2" dependencies = [ "itertools", "proc-macro2", @@ -938,7 +938,7 @@ dependencies = [ [[package]] name = "soroban-ledger-snapshot" -version = "0.2.1" +version = "0.3.0" dependencies = [ "pretty_assertions", "serde", @@ -948,8 +948,8 @@ dependencies = [ [[package]] name = "soroban-native-sdk-macros" -version = "0.0.9" -source = "git+https://github.com/stellar/rs-soroban-env?rev=eda2ab70#eda2ab70fbc2a9f78a12f54a211e308d1b6ac1b7" +version = "0.0.10" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c1480516#c14805161b54ba272108ba0503057683f2a688a2" dependencies = [ "itertools", "proc-macro2", @@ -959,7 +959,7 @@ dependencies = [ [[package]] name = "soroban-sdk" -version = "0.2.1" +version = "0.3.0" dependencies = [ "bytes-lit", "ed25519-dalek", @@ -976,7 +976,7 @@ dependencies = [ [[package]] name = "soroban-sdk-macros" -version = "0.2.1" +version = "0.3.0" dependencies = [ "darling", "itertools", @@ -991,7 +991,7 @@ dependencies = [ [[package]] name = "soroban-spec" -version = "0.2.1" +version = "0.3.0" dependencies = [ "base64", "darling", @@ -1012,7 +1012,7 @@ dependencies = [ [[package]] name = "soroban-token-spec" -version = "0.2.1" +version = "0.3.0" dependencies = [ "ed25519-dalek", "rand 0.7.3", @@ -1065,8 +1065,8 @@ dependencies = [ [[package]] name = "stellar-xdr" -version = "0.0.7" -source = "git+https://github.com/stellar/rs-stellar-xdr?rev=2775f4b6#2775f4b6f6ce2c9fcc22af42b0709d1047fabf8f" +version = "0.0.9" +source = "git+https://github.com/stellar/rs-stellar-xdr?rev=1309e3de#1309e3de46fcb01743f818831de3a9ac4a5b1ab6" dependencies = [ "base64", "crate-git-revision", @@ -1121,77 +1121,77 @@ dependencies = [ [[package]] name = "test_add_i128" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_add_u128" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_add_u64" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_contract_data" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_empty" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_errors" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_events" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_import_contract" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_invoke_contract" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_logging" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_udt" -version = "0.2.1" +version = "0.3.0" dependencies = [ "soroban-sdk", ] diff --git a/Cargo.toml b/Cargo.toml index 10f3fa0e4..2eb13d9ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,30 +22,30 @@ members = [ ] [workspace.package] -version = "0.2.1" +version = "0.3.0" [workspace.dependencies] -soroban-sdk = { version = "0.2.1", path = "soroban-sdk" } -soroban-sdk-macros = { version = "0.2.1", path = "soroban-sdk-macros" } -soroban-auth = { version = "0.2.1", path = "soroban-auth" } -soroban-spec = { version = "0.2.1", path = "soroban-spec" } -soroban-ledger-snapshot = { version = "0.2.1", path = "soroban-ledger-snapshot" } -soroban-token-spec = { version = "0.2.1", path = "soroban-token-spec" } +soroban-sdk = { version = "0.3.0", path = "soroban-sdk" } +soroban-sdk-macros = { version = "0.3.0", path = "soroban-sdk-macros" } +soroban-auth = { version = "0.3.0", path = "soroban-auth" } +soroban-spec = { version = "0.3.0", path = "soroban-spec" } +soroban-ledger-snapshot = { version = "0.3.0", path = "soroban-ledger-snapshot" } +soroban-token-spec = { version = "0.3.0", path = "soroban-token-spec" } [workspace.dependencies.soroban-env-common] -version = "0.0.9" +version = "0.0.10" git = "https://github.com/stellar/rs-soroban-env" -rev = "eda2ab70" +rev = "c1480516" [workspace.dependencies.soroban-env-guest] -version = "0.0.9" +version = "0.0.10" git = "https://github.com/stellar/rs-soroban-env" -rev = "eda2ab70" +rev = "c1480516" [workspace.dependencies.soroban-env-host] -version = "0.0.9" +version = "0.0.10" git = "https://github.com/stellar/rs-soroban-env" -rev = "eda2ab70" +rev = "c1480516" [workspace.dependencies.stellar-strkey] version = "0.0.6" @@ -53,9 +53,9 @@ git = "https://github.com/stellar/rs-stellar-strkey" rev = "5e582a8b" [workspace.dependencies.stellar-xdr] -version = "0.0.7" +version = "0.0.9" git = "https://github.com/stellar/rs-stellar-xdr" -rev = "2775f4b6" +rev = "1309e3de" default-features = false # [patch."https://github.com/stellar/rs-soroban-env"] diff --git a/Makefile b/Makefile index 210979e3d..764df3883 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,18 @@ check: build fmt cargo hack --feature-powerset --exclude-features docs check cargo hack check --release --target wasm32-unknown-unknown +readme: + cd soroban-sdk \ + && cargo +nightly rustdoc -- -Zunstable-options -wjson \ + && cat ../target/doc/soroban_sdk.json \ + | jq -r '.index[.root].docs' \ + > README.md + cd soroban-auth \ + && cargo +nightly rustdoc -- -Zunstable-options -wjson \ + && cat ../target/doc/soroban_auth.json \ + | jq -r '.index[.root].docs' \ + > README.md + watch: cargo watch --clear --watch-when-idle --shell '$(MAKE)' diff --git a/soroban-auth/Cargo.toml b/soroban-auth/Cargo.toml index 8be84521e..7b8697136 100644 --- a/soroban-auth/Cargo.toml +++ b/soroban-auth/Cargo.toml @@ -4,7 +4,7 @@ description = "Soroban authorization sdk" homepage = "https://github.com/stellar/rs-soroban-sdk" repository = "https://github.com/stellar/rs-soroban-sdk" authors = ["Stellar Development Foundation "] -readme = "../README.md" +readme = "README.md" license = "Apache-2.0" version.workspace = true edition = "2021" diff --git a/soroban-auth/README.md b/soroban-auth/README.md new file mode 100644 index 000000000..99157aa17 --- /dev/null +++ b/soroban-auth/README.md @@ -0,0 +1,15 @@ +Soroban auth provides basic authentication capabilities to Soroban +contracts. + +For contracts that require basic authentication capabilities this crate may +do some of the heavy lifting for supporting authentication by Stellar +accounts, ed25519 signatures, or other contracts. For contracts that require +more bespoke authentication this crate may not be suitable. + +See [`verify`] for how to use. + +See [`testutils`] for test utilities. + +**The utilities in this crate provide no replay protection. Contracts must +provide their own mechanism suitable for replay prevention that prevents +contract invocations to be replayable if it is important they are not.** diff --git a/soroban-sdk/Cargo.toml b/soroban-sdk/Cargo.toml index 7460088b1..7e52f02b0 100644 --- a/soroban-sdk/Cargo.toml +++ b/soroban-sdk/Cargo.toml @@ -4,7 +4,7 @@ description = "Soroban SDK." homepage = "https://github.com/stellar/rs-soroban-sdk" repository = "https://github.com/stellar/rs-soroban-sdk" authors = ["Stellar Development Foundation "] -readme = "../README.md" +readme = "README.md" license = "Apache-2.0" version.workspace = true edition = "2021" diff --git a/soroban-sdk/README.md b/soroban-sdk/README.md new file mode 100644 index 000000000..b320bbf3e --- /dev/null +++ b/soroban-sdk/README.md @@ -0,0 +1,34 @@ +Soroban SDK supports writing programs for the Soroban smart contract +platform. + +### Docs + +See [soroban.stellar.org](https://soroban.stellar.org) for documentation. + +### Examples + +```rust +use soroban_sdk::{contractimpl, symbol, vec, BytesN, Env, Symbol, Vec}; + +pub struct HelloContract; + +#[contractimpl] +impl HelloContract { + pub fn hello(env: Env, to: Symbol) -> Vec { + vec![&env, symbol!("Hello"), to] + } +} + +#[test] +fn test() { + let env = Env::default(); + let contract_id = env.register_contract(None, HelloContract); + let client = HelloContractClient::new(&env, &contract_id); + + let words = client.hello(&symbol!("Dev")); + + assert_eq!(words, vec![&env, symbol!("Hello"), symbol!("Dev"),]); +} +``` + +More examples are available at . diff --git a/soroban-sdk/src/lib.rs b/soroban-sdk/src/lib.rs index 540bcb221..fee23b623 100644 --- a/soroban-sdk/src/lib.rs +++ b/soroban-sdk/src/lib.rs @@ -7,7 +7,7 @@ //! //! ### Examples //! -//! ``` +//! ```rust //! use soroban_sdk::{contractimpl, symbol, vec, BytesN, Env, Symbol, Vec}; //! //! pub struct HelloContract; diff --git a/tests/add_i128/Cargo.toml b/tests/add_i128/Cargo.toml index ceecd4ea1..d596a4e0d 100644 --- a/tests/add_i128/Cargo.toml +++ b/tests/add_i128/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_add_i128" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" diff --git a/tests/add_u128/Cargo.toml b/tests/add_u128/Cargo.toml index 2f1059a09..ec44423a4 100644 --- a/tests/add_u128/Cargo.toml +++ b/tests/add_u128/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_add_u128" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" diff --git a/tests/add_u64/Cargo.toml b/tests/add_u64/Cargo.toml index 670f557cf..958ef9c08 100644 --- a/tests/add_u64/Cargo.toml +++ b/tests/add_u64/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_add_u64" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" diff --git a/tests/contract_data/Cargo.toml b/tests/contract_data/Cargo.toml index dda4748fe..1d3c6e50f 100644 --- a/tests/contract_data/Cargo.toml +++ b/tests/contract_data/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_contract_data" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" diff --git a/tests/empty/Cargo.toml b/tests/empty/Cargo.toml index 83bc1e292..33430b667 100644 --- a/tests/empty/Cargo.toml +++ b/tests/empty/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_empty" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" diff --git a/tests/errors/Cargo.toml b/tests/errors/Cargo.toml index b0a5f0205..4f286d316 100644 --- a/tests/errors/Cargo.toml +++ b/tests/errors/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_errors" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" diff --git a/tests/events/Cargo.toml b/tests/events/Cargo.toml index 9652b9ddf..3048978e6 100644 --- a/tests/events/Cargo.toml +++ b/tests/events/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_events" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" diff --git a/tests/import_contract/Cargo.toml b/tests/import_contract/Cargo.toml index cc75bd820..c953ef78b 100644 --- a/tests/import_contract/Cargo.toml +++ b/tests/import_contract/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_import_contract" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" diff --git a/tests/invoke_contract/Cargo.toml b/tests/invoke_contract/Cargo.toml index 1c1b1efbe..5cb5357f0 100644 --- a/tests/invoke_contract/Cargo.toml +++ b/tests/invoke_contract/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_invoke_contract" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" diff --git a/tests/logging/Cargo.toml b/tests/logging/Cargo.toml index 9460cc4cd..003aa2e8c 100644 --- a/tests/logging/Cargo.toml +++ b/tests/logging/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_logging" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" diff --git a/tests/udt/Cargo.toml b/tests/udt/Cargo.toml index eb2c7915e..8d8394c16 100644 --- a/tests/udt/Cargo.toml +++ b/tests/udt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_udt" -version = "0.2.1" +version.workspace = true authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021"