diff --git a/.github/actions/style/action.yml b/.github/actions/style/action.yml index e81a9315d..fd4532a5b 100644 --- a/.github/actions/style/action.yml +++ b/.github/actions/style/action.yml @@ -31,7 +31,7 @@ runs: if echo "$ALL_CHANGED_FILES" | grep -q '\.rs$'; then echo "Running checks for the Rust code..." - # Install the nightly toolchain + # Install the nightly toolchain rustup toolchain install nightly # Install rustfmt for the nightly toolchain diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 59ae770e9..324ed57d4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -8,16 +8,45 @@ on: env: CARGO_TERM_COLOR: always + CARGO_HOME: + RUSTUP_HOME: + PNPM_HOME: + ALT_HOME: + STAGE_DIR: jobs: setup: name: Project setup runs-on: ubuntu-latest steps: + - name: Prepare + run: | + export STAGE_DIR="$(dirname $GITHUB_WORKSPACE)" + echo "STAGE_DIR=$STAGE_DIR" >> $GITHUB_ENV + export ALT_HOME="$STAGE_DIR/.home" + echo "ALT_HOME=$ALT_HOME" >> $GITHUB_ENV + + - name: Maximize build space + uses: easimon/maximize-build-space@v10 + with: + build-mount-path: ${{ env.STAGE_DIR }} + root-reserve-mb: 4096 + + - name: Relocate environment + run: | + echo "CARGO_HOME=$ALT_HOME/.cargo" >> $GITHUB_ENV + echo "RUSTUP_HOME=$ALT_HOME/.rustup" >> $GITHUB_ENV + echo "PNPM_HOME=$ALT_HOME/.pnpm" >> $GITHUB_ENV + + mkdir $ALT_HOME + mv ~/.cargo $ALT_HOME + mv ~/.rustup $ALT_HOME + echo "$ALT_HOME/.cargo/bin" | cat - $GITHUB_PATH > temp && mv temp $GITHUB_PATH + - name: Checkout code uses: actions/checkout@v4 - # Install Node.js (version 20) and pnpm + # Install Node.js (version 20) and pnpm - name: Set up Node.js uses: actions/setup-node@v2 with: diff --git a/packages/calimero-sdk/src/subscriptions/subscriptions.ts b/packages/calimero-sdk/src/subscriptions/subscriptions.ts index 97b172c7f..ec32d3742 100644 --- a/packages/calimero-sdk/src/subscriptions/subscriptions.ts +++ b/packages/calimero-sdk/src/subscriptions/subscriptions.ts @@ -5,7 +5,10 @@ export interface SubscriptionsClient { disconnect(connectionId?: string): void; subscribe(contextIds: string[], connectionId?: string): void; unsubscribe(contextIds: string[], connectionId?: string): void; - addCallback(callback: (event: NodeEvent) => void, connectionId?: string): void; + addCallback( + callback: (event: NodeEvent) => void, + connectionId?: string, + ): void; removeCallback( callback: (event: NodeEvent) => void, connectionId?: string, @@ -16,21 +19,23 @@ export type NodeEvent = ContextEvent; export type ContextEvent = ContextEventPayload & { contextId: ContextId; -} - -type ContextEventPayload = { - type: 'StateMutation', - data: StateMutation, -} | { - type: 'ExecutionEvent', - data: ExecutionEvent, }; +type ContextEventPayload = + | { + type: 'StateMutation'; + data: StateMutation; + } + | { + type: 'ExecutionEvent'; + data: ExecutionEvent; + }; + export interface StateMutation { newRoot: string; } export interface ExecutionEvent { - kind: string, - data: any, + kind: string; + data: any; }