diff --git a/.github/workflows/bindings-ts.yml b/.github/workflows/bindings-ts.yml new file mode 100644 index 0000000000..62469fd7d5 --- /dev/null +++ b/.github/workflows/bindings-ts.yml @@ -0,0 +1,43 @@ + +name: bindings typescript + +on: + push: + branches: [main, release/**] + pull_request: + +jobs: + test: + name: test generated libraries + runs-on: ubuntu-22.04 + services: + rpc: + image: stellar/quickstart:soroban-dev@sha256:0ad51035cf7caba2fd99c7c1fad0945df6932be7d5c893e1520ccdef7d6a6ffe + ports: + - 8000:8000 + env: + ENABLE_LOGS: true + NETWORK: local + ENABLE_SOROBAN_RPC: true + options: >- + --health-cmd "curl --no-progress-meter --fail-with-body -X POST \"http://localhost:8000/soroban/rpc\" -H 'Content-Type: application/json' -d '{\"jsonrpc\":\"2.0\",\"id\":8675309,\"method\":\"getNetwork\"}' && curl --no-progress-meter \"http://localhost:8000/friendbot\" | grep '\"invalid_field\": \"addr\"'" + --health-interval 10s + --health-timeout 5s + --health-retries 50 + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - run: rustup update + - run: cargo build + - run: rustup target add wasm32-unknown-unknown + - run: make build-test-wasms + - run: npm ci && npm run test + working-directory: cmd/crates/soroban-spec-typescript/ts-tests diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index a355ff4871..0ca517d07e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -22,7 +22,7 @@ jobs: # core git ref should be latest commit for stable soroban functionality # the core bin can either be compiled in-line here as part of ci, - SYSTEM_TEST_CORE_GIT_REF: https://github.com/stellar/stellar-core.git#v20.0.2 + SYSTEM_TEST_CORE_GIT_REF: https://github.com/stellar/stellar-core.git#v20.1.0 SYSTEM_TEST_CORE_COMPILE_CONFIGURE_FLAGS: "--disable-tests" # or set SYSTEM_TEST_CORE_GIT_REF to empty, and set SYSTEM_TEST_CORE_IMAGE # to pull a pre-compiled image from dockerhub instead @@ -44,7 +44,7 @@ jobs: SYSTEM_TEST_JS_STELLAR_SDK_GH_REF: # the version of rs-stellar-xdr to use for quickstart - SYSTEM_TEST_RS_XDR_GIT_REF: v20.0.1 + SYSTEM_TEST_RS_XDR_GIT_REF: v20.0.2 # system test will build quickstart image internally to use for running the service stack # configured in standalone network mode(core, rpc) diff --git a/.github/workflows/rust-version.yml b/.github/workflows/rust-version.yml deleted file mode 100644 index 4fc93c4211..0000000000 --- a/.github/workflows/rust-version.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Rust Version - -on: - workflow_dispatch: - schedule: - - cron: '0 13 * * *' - -jobs: - - set-rust-version: - uses: stellar/actions/.github/workflows/rust-set-rust-version.yml@main diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0bc4e7e652..9028df78e3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -5,9 +5,6 @@ on: branches: [main, release/**] pull_request: -env: - RUSTFLAGS: -Dwarnings -Dclippy::all -Dclippy::pedantic - defaults: run: shell: bash @@ -42,6 +39,7 @@ jobs: strategy: fail-fast: false matrix: + rust: [msrv, latest] include: - os: ubuntu-latest target: x86_64-unknown-linux-gnu @@ -57,7 +55,19 @@ jobs: steps: - uses: actions/checkout@v3 - uses: stellar/actions/rust-cache@main + - name: Use the minimum supported Rust version + if: matrix.rust == 'msrv' + run: | + msrv="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages | map(.rust_version) | map(values) | min')" + rustup override set $msrv + rustup component add clippy --toolchain $msrv + - name: Error on warnings and clippy checks + # Only error on warnings and checks for the msrv, because new versions of + # Rust will frequently add new warnings and checks. + if: matrix.rust == 'msrv' + run: echo RUSTFLAGS='-Dwarnings -Dclippy::all -Dclippy::pedantic' >> $GITHUB_ENV - run: rustup update + - run: cargo version - run: rustup target add ${{ matrix.target }} - run: rustup target add wasm32-unknown-unknown - if: matrix.target == 'aarch64-unknown-linux-gnu' @@ -70,6 +80,7 @@ jobs: for I in cmd/soroban-cli cmd/crates/* cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world ; do cargo test --target ${{ matrix.target }} --manifest-path $I/Cargo.toml done + publish-dry-run: if: github.event_name == 'push' || startsWith(github.head_ref, 'release/') strategy: diff --git a/.github/workflows/soroban-rpc.yml b/.github/workflows/soroban-rpc.yml index f26b2b3767..459b391e65 100644 --- a/.github/workflows/soroban-rpc.yml +++ b/.github/workflows/soroban-rpc.yml @@ -14,7 +14,7 @@ jobs: name: Unit tests strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-20.04, ubuntu-22.04] go: [1.21] runs-on: ${{ matrix.os }} steps: @@ -105,14 +105,14 @@ jobs: continue-on-error: true strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-20.04, ubuntu-22.04] go: [1.21] test: ['.*CLI.*', '^Test(([^C])|(C[^L])|(CL[^I])).*$'] runs-on: ${{ matrix.os }} env: SOROBAN_RPC_INTEGRATION_TESTS_ENABLED: true SOROBAN_RPC_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core - PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 20.0.2-1633.669916b56.focal + PROTOCOL_20_CORE_DEBIAN_PKG_VERSION: 20.1.0-1656.114b833e7.focal steps: - uses: actions/checkout@v3 with: diff --git a/Cargo.lock b/Cargo.lock index b82c6d9d13..47f19c47c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1907,7 +1907,7 @@ dependencies = [ [[package]] name = "preflight" -version = "20.1.1" +version = "20.2.0" dependencies = [ "anyhow", "base64 0.21.5", @@ -2481,8 +2481,8 @@ dependencies = [ [[package]] name = "soroban-builtin-sdk-macros" -version = "20.0.2" -source = "git+https://github.com/stellar/rs-soroban-env?rev=81f6eb1eefd299af3e03fa0db7b20eb355b2b55f#81f6eb1eefd299af3e03fa0db7b20eb355b2b55f" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c1b238b65bfd13666be4ac14e0e390c31b549caf#c1b238b65bfd13666be4ac14e0e390c31b549caf" dependencies = [ "itertools 0.11.0", "proc-macro2", @@ -2492,7 +2492,7 @@ dependencies = [ [[package]] name = "soroban-cli" -version = "20.1.1" +version = "20.2.0" dependencies = [ "assert_cmd", "assert_fs", @@ -2556,8 +2556,8 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "20.0.2" -source = "git+https://github.com/stellar/rs-soroban-env?rev=81f6eb1eefd299af3e03fa0db7b20eb355b2b55f#81f6eb1eefd299af3e03fa0db7b20eb355b2b55f" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c1b238b65bfd13666be4ac14e0e390c31b549caf#c1b238b65bfd13666be4ac14e0e390c31b549caf" dependencies = [ "arbitrary", "crate-git-revision 0.0.6", @@ -2573,8 +2573,8 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "20.0.2" -source = "git+https://github.com/stellar/rs-soroban-env?rev=81f6eb1eefd299af3e03fa0db7b20eb355b2b55f#81f6eb1eefd299af3e03fa0db7b20eb355b2b55f" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c1b238b65bfd13666be4ac14e0e390c31b549caf#c1b238b65bfd13666be4ac14e0e390c31b549caf" dependencies = [ "soroban-env-common", "static_assertions", @@ -2582,8 +2582,8 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "20.0.2" -source = "git+https://github.com/stellar/rs-soroban-env?rev=81f6eb1eefd299af3e03fa0db7b20eb355b2b55f#81f6eb1eefd299af3e03fa0db7b20eb355b2b55f" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c1b238b65bfd13666be4ac14e0e390c31b549caf#c1b238b65bfd13666be4ac14e0e390c31b549caf" dependencies = [ "backtrace", "curve25519-dalek 4.1.1", @@ -2608,8 +2608,8 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "20.0.2" -source = "git+https://github.com/stellar/rs-soroban-env?rev=81f6eb1eefd299af3e03fa0db7b20eb355b2b55f#81f6eb1eefd299af3e03fa0db7b20eb355b2b55f" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=c1b238b65bfd13666be4ac14e0e390c31b549caf#c1b238b65bfd13666be4ac14e0e390c31b549caf" dependencies = [ "itertools 0.11.0", "proc-macro2", @@ -2622,12 +2622,12 @@ dependencies = [ [[package]] name = "soroban-hello" -version = "20.1.1" +version = "20.2.0" [[package]] name = "soroban-ledger-snapshot" -version = "20.0.3" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=93b09e42e4efa841cbd034c0bff0dc362765086c#93b09e42e4efa841cbd034c0bff0dc362765086c" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=811ce3da801c03a21d5fa80fda187c0f1012240f#811ce3da801c03a21d5fa80fda187c0f1012240f" dependencies = [ "serde", "serde_json", @@ -2639,8 +2639,8 @@ dependencies = [ [[package]] name = "soroban-sdk" -version = "20.0.3" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=93b09e42e4efa841cbd034c0bff0dc362765086c#93b09e42e4efa841cbd034c0bff0dc362765086c" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=811ce3da801c03a21d5fa80fda187c0f1012240f#811ce3da801c03a21d5fa80fda187c0f1012240f" dependencies = [ "arbitrary", "bytes-lit", @@ -2658,8 +2658,8 @@ dependencies = [ [[package]] name = "soroban-sdk-macros" -version = "20.0.3" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=93b09e42e4efa841cbd034c0bff0dc362765086c#93b09e42e4efa841cbd034c0bff0dc362765086c" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=811ce3da801c03a21d5fa80fda187c0f1012240f#811ce3da801c03a21d5fa80fda187c0f1012240f" dependencies = [ "crate-git-revision 0.0.6", "darling", @@ -2677,8 +2677,8 @@ dependencies = [ [[package]] name = "soroban-spec" -version = "20.0.3" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=93b09e42e4efa841cbd034c0bff0dc362765086c#93b09e42e4efa841cbd034c0bff0dc362765086c" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=811ce3da801c03a21d5fa80fda187c0f1012240f#811ce3da801c03a21d5fa80fda187c0f1012240f" dependencies = [ "base64 0.13.1", "stellar-xdr", @@ -2688,7 +2688,7 @@ dependencies = [ [[package]] name = "soroban-spec-json" -version = "20.1.1" +version = "20.2.0" dependencies = [ "pretty_assertions", "serde", @@ -2702,8 +2702,8 @@ dependencies = [ [[package]] name = "soroban-spec-rust" -version = "20.0.3" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=93b09e42e4efa841cbd034c0bff0dc362765086c#93b09e42e4efa841cbd034c0bff0dc362765086c" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=811ce3da801c03a21d5fa80fda187c0f1012240f#811ce3da801c03a21d5fa80fda187c0f1012240f" dependencies = [ "prettyplease", "proc-macro2", @@ -2717,7 +2717,7 @@ dependencies = [ [[package]] name = "soroban-spec-tools" -version = "20.1.1" +version = "20.2.0" dependencies = [ "base64 0.21.5", "ethnum", @@ -2735,7 +2735,7 @@ dependencies = [ [[package]] name = "soroban-spec-typescript" -version = "20.1.1" +version = "20.2.0" dependencies = [ "base64 0.21.5", "heck", @@ -2756,7 +2756,7 @@ dependencies = [ [[package]] name = "soroban-test" -version = "20.1.1" +version = "20.2.0" dependencies = [ "assert_cmd", "assert_fs", @@ -2779,8 +2779,8 @@ dependencies = [ [[package]] name = "soroban-token-sdk" -version = "20.0.3" -source = "git+https://github.com/stellar/rs-soroban-sdk?rev=93b09e42e4efa841cbd034c0bff0dc362765086c#93b09e42e4efa841cbd034c0bff0dc362765086c" +version = "20.1.0" +source = "git+https://github.com/stellar/rs-soroban-sdk?rev=811ce3da801c03a21d5fa80fda187c0f1012240f#811ce3da801c03a21d5fa80fda187c0f1012240f" dependencies = [ "soroban-sdk", ] @@ -2964,28 +2964,28 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "test_custom_types" -version = "20.1.1" +version = "20.2.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_hello_world" -version = "20.1.1" +version = "20.2.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_swap" -version = "20.1.1" +version = "20.2.0" dependencies = [ "soroban-sdk", ] [[package]] name = "test_token" -version = "20.1.1" +version = "20.2.0" dependencies = [ "soroban-sdk", "soroban-token-sdk", @@ -2993,7 +2993,7 @@ dependencies = [ [[package]] name = "test_udt" -version = "20.1.1" +version = "20.2.0" dependencies = [ "soroban-sdk", ] diff --git a/Cargo.toml b/Cargo.toml index e0a4ee2a20..e8b58311e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,54 +11,55 @@ default-members = ["cmd/soroban-cli", "cmd/crates/soroban-test"] exclude = ["cmd/crates/soroban-test/tests/fixtures/hello"] [workspace.package] -version = "20.1.1" +version = "20.2.0" +rust-version = "1.74.0" [workspace.dependencies.soroban-env-host] -version = "=20.0.2" +version = "=20.1.0" git = "https://github.com/stellar/rs-soroban-env" -rev = "81f6eb1eefd299af3e03fa0db7b20eb355b2b55f" +rev = "c1b238b65bfd13666be4ac14e0e390c31b549caf" [workspace.dependencies.soroban-spec] -version = "=20.0.3" +version = "=20.1.0" git = "https://github.com/stellar/rs-soroban-sdk" -rev = "93b09e42e4efa841cbd034c0bff0dc362765086c" +rev = "811ce3da801c03a21d5fa80fda187c0f1012240f" # path = "../rs-soroban-sdk/soroban-spec" [workspace.dependencies.soroban-spec-rust] -version = "=20.0.3" +version = "=20.1.0" git = "https://github.com/stellar/rs-soroban-sdk" -rev = "93b09e42e4efa841cbd034c0bff0dc362765086c" +rev = "811ce3da801c03a21d5fa80fda187c0f1012240f" # path = "../rs-soroban-sdk/soroban-spec-rust" [workspace.dependencies.soroban-spec-json] -version = "20.1.1" +version = "20.2.0" path = "./cmd/crates/soroban-spec-json" [workspace.dependencies.soroban-spec-typescript] -version = "20.1.1" +version = "20.2.0" path = "./cmd/crates/soroban-spec-typescript" [workspace.dependencies.soroban-spec-tools] -version = "20.1.1" +version = "20.2.0" path = "./cmd/crates/soroban-spec-tools" [workspace.dependencies.soroban-sdk] -version = "=20.0.3" +version = "=20.1.0" git = "https://github.com/stellar/rs-soroban-sdk" -rev = "93b09e42e4efa841cbd034c0bff0dc362765086c" +rev = "811ce3da801c03a21d5fa80fda187c0f1012240f" [workspace.dependencies.soroban-token-sdk] -version = "=20.0.3" +version = "=20.1.0" git = "https://github.com/stellar/rs-soroban-sdk" -rev = "93b09e42e4efa841cbd034c0bff0dc362765086c" +rev = "811ce3da801c03a21d5fa80fda187c0f1012240f" [workspace.dependencies.soroban-ledger-snapshot] -version = "=20.0.3" +version = "=20.1.0" git = "https://github.com/stellar/rs-soroban-sdk" -rev = "93b09e42e4efa841cbd034c0bff0dc362765086c" +rev = "811ce3da801c03a21d5fa80fda187c0f1012240f" [workspace.dependencies.soroban-cli] -version = "20.1.1" +version = "20.2.0" path = "cmd/soroban-cli" [workspace.dependencies.stellar-xdr] diff --git a/cmd/crates/soroban-spec-json/Cargo.toml b/cmd/crates/soroban-spec-json/Cargo.toml index 164f6d7797..04051ea6b4 100644 --- a/cmd/crates/soroban-spec-json/Cargo.toml +++ b/cmd/crates/soroban-spec-json/Cargo.toml @@ -8,7 +8,7 @@ readme = "README.md" license = "Apache-2.0" version.workspace = true edition = "2021" -rust-version = "1.70" +rust-version.workspace = true [dependencies] soroban-spec = { workspace = true } diff --git a/cmd/crates/soroban-spec-tools/Cargo.toml b/cmd/crates/soroban-spec-tools/Cargo.toml index bed9d8e6b1..61a32c1371 100644 --- a/cmd/crates/soroban-spec-tools/Cargo.toml +++ b/cmd/crates/soroban-spec-tools/Cargo.toml @@ -8,7 +8,7 @@ license = "Apache-2.0" readme = "README.md" version.workspace = true edition = "2021" -rust-version = "1.70" +rust-version.workspace = true autobins = false diff --git a/cmd/crates/soroban-spec-typescript/Cargo.toml b/cmd/crates/soroban-spec-typescript/Cargo.toml index 87471e6658..cc17073fb5 100644 --- a/cmd/crates/soroban-spec-typescript/Cargo.toml +++ b/cmd/crates/soroban-spec-typescript/Cargo.toml @@ -8,7 +8,7 @@ readme = "README.md" license = "Apache-2.0" version.workspace = true edition = "2021" -rust-version = "1.70" +rust-version.workspace = true [dependencies] soroban-spec = { workspace = true } diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/assembled-tx.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/assembled-tx.d.ts index 8297cbf3c2..1d5e6f5ee8 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/assembled-tx.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/assembled-tx.d.ts @@ -1,5 +1,5 @@ -import { Account, Address, Operation, SorobanRpc, xdr } from "stellar-sdk"; -import type { Memo, MemoType, Transaction } from "stellar-sdk"; +import { Account, Address, Operation, SorobanRpc, xdr } from "@stellar/stellar-sdk"; +import type { Memo, MemoType, Transaction } from "@stellar/stellar-sdk"; import type { ClassOptions, MethodOptions, Wallet, XDR_BASE64 } from "./method-options.js"; export type Tx = Transaction, Operation[]>; export declare class ExpiredStateError extends Error { diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/assembled-tx.js b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/assembled-tx.js index 5d2128f47a..c60a6e5f89 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/assembled-tx.js +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/assembled-tx.js @@ -1,7 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AssembledTransaction = exports.NULL_ACCOUNT = exports.contractErrorPattern = exports.Err = exports.Ok = exports.Address = exports.NoUnsignedNonInvokerAuthEntriesError = exports.SendFailedError = exports.SendResultOnlyError = exports.WalletDisconnectedError = exports.NeedsMoreSignaturesError = exports.ExpiredStateError = void 0; -const stellar_sdk_1 = require("stellar-sdk"); +const stellar_sdk_1 = require("@stellar/stellar-sdk"); Object.defineProperty(exports, "Address", { enumerable: true, get: function () { return stellar_sdk_1.Address; } }); const buffer_1 = require("buffer"); class ExpiredStateError extends Error { diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.d.ts index d32b06f970..66d3d59597 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.d.ts @@ -1,4 +1,4 @@ -import { ContractSpec } from 'stellar-sdk'; +import { ContractSpec } from '@stellar/stellar-sdk'; import { Buffer } from "buffer"; import { AssembledTransaction, Ok, Err } from './assembled-tx.js'; import type { u32, i32, i64, i128, Option, Error_ } from './assembled-tx.js'; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.js b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.js index 735f2fa295..d6e27aa855 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.js +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/cjs/index.js @@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Contract = exports.Errors = exports.RoyalCard = exports.networks = void 0; -const stellar_sdk_1 = require("stellar-sdk"); +const stellar_sdk_1 = require("@stellar/stellar-sdk"); const buffer_1 = require("buffer"); const assembled_tx_js_1 = require("./assembled-tx.js"); __exportStar(require("./assembled-tx.js"), exports); diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/assembled-tx.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/assembled-tx.d.ts index 8297cbf3c2..1d5e6f5ee8 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/assembled-tx.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/assembled-tx.d.ts @@ -1,5 +1,5 @@ -import { Account, Address, Operation, SorobanRpc, xdr } from "stellar-sdk"; -import type { Memo, MemoType, Transaction } from "stellar-sdk"; +import { Account, Address, Operation, SorobanRpc, xdr } from "@stellar/stellar-sdk"; +import type { Memo, MemoType, Transaction } from "@stellar/stellar-sdk"; import type { ClassOptions, MethodOptions, Wallet, XDR_BASE64 } from "./method-options.js"; export type Tx = Transaction, Operation[]>; export declare class ExpiredStateError extends Error { diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/assembled-tx.js b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/assembled-tx.js index 24168acf4f..79b7c01d95 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/assembled-tx.js +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/assembled-tx.js @@ -1,4 +1,4 @@ -import { Account, Address, Contract, Operation, SorobanRpc, StrKey, TimeoutInfinite, TransactionBuilder, authorizeEntry, hash, xdr, BASE_FEE, } from "stellar-sdk"; +import { Account, Address, Contract, Operation, SorobanRpc, StrKey, TimeoutInfinite, TransactionBuilder, authorizeEntry, hash, xdr, BASE_FEE, } from "@stellar/stellar-sdk"; import { Buffer } from "buffer"; export class ExpiredStateError extends Error { } diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.d.ts index d32b06f970..66d3d59597 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.d.ts @@ -1,4 +1,4 @@ -import { ContractSpec } from 'stellar-sdk'; +import { ContractSpec } from '@stellar/stellar-sdk'; import { Buffer } from "buffer"; import { AssembledTransaction, Ok, Err } from './assembled-tx.js'; import type { u32, i32, i64, i128, Option, Error_ } from './assembled-tx.js'; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.js b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.js index bfd8b18237..b97cff55c9 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.js +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/esm/index.js @@ -1,4 +1,4 @@ -import { ContractSpec, Address } from 'stellar-sdk'; +import { ContractSpec, Address } from '@stellar/stellar-sdk'; import { Buffer } from "buffer"; import { AssembledTransaction, Ok, Err } from './assembled-tx.js'; export * from './assembled-tx.js'; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/assembled-tx.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/assembled-tx.d.ts index 8297cbf3c2..1d5e6f5ee8 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/assembled-tx.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/assembled-tx.d.ts @@ -1,5 +1,5 @@ -import { Account, Address, Operation, SorobanRpc, xdr } from "stellar-sdk"; -import type { Memo, MemoType, Transaction } from "stellar-sdk"; +import { Account, Address, Operation, SorobanRpc, xdr } from "@stellar/stellar-sdk"; +import type { Memo, MemoType, Transaction } from "@stellar/stellar-sdk"; import type { ClassOptions, MethodOptions, Wallet, XDR_BASE64 } from "./method-options.js"; export type Tx = Transaction, Operation[]>; export declare class ExpiredStateError extends Error { diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/index.d.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/index.d.ts index d32b06f970..66d3d59597 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/index.d.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/dist/types/index.d.ts @@ -1,4 +1,4 @@ -import { ContractSpec } from 'stellar-sdk'; +import { ContractSpec } from '@stellar/stellar-sdk'; import { Buffer } from "buffer"; import { AssembledTransaction, Ok, Err } from './assembled-tx.js'; import type { u32, i32, i64, i128, Option, Error_ } from './assembled-tx.js'; diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package-lock.json b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package-lock.json index bd71e5951d..44332a410c 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package-lock.json +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package-lock.json @@ -9,11 +9,11 @@ "version": "0.0.0", "dependencies": { "@stellar/freighter-api": "1.7.1", - "buffer": "6.0.3", - "stellar-sdk": "11.1.0" + "@stellar/stellar-sdk": "11.2.0", + "buffer": "6.0.3" }, "devDependencies": { - "typescript": "5.1.6" + "typescript": "5.3.3" } }, "node_modules/@stellar/freighter-api": { @@ -42,17 +42,31 @@ "sodium-native": "^4.0.1" } }, + "node_modules/@stellar/stellar-sdk": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@stellar/stellar-sdk/-/stellar-sdk-11.2.0.tgz", + "integrity": "sha512-qInRR+mLLl9O/AI6Q+Sr19RZeYJtlNoJQJi3pch5BYoMvVhjO8IU8AhHADP//Zmc2osyogwPuqXBiFdaGlfHWA==", + "dependencies": { + "@stellar/stellar-base": "10.0.1", + "axios": "^1.6.5", + "bignumber.js": "^9.1.2", + "eventsource": "^2.0.2", + "randombytes": "^2.1.0", + "toml": "^3.0.0", + "urijs": "^1.19.1" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", + "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.4", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -143,9 +157,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "funding": [ { "type": "individual", @@ -218,9 +232,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.1.tgz", - "integrity": "sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.0.tgz", + "integrity": "sha512-u6fs2AEUljNho3EYTJNBfImO5QTo/J/1Etd+NVdCj7qWKUSN/bSLkZwhDv7I+w/MSC6qJ4cknepkAYykDdK8og==", "optional": true, "bin": { "node-gyp-build": "bin.js", @@ -273,29 +287,15 @@ } }, "node_modules/sodium-native": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-4.0.4.tgz", - "integrity": "sha512-faqOKw4WQKK7r/ybn6Lqo1F9+L5T6NlBJJYvpxbZPetpWylUVqz449mvlwIBKBqxEHbWakWuOlUt8J3Qpc4sWw==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-4.0.5.tgz", + "integrity": "sha512-YGimGhy7Ho6pTAAvuNdn3Tv9C2MD7HP89X1omReHat0Fd1mMnapGqwzb5YoHTAbIEh8tQmKP6+uLlwYCkf+EOA==", "hasInstallScript": true, "optional": true, "dependencies": { "node-gyp-build": "^4.6.0" } }, - "node_modules/stellar-sdk": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/stellar-sdk/-/stellar-sdk-11.1.0.tgz", - "integrity": "sha512-fIdo77ogpU+ecHgs59pk9velpXd4F/ch0DzOI4QZw8zVZApc3oeNWP3+X6ui7BWpeRHAGsP2CHQzBLxm0JTIgg==", - "dependencies": { - "@stellar/stellar-base": "10.0.1", - "axios": "^1.6.0", - "bignumber.js": "^9.1.2", - "eventsource": "^2.0.2", - "randombytes": "^2.1.0", - "toml": "^3.0.0", - "urijs": "^1.19.1" - } - }, "node_modules/toml": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", @@ -307,9 +307,9 @@ "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" }, "node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package.json b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package.json index 557c8b364d..1f63968ae7 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package.json +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/package.json @@ -4,7 +4,7 @@ "dependencies": { "@stellar/freighter-api": "1.7.1", "buffer": "6.0.3", - "stellar-sdk": "11.1.0" + "@stellar/stellar-sdk": "11.2.0" }, "scripts": { "build": "node ./scripts/build.mjs" @@ -15,6 +15,6 @@ }, "typings": "dist/types/index.d.ts", "devDependencies": { - "typescript": "5.1.6" + "typescript": "5.3.3" } } diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/assembled-tx.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/assembled-tx.ts index 58476807fd..f4f892d4d3 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/assembled-tx.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/assembled-tx.ts @@ -12,8 +12,8 @@ import { nativeToScVal, xdr, BASE_FEE, -} from "stellar-sdk"; -import type { Memo, MemoType, Transaction } from "stellar-sdk"; +} from "@stellar/stellar-sdk"; +import type { Memo, MemoType, Transaction } from "@stellar/stellar-sdk"; import { Buffer } from "buffer"; import type { ClassOptions, diff --git a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/index.ts b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/index.ts index 5dee944fa2..e31192254d 100644 --- a/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/index.ts +++ b/cmd/crates/soroban-spec-typescript/fixtures/test_custom_types/src/index.ts @@ -1,4 +1,4 @@ -import { ContractSpec, Address } from 'stellar-sdk'; +import { ContractSpec, Address } from '@stellar/stellar-sdk'; import { Buffer } from "buffer"; import { AssembledTransaction, Ok, Err } from './assembled-tx.js'; import type { diff --git a/cmd/crates/soroban-spec-typescript/src/project_template/package.json b/cmd/crates/soroban-spec-typescript/src/project_template/package.json index 3c6b89642a..e32d0f5e5c 100644 --- a/cmd/crates/soroban-spec-typescript/src/project_template/package.json +++ b/cmd/crates/soroban-spec-typescript/src/project_template/package.json @@ -4,7 +4,7 @@ "dependencies": { "@stellar/freighter-api": "1.7.1", "buffer": "6.0.3", - "stellar-sdk": "11.1.0" + "@stellar/stellar-sdk": "11.2.0" }, "scripts": { "build": "node ./scripts/build.mjs" @@ -15,6 +15,6 @@ }, "typings": "dist/types/index.d.ts", "devDependencies": { - "typescript": "5.1.6" + "typescript": "5.3.3" } } diff --git a/cmd/crates/soroban-spec-typescript/src/project_template/src/assembled-tx.ts b/cmd/crates/soroban-spec-typescript/src/project_template/src/assembled-tx.ts index 58476807fd..f4f892d4d3 100644 --- a/cmd/crates/soroban-spec-typescript/src/project_template/src/assembled-tx.ts +++ b/cmd/crates/soroban-spec-typescript/src/project_template/src/assembled-tx.ts @@ -12,8 +12,8 @@ import { nativeToScVal, xdr, BASE_FEE, -} from "stellar-sdk"; -import type { Memo, MemoType, Transaction } from "stellar-sdk"; +} from "@stellar/stellar-sdk"; +import type { Memo, MemoType, Transaction } from "@stellar/stellar-sdk"; import { Buffer } from "buffer"; import type { ClassOptions, diff --git a/cmd/crates/soroban-spec-typescript/src/project_template/src/index.ts b/cmd/crates/soroban-spec-typescript/src/project_template/src/index.ts index 271f25e631..f7ad0b66cc 100644 --- a/cmd/crates/soroban-spec-typescript/src/project_template/src/index.ts +++ b/cmd/crates/soroban-spec-typescript/src/project_template/src/index.ts @@ -1,4 +1,4 @@ -import { ContractSpec, Address } from 'stellar-sdk'; +import { ContractSpec, Address } from '@stellar/stellar-sdk'; import { Buffer } from "buffer"; import { AssembledTransaction, Ok, Err } from './assembled-tx.js'; import type { diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/.nvmrc b/cmd/crates/soroban-spec-typescript/ts-tests/.nvmrc deleted file mode 100644 index 03db17dcc4..0000000000 --- a/cmd/crates/soroban-spec-typescript/ts-tests/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v20.6.0 diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/initialize.sh b/cmd/crates/soroban-spec-typescript/ts-tests/initialize.sh index 9a2a83b63b..621be2bc3f 100755 --- a/cmd/crates/soroban-spec-typescript/ts-tests/initialize.sh +++ b/cmd/crates/soroban-spec-typescript/ts-tests/initialize.sh @@ -16,22 +16,28 @@ echo " Passphrase: \"$SOROBAN_NETWORK_PASSPHRASE\"" NETWORK_STATUS=$(curl -s -X POST "http://localhost:8000/soroban/rpc" -H "Content-Type: application/json" -d '{ "jsonrpc": "2.0", "id": 8675309, "method": "getHealth" }' | sed 's/.*"status":"\(.*\)".*/\1/') || { echo "Make sure you're running local RPC network on localhost:8000" && exit 1; } echo " Status: $NETWORK_STATUS" +if [[ "$NETWORK_STATUS" != "healthy" ]]; then + echo "Network is not healthy (not running?), exiting" + exit 1 +fi + # Print command before executing, from https://stackoverflow.com/a/23342259/249801 # Discussion: https://github.com/stellar/soroban-tools/pull/1034#pullrequestreview-1690667116 exe() { echo"${@/eval/}" ; "$@" ; } function fund_all() { - exe eval "./soroban config identity fund" - exe eval "./soroban config identity generate alice" - exe eval "./soroban config identity fund alice" - exe eval "./soroban config identity generate bob" - exe eval "./soroban config identity fund bob" + exe eval "./soroban keys generate root" + exe eval "./soroban keys fund root" + exe eval "./soroban keys generate alice" + exe eval "./soroban keys fund alice" + exe eval "./soroban keys generate bob" + exe eval "./soroban keys fund bob" } function upload() { - exe eval "(./soroban contract $1 --wasm $2 --ignore-checks) > $3" + exe eval "(./soroban contract $1 --source root --wasm $2 --ignore-checks) > $3" } function deploy() { - exe eval "(./soroban contract deploy --wasm-hash $(cat $1) --ignore-checks) > $2" + exe eval "(./soroban contract deploy --source root --wasm-hash $(cat $1) --ignore-checks) > $2" } function deploy_all() { upload deploy ../../../../target/wasm32-unknown-unknown/test-wasms/test_custom_types.wasm contract-id-custom-types.txt @@ -42,7 +48,7 @@ function deploy_all() { deploy contract-token-hash.txt contract-id-token-b.txt } function initialize() { - exe eval "./soroban contract invoke --id $(cat $1) -- initialize --admin $(./soroban config identity address) --decimal 0 --name 'Token $2' --symbol '$2'" + exe eval "./soroban contract invoke --source root --id $(cat $1) -- initialize --admin $(./soroban keys address root) --decimal 0 --name 'Token $2' --symbol '$2'" } function initialize_all() { initialize contract-id-token-a.txt A @@ -59,14 +65,13 @@ function bind_all() { } function mint() { - exe eval "./soroban contract invoke --id $(cat $1) -- mint --amount 2000000 --to $(./soroban config identity address $2)" + exe eval "./soroban contract invoke --source root --id $(cat $1) -- mint --amount 2000000 --to $(./soroban keys address $2)" } function mint_all() { mint contract-id-token-a.txt alice mint contract-id-token-b.txt bob } -curl -X POST "http://localhost:8000/soroban/rpc" || { echo "Make sure you're running standalone RPC network on localhost:8000" && exit 1; } fund_all deploy_all initialize_all diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/package-lock.json b/cmd/crates/soroban-spec-typescript/ts-tests/package-lock.json index 1ed2de71f0..36f5cdd63b 100644 --- a/cmd/crates/soroban-spec-typescript/ts-tests/package-lock.json +++ b/cmd/crates/soroban-spec-typescript/ts-tests/package-lock.json @@ -7,14 +7,14 @@ "hasInstallScript": true, "devDependencies": { "@ava/typescript": "^4.1.0", + "@stellar/stellar-sdk": "11.2.0", "@types/node": "^20.4.9", "@typescript-eslint/eslint-plugin": "^6.10.0", "@typescript-eslint/parser": "^6.10.0", "ava": "^5.3.1", "dotenv": "^16.3.1", "eslint": "^8.53.0", - "stellar-sdk": "11.1.0", - "typescript": "^5.1.6" + "typescript": "^5.3.3" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -186,6 +186,21 @@ "sodium-native": "^4.0.1" } }, + "node_modules/@stellar/stellar-sdk": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@stellar/stellar-sdk/-/stellar-sdk-11.2.0.tgz", + "integrity": "sha512-qInRR+mLLl9O/AI6Q+Sr19RZeYJtlNoJQJi3pch5BYoMvVhjO8IU8AhHADP//Zmc2osyogwPuqXBiFdaGlfHWA==", + "dev": true, + "dependencies": { + "@stellar/stellar-base": "10.0.1", + "axios": "^1.6.5", + "bignumber.js": "^9.1.2", + "eventsource": "^2.0.2", + "randombytes": "^2.1.0", + "toml": "^3.0.0", + "urijs": "^1.19.1" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -649,12 +664,12 @@ } }, "node_modules/axios": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", - "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", + "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", "dev": true, "dependencies": { - "follow-redirects": "^1.15.0", + "follow-redirects": "^1.15.4", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -1586,9 +1601,9 @@ "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", - "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", + "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", "dev": true, "funding": [ { @@ -2922,21 +2937,6 @@ "node": ">=8" } }, - "node_modules/stellar-sdk": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/stellar-sdk/-/stellar-sdk-11.1.0.tgz", - "integrity": "sha512-fIdo77ogpU+ecHgs59pk9velpXd4F/ch0DzOI4QZw8zVZApc3oeNWP3+X6ui7BWpeRHAGsP2CHQzBLxm0JTIgg==", - "dev": true, - "dependencies": { - "@stellar/stellar-base": "10.0.1", - "axios": "^1.6.0", - "bignumber.js": "^9.1.2", - "eventsource": "^2.0.2", - "randombytes": "^2.1.0", - "toml": "^3.0.0", - "urijs": "^1.19.1" - } - }, "node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/package.json b/cmd/crates/soroban-spec-typescript/ts-tests/package.json index 37633c7d49..c06446de37 100644 --- a/cmd/crates/soroban-spec-typescript/ts-tests/package.json +++ b/cmd/crates/soroban-spec-typescript/ts-tests/package.json @@ -14,8 +14,8 @@ "ava": "^5.3.1", "dotenv": "^16.3.1", "eslint": "^8.53.0", - "stellar-sdk": "11.1.0", - "typescript": "^5.1.6" + "@stellar/stellar-sdk": "11.2.0", + "typescript": "^5.3.3" }, "ava": { "typescript": { diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/src/test-custom-types.ts b/cmd/crates/soroban-spec-typescript/ts-tests/src/test-custom-types.ts index 75f261d947..3b07dc3d42 100644 --- a/cmd/crates/soroban-spec-typescript/ts-tests/src/test-custom-types.ts +++ b/cmd/crates/soroban-spec-typescript/ts-tests/src/test-custom-types.ts @@ -2,7 +2,6 @@ import test from 'ava' import { root, rpcUrl, wallet } from './util.js' import { Contract, Ok, Err, networks } from 'test-custom-types' -const addr = root.address; const publicKey = root.keypair.publicKey(); const contract = new Contract({ ...networks.standalone, rpcUrl, wallet }); @@ -50,18 +49,21 @@ test("strukt", async (t) => { }) test('simple first', async t => { - const simple = { tag: 'First', values: undefined } as const - t.deepEqual((await contract.simple({ simple })).result, simple) + const arg = { tag: 'First', values: undefined } as const + const ret = { tag: 'First' } + t.deepEqual((await contract.simple({ simple: arg })).result, ret) }) test('simple second', async t => { - const simple = { tag: 'Second', values: undefined } as const - t.deepEqual((await contract.simple({ simple })).result, simple) + const arg = { tag: 'Second', values: undefined } as const + const ret = { tag: 'Second' } + t.deepEqual((await contract.simple({ simple: arg })).result, ret) }) test('simple third', async t => { - const simple = { tag: 'Third', values: undefined } as const - t.deepEqual((await contract.simple({ simple })).result, simple) + const arg = { tag: 'Third', values: undefined } as const + const ret = { tag: 'Third' } + t.deepEqual((await contract.simple({ simple: arg })).result, ret) }) test('complex with struct', async t => { @@ -72,29 +74,30 @@ test('complex with struct', async t => { test('complex with tuple', async t => { const arg = { tag: 'Tuple', values: [[{ a: 0, b: true, c: 'hello' }, { tag: 'First', values: undefined }]] } as const - const ret = { tag: 'Tuple', values: [[{ a: 0, b: true, c: 'hello' }, { tag: 'First', values: undefined }]] } + const ret = { tag: 'Tuple', values: [[{ a: 0, b: true, c: 'hello' }, { tag: 'First' }]] } t.deepEqual((await contract.complex({ complex: arg })).result, ret) }) test('complex with enum', async t => { const arg = { tag: 'Enum', values: [{ tag: 'First', values: undefined }] } as const - const ret = { tag: 'Enum', values: [{ tag: 'First', values: undefined }] } + const ret = { tag: 'Enum', values: [{ tag: 'First' }] } t.deepEqual((await contract.complex({ complex: arg })).result, ret) }) test('complex with asset', async t => { const arg = { tag: 'Asset', values: [publicKey, 1n] } as const - const ret = { tag: 'Asset', values: [addr, 1n] } + const ret = { tag: 'Asset', values: [publicKey, 1n] } t.deepEqual((await contract.complex({ complex: arg })).result, ret) }) test('complex with void', async t => { - const complex = { tag: 'Void', values: undefined } as const - t.deepEqual((await contract.complex({ complex })).result, complex) + const arg = { tag: 'Void', values: undefined } as const + const ret = { tag: 'Void' } + t.deepEqual((await contract.complex({ complex: arg })).result, ret) }) test('addresse', async t => { - t.deepEqual((await contract.addresse({ addresse: publicKey })).result, addr) + t.deepEqual((await contract.addresse({ addresse: publicKey })).result, publicKey) }) test('bytes', async t => { @@ -138,7 +141,8 @@ test('map', async t => { map.set(1, true) map.set(2, false) // map.set(3, 'hahaha') // should throw an error - t.deepEqual((await contract.map({ map })).result, map) + const ret = Array.from(map.entries()) + t.deepEqual((await contract.map({ map })).result, ret) }) test('vec', async t => { @@ -178,6 +182,6 @@ test('string', async t => { test('tuple_strukt', async t => { const arg = [{ a: 0, b: true, c: 'hello' }, { tag: 'First', values: undefined }] as const - const res = [{ a: 0, b: true, c: 'hello' }, { tag: 'First', values: undefined }] + const res = [{ a: 0, b: true, c: 'hello' }, { tag: 'First' }] t.deepEqual((await contract.tupleStrukt({ tuple_strukt: arg })).result, res) }) diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/src/test-hello-world.ts b/cmd/crates/soroban-spec-typescript/ts-tests/src/test-hello-world.ts index 5ccdde7881..e658c4552b 100644 --- a/cmd/crates/soroban-spec-typescript/ts-tests/src/test-hello-world.ts +++ b/cmd/crates/soroban-spec-typescript/ts-tests/src/test-hello-world.ts @@ -14,7 +14,7 @@ test("auth", async (t) => { addr: root.keypair.publicKey(), world: 'lol' })).result, - root.address + root.keypair.publicKey() ) }); diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/src/test-swap.ts b/cmd/crates/soroban-spec-typescript/ts-tests/src/test-swap.ts index 41871839cd..a473cb4d88 100644 --- a/cmd/crates/soroban-spec-typescript/ts-tests/src/test-swap.ts +++ b/cmd/crates/soroban-spec-typescript/ts-tests/src/test-swap.ts @@ -1,5 +1,5 @@ import test from "ava" -import { SorobanRpc, xdr } from 'stellar-sdk' +import { SorobanRpc, xdr } from '@stellar/stellar-sdk' import { wallet, rpcUrl, alice, bob, networkPassphrase, root, Wallet } from "./util.js" import { Contract as Token } from "token" import { Contract as Swap, networks, NeedsMoreSignaturesError } from "test-swap" diff --git a/cmd/crates/soroban-spec-typescript/ts-tests/src/util.ts b/cmd/crates/soroban-spec-typescript/ts-tests/src/util.ts index 69c15350ec..d5539fd120 100644 --- a/cmd/crates/soroban-spec-typescript/ts-tests/src/util.ts +++ b/cmd/crates/soroban-spec-typescript/ts-tests/src/util.ts @@ -1,10 +1,10 @@ import { spawnSync } from "node:child_process"; -import { Keypair, TransactionBuilder, hash } from "stellar-sdk"; +import { Keypair, TransactionBuilder, hash } from "@stellar/stellar-sdk"; import { Address } from 'test-custom-types' -const rootKeypair = Keypair.fromSecret(spawnSync("./soroban", ["config", "identity", "show"], { shell: true, encoding: "utf8" }).stdout.trim()); -const aliceKeypair = Keypair.fromSecret(spawnSync("./soroban", ["config", "identity", "show", "alice"], { shell: true, encoding: "utf8" }).stdout.trim()); -const bobKeypair = Keypair.fromSecret(spawnSync("./soroban", ["config", "identity", "show", "bob"], { shell: true, encoding: "utf8" }).stdout.trim()); +const rootKeypair = Keypair.fromSecret(spawnSync("./soroban", ["keys", "show", "root"], { shell: true, encoding: "utf8" }).stdout.trim()); +const aliceKeypair = Keypair.fromSecret(spawnSync("./soroban", ["keys", "show", "alice"], { shell: true, encoding: "utf8" }).stdout.trim()); +const bobKeypair = Keypair.fromSecret(spawnSync("./soroban", ["keys", "show", "bob"], { shell: true, encoding: "utf8" }).stdout.trim()); export const root = { keypair: rootKeypair, diff --git a/cmd/crates/soroban-test/Cargo.toml b/cmd/crates/soroban-test/Cargo.toml index 7780409ec6..649a37e57d 100644 --- a/cmd/crates/soroban-test/Cargo.toml +++ b/cmd/crates/soroban-test/Cargo.toml @@ -6,9 +6,9 @@ repository = "https://github.com/stellar/soroban-test" authors = ["Stellar Development Foundation "] license = "Apache-2.0" readme = "README.md" -version = "20.1.1" +version = "20.2.0" edition = "2021" -rust-version = "1.70" +rust-version.workspace = true autobins = false diff --git a/cmd/crates/soroban-test/tests/fixtures/hello/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/hello/Cargo.toml index 8b08d0076a..01b80b0f6b 100644 --- a/cmd/crates/soroban-test/tests/fixtures/hello/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/hello/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "soroban-hello" -version = "20.1.1" +version = "20.2.0" edition = "2021" publish = false diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_type/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_type/Cargo.toml index baa76473ba..67df45b69b 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_type/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_type/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "test_custom_types" -version = "20.1.1" +version = "20.2.0" authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.70" +rust-version.workspace = true [lib] crate-type = ["cdylib", "rlib"] diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/Cargo.toml index 64780d47ae..e5ced55fac 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/Cargo.toml @@ -1,11 +1,11 @@ [package] name = "test_hello_world" -version = "20.1.1" +version = "20.2.0" authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.70" +rust-version.workspace = true [lib] crate-type = ["cdylib", "rlib"] diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/Cargo.toml index 27aede50d7..f2465e22b6 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.70" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/Cargo.toml index 7a81bee777..3f32f139ad 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.70" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/udt/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/udt/Cargo.toml index 9764b6455f..206284802c 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/udt/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/udt/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stellar Development Foundation "] license = "Apache-2.0" edition = "2021" publish = false -rust-version = "1.69" +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/cmd/soroban-cli/Cargo.toml b/cmd/soroban-cli/Cargo.toml index 9f4fa2897f..ad60c827ac 100644 --- a/cmd/soroban-cli/Cargo.toml +++ b/cmd/soroban-cli/Cargo.toml @@ -6,9 +6,9 @@ repository = "https://github.com/stellar/soroban-cli" authors = ["Stellar Development Foundation "] license = "Apache-2.0" readme = "README.md" -version = "20.1.1" +version = "20.2.0" edition = "2021" -rust-version = "1.72" +rust-version.workspace = true autobins = false default-run = "soroban" diff --git a/cmd/soroban-cli/src/commands/config/locator.rs b/cmd/soroban-cli/src/commands/config/locator.rs index 2ec449231e..2688b043fe 100644 --- a/cmd/soroban-cli/src/commands/config/locator.rs +++ b/cmd/soroban-cli/src/commands/config/locator.rs @@ -69,6 +69,7 @@ pub struct Args { #[arg(long)] pub global: bool, + /// Location of config directory, default is "." #[arg(long, help_heading = "TESTING_OPTIONS")] pub config_dir: Option, } diff --git a/cmd/soroban-cli/src/commands/contract/asset.rs b/cmd/soroban-cli/src/commands/contract/asset.rs new file mode 100644 index 0000000000..ad7be0207c --- /dev/null +++ b/cmd/soroban-cli/src/commands/contract/asset.rs @@ -0,0 +1,27 @@ +use super::{deploy, id}; + +#[derive(Debug, clap::Subcommand)] +pub enum Cmd { + /// Get Id of builtin Soroban Asset Contract. Deprecated, use `soroban contract id asset` instead + Id(id::asset::Cmd), + /// Deploy builtin Soroban Asset Contract + Deploy(deploy::asset::Cmd), +} + +#[derive(thiserror::Error, Debug)] +pub enum Error { + #[error(transparent)] + Id(#[from] id::asset::Error), + #[error(transparent)] + Deploy(#[from] deploy::asset::Error), +} + +impl Cmd { + pub async fn run(&self) -> Result<(), Error> { + match &self { + Cmd::Id(id) => id.run()?, + Cmd::Deploy(asset) => asset.run().await?, + } + Ok(()) + } +} diff --git a/cmd/soroban-cli/src/commands/contract/mod.rs b/cmd/soroban-cli/src/commands/contract/mod.rs index db450f611c..35be97a70b 100644 --- a/cmd/soroban-cli/src/commands/contract/mod.rs +++ b/cmd/soroban-cli/src/commands/contract/mod.rs @@ -1,3 +1,4 @@ +pub mod asset; pub mod bindings; pub mod build; pub mod deploy; @@ -15,6 +16,9 @@ use crate::commands::global; #[derive(Debug, clap::Subcommand)] pub enum Cmd { + /// Utilities to deploy a Stellar Asset Contract or get its id + #[command(subcommand)] + Asset(asset::Cmd), /// Generate code client bindings for a contract #[command(subcommand)] Bindings(bindings::Cmd), @@ -26,9 +30,8 @@ pub enum Cmd { /// If no keys are specified the contract itself is extended. Extend(extend::Cmd), - /// Deploy a contract or Soroban Asset Contract - #[command(subcommand)] - Deploy(deploy::Cmd), + /// Deploy a wasm contract + Deploy(deploy::wasm::Cmd), /// Fetch a contract's Wasm binary Fetch(fetch::Cmd), @@ -67,6 +70,9 @@ pub enum Cmd { #[derive(thiserror::Error, Debug)] pub enum Error { + #[error(transparent)] + Asset(#[from] asset::Error), + #[error(transparent)] Bindings(#[from] bindings::Error), @@ -77,7 +83,7 @@ pub enum Error { Extend(#[from] extend::Error), #[error(transparent)] - Deploy(#[from] deploy::Error), + Deploy(#[from] deploy::wasm::Error), #[error(transparent)] Fetch(#[from] fetch::Error), @@ -106,6 +112,7 @@ pub enum Error { impl Cmd { pub async fn run(&self, global_args: &global::Args) -> Result<(), Error> { match &self { + Cmd::Asset(asset) => asset.run().await?, Cmd::Bindings(bindings) => bindings.run().await?, Cmd::Build(build) => build.run()?, Cmd::Extend(extend) => extend.run().await?, diff --git a/cmd/soroban-cli/src/commands/mod.rs b/cmd/soroban-cli/src/commands/mod.rs index 0179d6a917..952869af3b 100644 --- a/cmd/soroban-cli/src/commands/mod.rs +++ b/cmd/soroban-cli/src/commands/mod.rs @@ -98,7 +98,7 @@ impl Root { Cmd::Network(network) => network.run()?, Cmd::Version(version) => version.run(), Cmd::Keys(id) => id.run().await?, - Cmd::Config(_) => todo!(), + Cmd::Config(c) => c.run().await?, }; Ok(()) } diff --git a/cmd/soroban-rpc/docker/Dockerfile b/cmd/soroban-rpc/docker/Dockerfile index 6263bccb8b..0b0cc231b9 100644 --- a/cmd/soroban-rpc/docker/Dockerfile +++ b/cmd/soroban-rpc/docker/Dockerfile @@ -21,7 +21,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_TOOLC RUN make REPOSITORY_VERSION=${REPOSITORY_VERSION} build-soroban-rpc RUN mv soroban-rpc /bin/soroban-rpc -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG STELLAR_CORE_VERSION ENV STELLAR_CORE_VERSION=${STELLAR_CORE_VERSION:-*} ENV STELLAR_CORE_BINARY_PATH /usr/bin/stellar-core diff --git a/cmd/soroban-rpc/docker/Dockerfile.release b/cmd/soroban-rpc/docker/Dockerfile.release index d43b1be934..de894a8b39 100644 --- a/cmd/soroban-rpc/docker/Dockerfile.release +++ b/cmd/soroban-rpc/docker/Dockerfile.release @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG STELLAR_CORE_VERSION ENV STELLAR_CORE_VERSION=${STELLAR_CORE_VERSION:-*} ARG SOROBAN_RPC_VERSION diff --git a/cmd/soroban-rpc/internal/methods/send_transaction.go b/cmd/soroban-rpc/internal/methods/send_transaction.go index d19c2658cf..c8a0ff844a 100644 --- a/cmd/soroban-rpc/internal/methods/send_transaction.go +++ b/cmd/soroban-rpc/internal/methods/send_transaction.go @@ -21,6 +21,9 @@ type SendTransactionResponse struct { // ErrorResultXDR is a TransactionResult xdr string which contains details on why // the transaction could not be accepted by stellar-core. ErrorResultXDR string `json:"errorResultXdr,omitempty"` + // DiagnosticEventsXDR is present only if Status is equal to proto.TXStatusError. + // DiagnosticEventsXDR is a base64-encoded slice of xdr.DiagnosticEvent + DiagnosticEventsXDR []string `json:"diagnosticEventsXdr,omitempty"` // Status represents the status of the transaction submission returned by stellar-core. // Status can be one of: proto.TXStatusPending, proto.TXStatusDuplicate, // proto.TXStatusTryAgainLater, or proto.TXStatusError. @@ -94,8 +97,17 @@ func NewSendTransactionHandler(daemon interfaces.Daemon, logger *log.Entry, stor switch resp.Status { case proto.TXStatusError: + events, err := proto.DiagnosticEventsToSlice(resp.DiagnosticEvents) + if err != nil { + logger.WithField("tx", request.Transaction).Error("Cannot decode diagnostic events:", err) + return SendTransactionResponse{}, &jrpc2.Error{ + Code: jrpc2.InternalError, + Message: "could not decode diagnostic events", + } + } return SendTransactionResponse{ ErrorResultXDR: resp.Error, + DiagnosticEventsXDR: events, Status: resp.Status, Hash: txHash, LatestLedger: ledgerInfo.Sequence, diff --git a/cmd/soroban-rpc/internal/test/cli_test.go b/cmd/soroban-rpc/internal/test/cli_test.go index fbffc660bf..ab7d5a46de 100644 --- a/cmd/soroban-rpc/internal/test/cli_test.go +++ b/cmd/soroban-rpc/internal/test/cli_test.go @@ -51,7 +51,7 @@ func TestCLIWrapCustom(t *testing.T) { it := NewCLITest(t) assetCode := "deadbeef" issuerAccount := getCLIDefaultAccount(t) - strkeyContractID := runSuccessfulCLICmd(t, fmt.Sprintf("contract deploy asset --asset=%s:%s", assetCode, issuerAccount)) + strkeyContractID := runSuccessfulCLICmd(t, fmt.Sprintf("contract asset deploy --asset=%s:%s", assetCode, issuerAccount)) require.Equal(t, "true", runSuccessfulCLICmd(t, fmt.Sprintf("contract invoke --id=%s -- authorized --id=%s", strkeyContractID, issuerAccount))) asset := txnbuild.CreditAsset{ Code: assetCode, @@ -65,7 +65,7 @@ func TestCLIWrapCustom(t *testing.T) { func TestCLIWrapNative(t *testing.T) { NewCLITest(t) testAccount := getCLIDefaultAccount(t) - strkeyContractID := runSuccessfulCLICmd(t, fmt.Sprintf("contract deploy asset --asset=native:%s", testAccount)) + strkeyContractID := runSuccessfulCLICmd(t, fmt.Sprintf("contract asset deploy --asset=native:%s", testAccount)) require.Equal(t, "CAMTHSPKXZJIRTUXQP5QWJIFH3XIDMKLFAWVQOFOXPTKAW5GKV37ZC4N", strkeyContractID) require.Equal(t, "true", runSuccessfulCLICmd(t, fmt.Sprintf("contract invoke --id=%s -- authorized --id=%s", strkeyContractID, testAccount))) require.Equal(t, "\"9223372036854775807\"", runSuccessfulCLICmd(t, fmt.Sprintf("contract invoke --id=%s -- balance --id %s", strkeyContractID, testAccount))) diff --git a/cmd/soroban-rpc/internal/test/docker-compose.yml b/cmd/soroban-rpc/internal/test/docker-compose.yml index aaee8a8aca..b7309cdca8 100644 --- a/cmd/soroban-rpc/internal/test/docker-compose.yml +++ b/cmd/soroban-rpc/internal/test/docker-compose.yml @@ -15,7 +15,7 @@ services: # Note: Please keep the image pinned to an immutable tag matching the Captive Core version. # This avoids implicit updates which break compatibility between # the Core container and captive core. - image: ${CORE_IMAGE:-stellar/unsafe-stellar-core:20.0.2-1633.669916b56.focal} + image: ${CORE_IMAGE:-stellar/unsafe-stellar-core:20.1.0-1656.114b833e7.focal} depends_on: - core-postgres restart: on-failure diff --git a/cmd/soroban-rpc/internal/test/simulate_transaction_test.go b/cmd/soroban-rpc/internal/test/simulate_transaction_test.go index 18b465cb29..ec785050e9 100644 --- a/cmd/soroban-rpc/internal/test/simulate_transaction_test.go +++ b/cmd/soroban-rpc/internal/test/simulate_transaction_test.go @@ -240,7 +240,7 @@ func TestSimulateTransactionSucceeds(t *testing.T) { // for test purposes, the most deterministic way to assert the resulting fee is expected value in test scope, is to capture // the resulting fee from current preflight output and re-plug it in here, rather than try to re-implement the cost-model algo // in the test. - ResourceFee: 135910, + ResourceFee: 132146, } // First, decode and compare the transaction data so we get a decent diff if it fails. @@ -251,7 +251,7 @@ func TestSimulateTransactionSucceeds(t *testing.T) { assert.InDelta(t, uint32(expectedTransactionData.Resources.Instructions), uint32(transactionData.Resources.Instructions), 3200000) assert.InDelta(t, uint32(expectedTransactionData.Resources.ReadBytes), uint32(transactionData.Resources.ReadBytes), 10) assert.InDelta(t, uint32(expectedTransactionData.Resources.WriteBytes), uint32(transactionData.Resources.WriteBytes), 300) - assert.InDelta(t, int64(expectedTransactionData.ResourceFee), int64(transactionData.ResourceFee), 6000) + assert.InDelta(t, int64(expectedTransactionData.ResourceFee), int64(transactionData.ResourceFee), 4000) // Then decode and check the result xdr, separately so we get a decent diff if it fails. assert.Len(t, result.Results, 1) @@ -1124,8 +1124,8 @@ func TestSimulateSystemEvent(t *testing.T) { var transactionData xdr.SorobanTransactionData err = xdr.SafeUnmarshalBase64(response.TransactionData, &transactionData) require.NoError(t, err) - - assert.InDelta(t, 7464, uint32(transactionData.Resources.ReadBytes), 200) + assert.InDelta(t, 6856, uint32(transactionData.Resources.ReadBytes), 200) + // the resulting fee is derived from compute factors and a default padding is applied to instructions by preflight // for test purposes, the most deterministic way to assert the resulting fee is expected value in test scope, is to capture // the resulting fee from current preflight output and re-plug it in here, rather than try to re-implement the cost-model algo diff --git a/cmd/soroban-rpc/internal/test/stellar-core-integration-tests.cfg b/cmd/soroban-rpc/internal/test/stellar-core-integration-tests.cfg index 594a35b244..c194dbae1e 100644 --- a/cmd/soroban-rpc/internal/test/stellar-core-integration-tests.cfg +++ b/cmd/soroban-rpc/internal/test/stellar-core-integration-tests.cfg @@ -1,4 +1,5 @@ ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING=true +ENABLE_DIAGNOSTICS_FOR_TX_SUBMISSION=true NETWORK_PASSPHRASE="Standalone Network ; February 2017" diff --git a/cmd/soroban-rpc/internal/test/transaction_test.go b/cmd/soroban-rpc/internal/test/transaction_test.go index e370d7d192..1cd0d198ad 100644 --- a/cmd/soroban-rpc/internal/test/transaction_test.go +++ b/cmd/soroban-rpc/internal/test/transaction_test.go @@ -151,6 +151,58 @@ func TestSendTransactionBadSequence(t *testing.T) { assert.Equal(t, xdr.TransactionResultCodeTxBadSeq, errorResult.Result.Code) } +func TestSendTransactionFailedInsufficientResourceFee(t *testing.T) { + test := NewTest(t) + + ch := jhttp.NewChannel(test.sorobanRPCURL(), nil) + client := jrpc2.NewClient(ch, nil) + + kp := keypair.Root(StandaloneNetworkPassphrase) + address := kp.Address() + account := txnbuild.NewSimpleAccount(address, 0) + + contractBinary := getHelloWorldContract(t) + params := preflightTransactionParams(t, client, txnbuild.TransactionParams{ + SourceAccount: &account, + IncrementSequenceNum: true, + Operations: []txnbuild.Operation{ + createInstallContractCodeOperation(account.AccountID, contractBinary), + }, + BaseFee: txnbuild.MinBaseFee, + Preconditions: txnbuild.Preconditions{ + TimeBounds: txnbuild.NewInfiniteTimeout(), + }, + }) + + // make the transaction fail due to insufficient resource fees + params.Operations[0].(*txnbuild.InvokeHostFunction).Ext.SorobanData.ResourceFee /= 2 + + tx, err := txnbuild.NewTransaction(params) + assert.NoError(t, err) + + assert.NoError(t, err) + tx, err = tx.Sign(StandaloneNetworkPassphrase, kp) + assert.NoError(t, err) + b64, err := tx.Base64() + assert.NoError(t, err) + + request := methods.SendTransactionRequest{Transaction: b64} + var result methods.SendTransactionResponse + err = client.CallResult(context.Background(), "sendTransaction", request, &result) + assert.NoError(t, err) + + assert.Equal(t, proto.TXStatusError, result.Status) + var errorResult xdr.TransactionResult + assert.NoError(t, xdr.SafeUnmarshalBase64(result.ErrorResultXDR, &errorResult)) + assert.Equal(t, xdr.TransactionResultCodeTxSorobanInvalid, errorResult.Result.Code) + + assert.Greater(t, len(result.DiagnosticEventsXDR), 0) + var event xdr.DiagnosticEvent + err = xdr.SafeUnmarshalBase64(result.DiagnosticEventsXDR[0], &event) + assert.NoError(t, err) + +} + func TestSendTransactionFailedInLedger(t *testing.T) { test := NewTest(t) diff --git a/cmd/soroban-rpc/lib/preflight/Cargo.toml b/cmd/soroban-rpc/lib/preflight/Cargo.toml index e78939588f..c80b61abb9 100644 --- a/cmd/soroban-rpc/lib/preflight/Cargo.toml +++ b/cmd/soroban-rpc/lib/preflight/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "preflight" -version = "20.1.1" +version = "20.2.0" publish = false [lib] diff --git a/docs/soroban-cli-full-docs.md b/docs/soroban-cli-full-docs.md index 7ae0d6e309..3546594c61 100644 --- a/docs/soroban-cli-full-docs.md +++ b/docs/soroban-cli-full-docs.md @@ -20,6 +20,9 @@ This document contains the help content for the `soroban` command-line program. * [`soroban config identity rm`↴](#soroban-config-identity-rm) * [`soroban config identity show`↴](#soroban-config-identity-show) * [`soroban contract`↴](#soroban-contract) +* [`soroban contract asset`↴](#soroban-contract-asset) +* [`soroban contract asset id`↴](#soroban-contract-asset-id) +* [`soroban contract asset deploy`↴](#soroban-contract-asset-deploy) * [`soroban contract bindings`↴](#soroban-contract-bindings) * [`soroban contract bindings json`↴](#soroban-contract-bindings-json) * [`soroban contract bindings rust`↴](#soroban-contract-bindings-rust) @@ -27,8 +30,6 @@ This document contains the help content for the `soroban` command-line program. * [`soroban contract build`↴](#soroban-contract-build) * [`soroban contract extend`↴](#soroban-contract-extend) * [`soroban contract deploy`↴](#soroban-contract-deploy) -* [`soroban contract deploy asset`↴](#soroban-contract-deploy-asset) -* [`soroban contract deploy wasm`↴](#soroban-contract-deploy-wasm) * [`soroban contract fetch`↴](#soroban-contract-fetch) * [`soroban contract id`↴](#soroban-contract-id) * [`soroban contract id asset`↴](#soroban-contract-id-asset) @@ -63,8 +64,6 @@ This document contains the help content for the `soroban` command-line program. * [`soroban network add`↴](#soroban-network-add) * [`soroban network rm`↴](#soroban-network-rm) * [`soroban network ls`↴](#soroban-network-ls) -* [`soroban network start`↴](#soroban-network-start) -* [`soroban network stop`↴](#soroban-network-stop) * [`soroban version`↴](#soroban-version) ## `soroban` @@ -110,7 +109,7 @@ Full CLI reference: https://github.com/stellar/soroban-tools/tree/main/docs/soro ###### **Options:** * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." * `-f`, `--filter-logs ` — Filter logs output. To turn on "soroban_cli::log::footprint=debug" or off "=off". Can also use env var `RUST_LOG` * `-q`, `--quiet` — Do not write logs to stderr including `INFO` * `-v`, `--verbose` — Log DEBUG events @@ -185,7 +184,7 @@ Add a new network * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -202,7 +201,7 @@ Remove a network ###### **Options:** * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -215,7 +214,7 @@ List networks ###### **Options:** * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." * `-l`, `--long` — Get more info about the networks @@ -253,7 +252,7 @@ Add a new identity (keypair, ledger, macOS keychain) * `--secret-key` — Add using secret_key Can provide with SOROBAN_SECRET_KEY * `--seed-phrase` — Add using 12 word seed phrase to generate secret_key * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -271,7 +270,7 @@ Given an identity return its address (public key) * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -292,7 +291,7 @@ Fund an identity on a test network * `--network ` — Name of network to use from config * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -312,7 +311,7 @@ Generate a new identity with a seed phrase, currently 12 words * `--seed ` — Optional seed to use when generating seed phrase. Random otherwise * `-s`, `--as-secret` — Output the generated identity as a secret key * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." * `--hd-path ` — When generating a secret key, which hd_path should be used from the original seed_phrase * `-d`, `--default-seed` — Generate the default seed phrase. Useful for testing. Equivalent to --seed 0000000000000000 * `--rpc-url ` — RPC server endpoint @@ -330,7 +329,7 @@ List identities ###### **Options:** * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." * `-l`, `--long` @@ -348,7 +347,7 @@ Remove an identity ###### **Options:** * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -366,7 +365,7 @@ Given an identity return its private key * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -378,10 +377,11 @@ Tools for smart contract developers ###### **Subcommands:** +* `asset` — Utilities to deploy a Stellar Asset Contract or get its id * `bindings` — Generate code client bindings for a contract * `build` — Build a contract from source * `extend` — Extend the time to live ledger of a contract-data ledger entry -* `deploy` — Deploy a contract or Soroban Asset Contract +* `deploy` — Deploy a wasm contract * `fetch` — Fetch a contract's Wasm binary * `id` — Generate the contract id for a given contract or asset * `inspect` — Inspect a WASM file listing contract functions, meta, etc @@ -393,6 +393,60 @@ Tools for smart contract developers +## `soroban contract asset` + +Utilities to deploy a Stellar Asset Contract or get its id + +**Usage:** `soroban contract asset ` + +###### **Subcommands:** + +* `id` — Get Id of builtin Soroban Asset Contract. Deprecated, use `soroban contract id asset` instead +* `deploy` — Deploy builtin Soroban Asset Contract + + + +## `soroban contract asset id` + +Get Id of builtin Soroban Asset Contract. Deprecated, use `soroban contract id asset` instead + +**Usage:** `soroban contract asset id [OPTIONS] --asset --source-account ` + +###### **Options:** + +* `--asset ` — ID of the Stellar classic asset to wrap, e.g. "USDC:G...5" +* `--rpc-url ` — RPC server endpoint +* `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server +* `--network ` — Name of network to use from config +* `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` +* `--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 ` — Location of config directory, default is "." + + + +## `soroban contract asset deploy` + +Deploy builtin Soroban Asset Contract + +**Usage:** `soroban contract asset deploy [OPTIONS] --asset --source-account ` + +###### **Options:** + +* `--asset ` — ID of the Stellar classic asset to wrap, e.g. "USDC:G...5" +* `--rpc-url ` — RPC server endpoint +* `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server +* `--network ` — Name of network to use from config +* `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` +* `--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 ` — Location of config directory, default is "." +* `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm + + Default value: `100` + + + ## `soroban contract bindings` Generate code client bindings for a contract @@ -444,7 +498,7 @@ Generate a TypeScript / JavaScript package * `--overwrite` — Whether to overwrite output directory if it already exists * `--contract-id ` — The contract ID/address on the network * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--network ` — Name of network to use from config @@ -509,7 +563,7 @@ If no keys are specified the contract itself is extended. * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--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 "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm Default value: `100` @@ -518,44 +572,9 @@ If no keys are specified the contract itself is extended. ## `soroban contract deploy` -Deploy a contract or Soroban Asset Contract - -**Usage:** `soroban contract deploy ` - -###### **Subcommands:** - -* `asset` — Deploy builtin Soroban Asset Contract -* `wasm` — Deploy normal Wasm Contract - - - -## `soroban contract deploy asset` - -Deploy builtin Soroban Asset Contract +Deploy a wasm contract -**Usage:** `soroban contract deploy asset [OPTIONS] --asset --source-account ` - -###### **Options:** - -* `--asset ` — ID of the Stellar classic asset to wrap, e.g. "USDC:G...5" -* `--rpc-url ` — RPC server endpoint -* `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server -* `--network ` — Name of network to use from config -* `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` -* `--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 ` -* `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm - - Default value: `100` - - - -## `soroban contract deploy wasm` - -Deploy normal Wasm Contract - -**Usage:** `soroban contract deploy wasm [OPTIONS] --source-account <--wasm |--wasm-hash >` +**Usage:** `soroban contract deploy [OPTIONS] --source-account <--wasm |--wasm-hash >` ###### **Options:** @@ -568,7 +587,7 @@ Deploy normal Wasm Contract * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--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 "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm Default value: `100` @@ -589,7 +608,7 @@ Fetch a contract's Wasm binary * `--id ` — Contract ID to fetch * `-o`, `--out-file ` — Where to write output otherwise stdout is used * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--network ` — Name of network to use from config @@ -624,7 +643,7 @@ Deploy builtin Soroban Asset Contract * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--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 "." @@ -643,7 +662,7 @@ Deploy normal Wasm Contract * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--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 "." @@ -669,7 +688,7 @@ Inspect a WASM file listing contract functions, meta, etc Pretty print of contract spec entries * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -687,7 +706,7 @@ Install a WASM file to the ledger without creating a contract instance * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--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 "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm Default value: `100` @@ -722,7 +741,7 @@ soroban contract invoke ... -- --help * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--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 "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm Default value: `100` @@ -781,7 +800,7 @@ Print the current value of a contract-data ledger entry * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--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 "." @@ -816,7 +835,7 @@ If no keys are specificed the contract itself is restored. * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--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 "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm Default value: `100` @@ -857,7 +876,7 @@ Watch the network for contract events Possible values: `all`, `contract`, `system` * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--network ` — Name of network to use from config @@ -897,7 +916,7 @@ Add a new identity (keypair, ledger, macOS keychain) * `--secret-key` — Add using secret_key Can provide with SOROBAN_SECRET_KEY * `--seed-phrase` — Add using 12 word seed phrase to generate secret_key * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -915,7 +934,7 @@ Given an identity return its address (public key) * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -936,7 +955,7 @@ Fund an identity on a test network * `--network ` — Name of network to use from config * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -956,7 +975,7 @@ Generate a new identity with a seed phrase, currently 12 words * `--seed ` — Optional seed to use when generating seed phrase. Random otherwise * `-s`, `--as-secret` — Output the generated identity as a secret key * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." * `--hd-path ` — When generating a secret key, which hd_path should be used from the original seed_phrase * `-d`, `--default-seed` — Generate the default seed phrase. Useful for testing. Equivalent to --seed 0000000000000000 * `--rpc-url ` — RPC server endpoint @@ -974,7 +993,7 @@ List identities ###### **Options:** * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." * `-l`, `--long` @@ -992,7 +1011,7 @@ Remove an identity ###### **Options:** * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -1010,7 +1029,7 @@ Given an identity return its private key * `--hd-path ` — If identity is a seed phrase use this hd path, default is 0 * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -1055,7 +1074,7 @@ Deploy a token contract to wrap an existing Stellar classic asset for smart cont * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--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 "." * `--fee ` — fee amount for transaction, in stroops. 1 stroop = 0.0000001 xlm Default value: `100` @@ -1077,7 +1096,7 @@ Compute the expected contract id for the given asset Deprecated, use `soroban co * `--source-account ` — Account that signs the final transaction. Alias `source`. Can be an identity (--source alice), a secret key (--source SC36…), or a seed phrase (--source "kite urban…"). Default: `identity generate --default-seed` * `--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 "." @@ -1238,8 +1257,6 @@ Start and configure networks * `add` — Add a new network * `rm` — Remove a network * `ls` — List networks -* `start` — Start network -* `stop` — Stop network @@ -1258,7 +1275,7 @@ Add a new network * `--rpc-url ` — RPC server endpoint * `--network-passphrase ` — Network passphrase to sign the transaction sent to the rpc server * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -1275,7 +1292,7 @@ Remove a network ###### **Options:** * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." @@ -1288,48 +1305,11 @@ List networks ###### **Options:** * `--global` — Use global config -* `--config-dir ` +* `--config-dir ` — Location of config directory, default is "." * `-l`, `--long` — Get more info about the networks -## `soroban network start` - -Start network - -**Usage:** `soroban network start [OPTIONS] ` - -###### **Arguments:** - -* `` — Network to start, e.g. local, testnet, futurenet - -###### **Options:** - -* `-c`, `--container-name ` — optional argument to customize container name - - Default value: `stellar` -* `-i`, `--docker-image ` — optional argument for docker image - - Default value: `stellar/quickstart` -* `-t`, `--docker-tag ` — optional argument for docker tag - - Default value: `testing` -* `-d`, `--detached` — optional argument to run docker process in detached mode - - - -## `soroban network stop` - -Stop network - -**Usage:** `soroban network stop [CONTAINER]` - -###### **Arguments:** - -* `` — docker container to stop, defaults to "stellar" - - - ## `soroban version` Print version information diff --git a/go.mod b/go.mod index 8c5d3c31fb..a8bd3bf458 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 - github.com/stellar/go v0.0.0-20231204183605-af6f4ebad728 + github.com/stellar/go v0.0.0-20240109175136-3ca501f09055 github.com/stretchr/testify v1.8.4 golang.org/x/mod v0.13.0 gotest.tools/v3 v3.5.0 @@ -37,7 +37,6 @@ require ( github.com/skeema/knownhosts v1.2.1 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect - github.com/xdrpp/goxdr v0.1.1 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/tools v0.14.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index e398b0172a..ed68c00945 100644 --- a/go.sum +++ b/go.sum @@ -137,7 +137,6 @@ github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34H github.com/gobuffalo/logger v1.0.6/go.mod h1:J31TBEHR1QLV2683OXTAItYIg8pv2JMHnF/quuAbMjs= github.com/gobuffalo/packd v1.0.2 h1:Yg523YqnOxGIWCp69W12yYBKsoChwI7mtu6ceM9Bwfw= github.com/gobuffalo/packd v1.0.2/go.mod h1:sUc61tDqGMXON80zpKGp92lDb86Km28jfvX7IAyxFT8= -github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg= github.com/gobuffalo/packr/v2 v2.8.3 h1:xE1yzvnO56cUC0sTpKR3DIbxZgB54AftTFMhB2XEWlY= github.com/gobuffalo/packr/v2 v2.8.3/go.mod h1:0SahksCVcx4IMnigTjiFuyldmTrdTctXsOdiU5KwbKc= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -204,8 +203,10 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gorilla/schema v1.1.0 h1:CamqUDOFUBqzrvxuz2vEwo8+SUdwsluFh7IlzJh30LY= -github.com/gorilla/schema v1.1.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU= +github.com/gorilla/schema v1.2.0 h1:YufUaxZYCKGFuAq3c96BOhjgd5nmXiOY9NGzF247Tsc= +github.com/gorilla/schema v1.2.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU= +github.com/guregu/null v4.0.0+incompatible h1:4zw0ckM7ECd6FNNddc3Fu4aty9nTlpkkzH7dPn4/4Gw= +github.com/guregu/null v4.0.0+incompatible/go.mod h1:ePGpQaN9cw0tj45IR5E5ehMvsFlLlQZAkkOXZurJ3NM= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -333,12 +334,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= -github.com/stellar/go v0.0.0-20231114175958-eb2984b58392 h1:sYxHgLDT3z6cJrWuf0O9Fbs/E2UNGh3PPoOlM8DJ2vk= -github.com/stellar/go v0.0.0-20231114175958-eb2984b58392/go.mod h1:g78pyZyDFnKMJUaBIXxH7xyQ7PdDrvrJTFCxdGMMb3c= -github.com/stellar/go v0.0.0-20231204183605-af6f4ebad728 h1:lyATpWxLxhZSZIGP3MfCs+C5bVJWvX/FcvQCslknK4E= -github.com/stellar/go v0.0.0-20231204183605-af6f4ebad728/go.mod h1:3wMphjCZGi42wsrrKknendsozw7g9FVBm4YSlI1LpA4= -github.com/stellar/go-xdr v0.0.0-20230919160922-6c7b68458206 h1:UFuvvpbWL8+jqO1QmKYWSVhiMp4MRiIFd8/zQlUINH0= -github.com/stellar/go-xdr v0.0.0-20230919160922-6c7b68458206/go.mod h1:yoxyU/M8nl9LKeWIoBrbDPQ7Cy+4jxRcWcOayZ4BMps= +github.com/stellar/go v0.0.0-20240109175136-3ca501f09055 h1:6/i5f/4CsoArb9eNe+Pr+ATQkBvWNK31at6qaw9zMH4= +github.com/stellar/go v0.0.0-20240109175136-3ca501f09055/go.mod h1:PAWie4LYyDzJXqDVG4Qcj1Nt+uNk7sjzgSCXndQYsBA= github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2 h1:OzCVd0SV5qE3ZcDeSFCmOWLZfEWZ3Oe8KtmSOYKEVWE= github.com/stellar/go-xdr v0.0.0-20231122183749-b53fb00bcac2/go.mod h1:yoxyU/M8nl9LKeWIoBrbDPQ7Cy+4jxRcWcOayZ4BMps= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/cmd/soroban-cli/rust-toolchain.toml b/rust-toolchain.toml similarity index 100% rename from cmd/soroban-cli/rust-toolchain.toml rename to rust-toolchain.toml