From 832466a6dae4a02c49db2ea6a9355641eacfd4e5 Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Mon, 8 Apr 2024 17:36:21 +0800 Subject: [PATCH 01/10] ci: update toolchain with nix --- .github/workflows/build.yml | 19 +++------ Cargo.toml | 2 +- MANIFEST.yml | 2 +- README.md | 2 +- flake.lock | 85 +++++++++++++++++++++++++++++++++++++ flake.nix | 58 +++++++++++++++++++++++++ 6 files changed, 153 insertions(+), 15 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c4106ff..420a118 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,16 +87,11 @@ jobs: strategy: fail-fast: false matrix: - toolchain: [ nightly, beta, stable, 1.70.0 ] + toolchain: [ nightly, beta, stable, msrv ] steps: - - uses: actions/checkout@v3 - - name: Install rust ${{ matrix.toolchain }} - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - name: All features - uses: actions-rs/cargo@v1 - with: - command: check - args: --workspace --all-targets --all-features + - name: checkout + uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v26 + - name: Check rgb + run: nix develop ".#${{ matrix.toolchain }}" -c cargo check --workspace --all-targets --all-features diff --git a/Cargo.toml b/Cargo.toml index ccf6c2d..e1d2638 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ categories = ["cryptography::cryptocurrencies"] authors = ["Dr Maxim Orlovsky "] homepage = "https://lnp-bp.org" repository = "https://github.com/RGB-WG/rgb" -rust-version = "1.67" # Due to strict encoding library +rust-version = "1.75.0" edition = "2021" license = "Apache-2.0" diff --git a/MANIFEST.yml b/MANIFEST.yml index b86aec3..4d6c120 100644 --- a/MANIFEST.yml +++ b/MANIFEST.yml @@ -3,7 +3,7 @@ Type: Binary Kind: Free software License: Apache-2.0 Language: Rust -Compiler: 1.67 +Compiler: 1.75 Author: Maxim Orlovsky Maintained: LNP/BP Standards Association, Switzerland Maintainers: diff --git a/README.md b/README.md index 103240d..5ab5aec 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ and RGB as "assets for bitcoin and LN" by [Peter Todd][Todd] and ## Installing First, you need to install [cargo](https://doc.rust-lang.org/cargo/). -Minimum supported rust compiler version (MSRV): 1.66, rust 2021 edition. +Minimum supported rust compiler version (MSRV) is shown in `rust-version` of `Cargo.toml`. Next, you need to install developer components, which are OS-specific: diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6894ac0 --- /dev/null +++ b/flake.lock @@ -0,0 +1,85 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1712439257, + "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712542394, + "narHash": "sha256-UZebDBECRSrJqw4K+LxZ6qFdYnScu6q1XCwqtsu1cas=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "ece8bdb3c3b58def25f204b9a1261dee55d7c9c0", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2e98f00 --- /dev/null +++ b/flake.nix @@ -0,0 +1,58 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; + + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, rust-overlay, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + overlays = [ (import rust-overlay) ]; + pkgs = import nixpkgs { + inherit system overlays; + }; + + commonPackages = with pkgs; [ + openssl + pkg-config + ]; + cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); + in + with pkgs; + { + devShells = rec { + default = msrv; + + msrv = mkShell { + buildInputs = commonPackages ++ [ + rust-bin.stable."${cargoToml.workspace.package."rust-version"}".default + ]; + }; + + stable = mkShell { + buildInputs = commonPackages ++ [ + rust-bin.stable.latest.default + ]; + }; + + beta = mkShell { + buildInputs = commonPackages ++ [ + rust-bin.beta.latest.default + ]; + }; + + nightly = mkShell { + buildInputs = commonPackages ++ [ + rust-bin.nightly.latest.default + ]; + }; + }; + } + ); +} From d03b25373bbc30e480845a9c2edbc4bb2f3ddf8b Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Tue, 23 Apr 2024 20:26:05 +0800 Subject: [PATCH 02/10] ci: update checkout v2 -> v4 --- .github/workflows/build.yml | 8 ++++---- .github/workflows/codecov.yml | 2 +- .github/workflows/lint.yml | 6 +++--- .github/workflows/test.yml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 420a118..30cbb39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: default: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install rust stable uses: actions-rs/toolchain@v1 with: @@ -27,7 +27,7 @@ jobs: no-default: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install rust stable uses: actions-rs/toolchain@v1 with: @@ -48,7 +48,7 @@ jobs: - log - serde steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install rust stable uses: actions-rs/toolchain@v1 with: @@ -71,7 +71,7 @@ jobs: matrix: os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install rust stable uses: actions-rs/toolchain@v1 with: diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 2077319..d8b6fa0 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -13,7 +13,7 @@ jobs: codecov: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up toolchain uses: actions-rs/toolchain@v1 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e31e8bd..db26455 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install rustc nightly uses: actions-rs/toolchain@v1 with: @@ -28,7 +28,7 @@ jobs: clippy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install rustc stable uses: actions-rs/toolchain@v1 with: @@ -43,7 +43,7 @@ jobs: doc: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install rustc nightly uses: actions-rs/toolchain@v1 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7748a76..f3a8e82 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: testing: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install latest stable uses: actions-rs/toolchain@v1 with: From 960003fd522f2cacbe6c000b7091bd3da7b79d4a Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Tue, 23 Apr 2024 20:35:01 +0800 Subject: [PATCH 03/10] ci: update build with nix --- .github/workflows/build.yml | 40 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 30cbb39..1fecc7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,12 +14,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + # NOTE: Dont use nix here everything should be based on the ubuntu-latest - name: Install rust stable uses: actions-rs/toolchain@v1 with: toolchain: stable override: true - - name: Default build + - name: Latest Ubuntu build check uses: actions-rs/cargo@v1 with: command: check @@ -28,16 +29,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: No features - uses: actions-rs/cargo@v1 - with: - command: check - args: --workspace --no-default-features + - name: Install Nix + uses: cachix/install-nix-action@v26 + - name: Latest Ubuntu build check no features + run: nix develop .#stable -c cargo check --workspace --no-default-features features: runs-on: ubuntu-latest strategy: @@ -49,21 +44,13 @@ jobs: - serde steps: - uses: actions/checkout@v4 - - name: Install rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Feature ${{ matrix.feature }} - uses: actions-rs/cargo@v1 - with: - command: check - args: --no-default-features --features=${{ matrix.feature }} - - name: Defaults + ${{ matrix.feature }} - uses: actions-rs/cargo@v1 - with: - command: check - args: --features=${{ matrix.feature }} + - uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v26 + - name: Check feature ${{ matrix.feature }} only + run: nix develop .#stable -c cargo check --no-default-features --features=${{ matrix.feature }} + - name: Check feature ${{ matrix.feature }} with defaults + run: nix develop .#stable -c cargo check --features=${{ matrix.feature }} platforms: runs-on: ${{ matrix.os }} strategy: @@ -72,6 +59,7 @@ jobs: os: [ ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022 ] steps: - uses: actions/checkout@v4 + # NOTE: Dont use nix in platform checks everything should based on the host system - name: Install rust stable uses: actions-rs/toolchain@v1 with: From e312ee5be8fef4d21538925bba059f3993148545 Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Tue, 23 Apr 2024 20:38:56 +0800 Subject: [PATCH 04/10] ci: update lint with nix --- .github/workflows/lint.yml | 48 ++++++++++++-------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index db26455..eabfd50 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,44 +14,26 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install rustc nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - components: rustfmt - - uses: actions-rs/cargo@v1 - name: Formatting - with: - command: fmt - args: --all -- --check + - uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v26 + - name: Formatting + run: nix develop .#nightly -c cargo fmt --all -- --check clippy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install rustc stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - components: clippy - - uses: actions-rs/cargo@v1 - name: Clippy - with: - command: clippy - args: --workspace --all-features --all-targets -- -D warnings + - uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v26 + - name: Clippy + run: nix develop .#stable -c cargo clippy --workspace --all-features --all-targets -- -D warnings doc: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install rustc nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - components: rust-docs - - uses: actions-rs/cargo@v1 - name: Doc - with: - command: doc - args: --workspace --all-features + - uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v26 + - name: Doc + run: nix develop .#nightly -c cargo doc --workspace --all-features From 16318c62604269926f7e9d7e7c0253a409901f0e Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Tue, 23 Apr 2024 20:41:38 +0800 Subject: [PATCH 05/10] ci: update test with nix --- .github/workflows/test.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3a8e82..f642bca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,13 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install latest stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + - name: Install Nix + uses: cachix/install-nix-action@v26 - name: Build & test - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace --all-features --no-fail-fast + run: nix develop .#stable -c cargo test --workspace --all-features --no-fail-fast --tests From cef61514b7c3b369ae989d57d07c7579c9fb0241 Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Tue, 23 Apr 2024 21:00:07 +0800 Subject: [PATCH 06/10] ci: update codecov with nix --- .github/workflows/codecov.yml | 38 ++++++++++------------------------- flake.nix | 14 +++++++++++++ 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index d8b6fa0..cbb6d3a 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -14,38 +14,22 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt, llvm-tools-preview + - name: Install Nix + uses: cachix/install-nix-action@v26 - name: Build - uses: actions-rs/cargo@v1 - with: - command: build - args: --release - env: - CARGO_INCREMENTAL: "0" - RUSTFLAGS: "-Cinstrument-coverage" - RUSTDOCFLAGS: "-Cinstrument-coverage" + run: nix develop .#codecov -c cargo build --release - name: Test - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --no-fail-fast - env: - CARGO_INCREMENTAL: "0" - RUSTFLAGS: "-Cinstrument-coverage" - RUSTDOCFLAGS: "-Cinstrument-coverage" + run: nix develop .#codecov -c cargo test --all-features --no-fail-fast --tests - name: Install grcov - run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi + run: nix develop .#codecov -c cargo install grcov - name: Generate coverage - run: grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov + run: nix develop .#codecov -c grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./coverage.lcov flags: rust - fail_ci_if_error: true + # TODO: set true when CODECOV_TOKEN is set + fail_ci_if_error: false + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/flake.nix b/flake.nix index 2e98f00..f23f7de 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,11 @@ pkg-config ]; cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); + + stableWithLlvm = pkgs.rust-bin.nightly.latest.default.override { + extensions = [ "rustfmt" "llvm-tools-preview" ]; + targets = [ ]; + }; in with pkgs; { @@ -52,6 +57,15 @@ rust-bin.nightly.latest.default ]; }; + + codecov = mkShell { + buildInputs = commonPackages ++ [ + stableWithLlvm + ]; + CARGO_INCREMENTAL = "0"; + RUSTFLAGS = "-Cinstrument-coverage"; + RUSTDOCFLAGS = "-Cinstrument-coverage"; + }; }; } ); From f92bc9294cef17d03a78b86ca7b9d4effcc2c545 Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Tue, 23 Apr 2024 21:24:26 +0800 Subject: [PATCH 07/10] chore: update Cargo.lock --- Cargo.lock | 72 +++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 161973c..de66418 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -323,7 +323,7 @@ dependencies = [ [[package]] name = "bp-consensus" version = "0.11.0-beta.5" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#27a4b711613f88276b5b7da0c2a3b27164b431e8" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#ff275566b6546c39d6a37579861b918104fd859d" dependencies = [ "amplify", "chrono", @@ -337,7 +337,7 @@ dependencies = [ [[package]] name = "bp-core" version = "0.11.0-beta.5" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#27a4b711613f88276b5b7da0c2a3b27164b431e8" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#ff275566b6546c39d6a37579861b918104fd859d" dependencies = [ "amplify", "bp-consensus", @@ -355,7 +355,7 @@ dependencies = [ [[package]] name = "bp-dbc" version = "0.11.0-beta.5" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#27a4b711613f88276b5b7da0c2a3b27164b431e8" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#ff275566b6546c39d6a37579861b918104fd859d" dependencies = [ "amplify", "base85", @@ -369,7 +369,7 @@ dependencies = [ [[package]] name = "bp-derive" version = "0.11.0-beta.5" -source = "git+https://github.com/BP-WG/bp-std?branch=v0.11#7dd16a84edc8c308856155d990d9df4311c35bfc" +source = "git+https://github.com/BP-WG/bp-std?branch=v0.11#6741b11d42e92557ae884b7d5208013f0314807f" dependencies = [ "amplify", "bitcoin_hashes", @@ -391,7 +391,7 @@ dependencies = [ "byteorder", "libc", "log", - "rustls 0.21.10", + "rustls 0.21.11", "serde", "serde_json", "sha2", @@ -418,7 +418,7 @@ dependencies = [ [[package]] name = "bp-invoice" version = "0.11.0-beta.5" -source = "git+https://github.com/BP-WG/bp-std?branch=v0.11#7dd16a84edc8c308856155d990d9df4311c35bfc" +source = "git+https://github.com/BP-WG/bp-std?branch=v0.11#6741b11d42e92557ae884b7d5208013f0314807f" dependencies = [ "amplify", "bech32", @@ -430,7 +430,7 @@ dependencies = [ [[package]] name = "bp-seals" version = "0.11.0-beta.5" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#27a4b711613f88276b5b7da0c2a3b27164b431e8" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#ff275566b6546c39d6a37579861b918104fd859d" dependencies = [ "amplify", "baid58", @@ -446,7 +446,7 @@ dependencies = [ [[package]] name = "bp-std" version = "0.11.0-beta.5" -source = "git+https://github.com/BP-WG/bp-std?branch=v0.11#7dd16a84edc8c308856155d990d9df4311c35bfc" +source = "git+https://github.com/BP-WG/bp-std?branch=v0.11#6741b11d42e92557ae884b7d5208013f0314807f" dependencies = [ "amplify", "bp-consensus", @@ -484,7 +484,7 @@ dependencies = [ [[package]] name = "bp-wallet" version = "0.11.0-beta.5" -source = "git+https://github.com/BP-WG/bp-wallet?branch=v0.11#5d07f271605395a0d7e4d10c87283fbcb4203e1b" +source = "git+https://github.com/BP-WG/bp-wallet?branch=v0.11#e05f6c75a1a150851a4b08fcec74f02230de6bb1" dependencies = [ "amplify", "bp-electrum", @@ -520,9 +520,9 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cc" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" [[package]] name = "cfg-if" @@ -605,7 +605,7 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "commit_encoding_derive" version = "0.11.0-beta.5" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#d32e1af11a599643b235706efd51d0097347f082" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#f51e1e0d010b1531acc939d2443af552e8755bb7" dependencies = [ "amplify", "amplify_syn", @@ -617,7 +617,7 @@ dependencies = [ [[package]] name = "commit_verify" version = "0.11.0-beta.5" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#d32e1af11a599643b235706efd51d0097347f082" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#f51e1e0d010b1531acc939d2443af552e8755bb7" dependencies = [ "amplify", "commit_encoding_derive", @@ -744,7 +744,7 @@ dependencies = [ [[package]] name = "descriptors" version = "0.11.0-beta.5" -source = "git+https://github.com/BP-WG/bp-std?branch=v0.11#7dd16a84edc8c308856155d990d9df4311c35bfc" +source = "git+https://github.com/BP-WG/bp-std?branch=v0.11#6741b11d42e92557ae884b7d5208013f0314807f" dependencies = [ "amplify", "bp-derive", @@ -1414,7 +1414,7 @@ dependencies = [ [[package]] name = "psbt" version = "0.11.0-beta.5" -source = "git+https://github.com/BP-WG/bp-std?branch=v0.11#7dd16a84edc8c308856155d990d9df4311c35bfc" +source = "git+https://github.com/BP-WG/bp-std?branch=v0.11#6741b11d42e92557ae884b7d5208013f0314807f" dependencies = [ "amplify", "base64", @@ -1551,7 +1551,7 @@ dependencies = [ [[package]] name = "rgb-core" version = "0.11.0-beta.5" -source = "git+https://github.com/RGB-WG/rgb-core?branch=v0.11#551d6d6fc3c7bf10119b20145ddae852fba6446d" +source = "git+https://github.com/RGB-WG/rgb-core?branch=v0.11#e83f07bc2f64b9ee370f71aefacafbb59ce26c4e" dependencies = [ "aluvm", "amplify", @@ -1573,7 +1573,7 @@ dependencies = [ [[package]] name = "rgb-invoice" version = "0.11.0-beta.5" -source = "git+https://github.com/RGB-WG/rgb-std?branch=v0.11#baf4b823eeed514f08bd9bf89d0c426b5517262b" +source = "git+https://github.com/RGB-WG/rgb-std?branch=v0.11#76b6da4c1af821b159a32c76a0c02afd97a23e66" dependencies = [ "amplify", "baid58", @@ -1633,7 +1633,7 @@ dependencies = [ [[package]] name = "rgb-std" version = "0.11.0-beta.5" -source = "git+https://github.com/RGB-WG/rgb-std?branch=v0.11#baf4b823eeed514f08bd9bf89d0c426b5517262b" +source = "git+https://github.com/RGB-WG/rgb-std?branch=v0.11#76b6da4c1af821b159a32c76a0c02afd97a23e66" dependencies = [ "aluvm", "amplify", @@ -1711,9 +1711,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno", @@ -1724,9 +1724,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", "ring", @@ -1736,14 +1736,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.3", "subtle", "zeroize", ] @@ -1775,9 +1775,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" dependencies = [ "ring", "rustls-pki-types", @@ -2029,7 +2029,7 @@ dependencies = [ [[package]] name = "single_use_seals" version = "0.11.0-beta.5" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#d32e1af11a599643b235706efd51d0097347f082" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#f51e1e0d010b1531acc939d2443af552e8755bb7" dependencies = [ "amplify_derive", ] @@ -2215,18 +2215,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", @@ -2353,9 +2353,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" dependencies = [ "indexmap 2.2.6", "serde", @@ -2444,9 +2444,9 @@ dependencies = [ "flate2", "log", "once_cell", - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.3", "serde", "serde_json", "socks", From c709c393e10f970e8c31cc0566b48c650f20df52 Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Tue, 23 Apr 2024 23:14:15 +0800 Subject: [PATCH 08/10] ci: add dependency bot --- .github/dependabot.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e195b0b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "cargo" + directory: "/psbt" + schedule: + interval: "weekly" From 9492fd3e82aaab65e77b767f09d85ab2d38a8bad Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Fri, 26 Apr 2024 15:27:51 +0800 Subject: [PATCH 09/10] ci: add cli run check --- .github/workflows/build.yml | 11 +++++++++++ .gitignore | 1 + flake.lock | 21 +++++++++++++++++++++ flake.nix | 32 +++++++++++++++++++++++++++++--- 4 files changed, 62 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fecc7a..e17afd4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,17 @@ env: CARGO_TERM_COLOR: always jobs: + cli: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - name: checkout + uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v26 + - name: Check rgb-wallet + run: nix run .#rgb -- -V | grep rgb-wallet default: runs-on: ubuntu-latest steps: diff --git a/.gitignore b/.gitignore index 653cfce..8507b0d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ *.swp /dep_test +result diff --git a/flake.lock b/flake.lock index 6894ac0..5131a9d 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "crane": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1713979152, + "narHash": "sha256-apdecPuh8SOQnkEET/kW/UcfjCRb8JbV5BKjoH+DcP4=", + "owner": "ipetkov", + "repo": "crane", + "rev": "a5eca68a2cf11adb32787fc141cddd29ac8eb79c", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -36,6 +56,7 @@ }, "root": { "inputs": { + "crane": "crane", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" diff --git a/flake.nix b/flake.nix index f23f7de..0d8c593 100644 --- a/flake.nix +++ b/flake.nix @@ -6,11 +6,16 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-utils.follows = "flake-utils"; }; + crane = { + url = "github:ipetkov/crane"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, rust-overlay, nixpkgs, flake-utils }: + outputs = { self, crane, rust-overlay, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let overlays = [ (import rust-overlay) ]; @@ -22,7 +27,8 @@ openssl pkg-config ]; - cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); + workspaceToml = builtins.fromTOML (builtins.readFile ./Cargo.toml); + craneLib = (crane.mkLib pkgs).overrideToolchain pkgs.rust-bin.stable.latest.default; stableWithLlvm = pkgs.rust-bin.nightly.latest.default.override { extensions = [ "rustfmt" "llvm-tools-preview" ]; @@ -31,12 +37,32 @@ in with pkgs; { + packages = rec { + default = rgb; + rgb = craneLib.buildPackage rec { + pname = "rgb"; + cargoToml = ./Cargo.toml; + nativeBuildInputs = commonPackages; + cargoExtraArgs = "-p rgb-wallet"; + outputHashes = {}; + src = self; + buildInputs = with pkgs; [ + openssl + ]; + cargoArtifacts = craneLib.buildDepsOnly { + inherit src cargoToml buildInputs nativeBuildInputs cargoExtraArgs outputHashes; + }; + strictDeps = true; + doCheck = false; + }; + }; + devShells = rec { default = msrv; msrv = mkShell { buildInputs = commonPackages ++ [ - rust-bin.stable."${cargoToml.workspace.package."rust-version"}".default + rust-bin.stable."${workspaceToml.workspace.package."rust-version"}".default ]; }; From c2ce1e5c4ad98c391bfca2b4ed9f95b263116b78 Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Thu, 23 May 2024 16:47:54 +0800 Subject: [PATCH 10/10] ci: remove depbot --- .github/dependabot.yml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index e195b0b..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - - package-ecosystem: "cargo" - directory: "/" - schedule: - interval: "weekly" - - package-ecosystem: "cargo" - directory: "/psbt" - schedule: - interval: "weekly"