diff --git a/.envrc b/.envrc index 3550a30..0cd1325 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -use flake +use flake '.?submodules=1' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7164788 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: Build + +on: + push: + branches: [ main ] + pull_request: + branches: + - "**" + paths-ignore: + - '*.md' + workflow_dispatch: + +# This allows a subsequently queued workflow run to interrupt previous runs on pull-requests +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.run_id }}' + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + CARGO_INCREMENTAL: 0 + CARGO_NET_RETRY: 10 + RUST_BACKTRACE: short + # We allow redundant explicit links because `cargo rdme` doesn't know how to resolve implicit intra-crate links. + RUSTDOCFLAGS: -A rustdoc::redundant_explicit_links -D warnings + # We will re-enable this once the client worker builds without warnings. + # RUSTFLAGS: -D warnings + RUSTUP_MAX_RETRIES: 10 + RUST_LOG: warn + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: cachix/install-nix-action@v26 + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Build the client worker + run: | + cd client-worker + nix develop '.?submodules=1' --override-input linera-protocol ../linera-protocol --command wasm-pack build --target web + - name: Build the extension + run: | + cd extension + nix develop --override-input linera-protocol ../linera-protocol --command pnpm install + nix develop --override-input linera-protocol ../linera-protocol --command pnpm build diff --git a/.gitmodules b/.gitmodules index bbe3307..9523c14 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "linera-protocol"] path = linera-protocol - url = git@github.com:linera-io/linera-protocol + url = https://github.com/linera-io/linera-protocol diff --git a/client-worker/src/lib.rs b/client-worker/src/lib.rs index 64fdca1..ac8e113 100644 --- a/client-worker/src/lib.rs +++ b/client-worker/src/lib.rs @@ -91,6 +91,7 @@ impl ClientContext { chain.timestamp, chain.next_block_height, chain.pending_block.clone(), + chain.pending_blobs.clone(), ) } @@ -108,6 +109,7 @@ impl ClientContext { timestamp, next_block_height: BlockHeight::ZERO, pending_block: None, + pending_blobs: BTreeMap::default(), }); } } diff --git a/client-worker/src/wallet.rs b/client-worker/src/wallet.rs index 3dccd69..7643cdf 100644 --- a/client-worker/src/wallet.rs +++ b/client-worker/src/wallet.rs @@ -6,8 +6,8 @@ use std::collections::{BTreeMap, HashMap}; use anyhow::Context as _; use linera_base::{ crypto::{CryptoHash, CryptoRng, KeyPair, PublicKey}, - data_types::{BlockHeight, Timestamp}, - identifiers::{ChainDescription, ChainId, Owner}, + data_types::{BlockHeight, HashedBlob, Timestamp}, + identifiers::{BlobId, ChainDescription, ChainId, Owner}, }; use linera_chain::data_types::Block; use linera_core::{client::ChainClient, node::LocalValidatorNodeProvider}; @@ -137,6 +137,7 @@ impl Wallet { timestamp, next_block_height: BlockHeight(0), pending_block: None, + pending_blobs: BTreeMap::default(), }; self.insert(user_chain); Ok(()) @@ -168,6 +169,7 @@ impl Wallet { next_block_height: state.next_block_height(), timestamp: state.timestamp(), pending_block: state.pending_block().clone(), + pending_blobs: state.pending_blobs().clone(), }, ); } @@ -199,6 +201,7 @@ pub struct UserChain { pub timestamp: Timestamp, pub next_block_height: BlockHeight, pub pending_block: Option, + pub pending_blobs: BTreeMap, } impl UserChain { @@ -216,6 +219,7 @@ impl UserChain { timestamp, next_block_height: BlockHeight::ZERO, pending_block: None, + pending_blobs: BTreeMap::default(), } } @@ -227,6 +231,7 @@ impl UserChain { timestamp: self.timestamp.clone(), next_block_height: self.next_block_height.clone(), pending_block: self.pending_block.clone(), + pending_blobs: self.pending_blobs.clone(), } } @@ -240,6 +245,7 @@ impl UserChain { timestamp, next_block_height: BlockHeight::ZERO, pending_block: None, + pending_blobs: BTreeMap::default(), } } } diff --git a/flake.lock b/flake.lock index ac5672f..0e025ca 100644 --- a/flake.lock +++ b/flake.lock @@ -82,17 +82,14 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1715784324, + "lastModified": 1, "narHash": "sha256-G7I7bdzkHd3MvK2HJ2Wic1Q7EN70Fr/lo1SSY6nBmF0=", - "ref": "91b1bb47ec7f69a915846f985948ee07726e8ecc", - "rev": "91b1bb47ec7f69a915846f985948ee07726e8ecc", - "revCount": 3136, - "type": "git", - "url": "file:linera-protocol?shallow=1&submodules=1" + "path": "linera-protocol", + "type": "path" }, "original": { - "type": "git", - "url": "file:linera-protocol?shallow=1&submodules=1" + "path": "linera-protocol", + "type": "path" } }, "nixpkgs": { diff --git a/flake.nix b/flake.nix index 39b07d6..75338c1 100644 --- a/flake.nix +++ b/flake.nix @@ -3,10 +3,7 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; systems.url = "github:nix-systems/default"; - linera-protocol = { - type = "git"; - url = "file:linera-protocol?shallow=1&submodules=1"; - }; + linera-protocol.url = "path:linera-protocol"; }; outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } { diff --git a/linera-protocol b/linera-protocol index 91b1bb4..11f9838 160000 --- a/linera-protocol +++ b/linera-protocol @@ -1 +1 @@ -Subproject commit 91b1bb47ec7f69a915846f985948ee07726e8ecc +Subproject commit 11f9838ca7bd037490a84d905c8909c109f01895