Skip to content

Commit

Permalink
feat: update Wallet to devnet (#1427)
Browse files Browse the repository at this point in the history
- Update to `[email protected]` and `[email protected]` and `[email protected]`
  - Fixed/improved infra to run new fuel-core
- build based on config from
https://github.com/FuelLabs/chain-configuration.git
- include `fuel_toolchain` and use `forc` instead of `fuels` utilities
like `fuels-forc`
- Use `wallet.getTransactionCost` instead of
`provider.getTransactionCost`
- Add 10% buffer on maxFee to sendTransaction, to avoid crashing on
`getTxSummaryFromRequest` missing few units
  - Fixed `fuels.config.ts` to use `onDeploy` instead of `onSuccess`
- Fixed the way to connect to contracts from
`CustomAssetAbi__factory.connect(` to `new CustomAsset(`
- Fixed manually waiting for transactions `waitForResult` after a
contract call
  - Removed forced `txParams` from contract calls in e2e-contract-tests
- Cleaning on jest tests, removed some that were not worth maintaining
- Cleaning on some storybooks that were not worth maintaining
- Added `web_accessible_resources` to manifest due to error in extension
setup for playwright test
- Transpile connectors in docs infra `next.config.mjs`
  • Loading branch information
LuizAsFight authored Aug 23, 2024
1 parent 2d68d97 commit 7ba78a8
Show file tree
Hide file tree
Showing 98 changed files with 3,348 additions and 5,052 deletions.
7 changes: 7 additions & 0 deletions .changeset/angry-llamas-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@fuel-wallet/connections": minor
"@fuel-wallet/types": minor
"fuels-wallet": minor
---

Update to [email protected] and [email protected] and [email protected]
5 changes: 5 additions & 0 deletions .changeset/proud-bananas-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels-wallet": patch
---

Add 10% buffer on maxFee to sendTransaction, to avoid crashing on `getTxSummaryFromRequest` missing few units
5 changes: 5 additions & 0 deletions .changeset/tough-brooms-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"fuels-wallet": patch
---

Added `web_accessible_resources` to manifest due to error in extension setup for playwright test
25 changes: 25 additions & 0 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Rust & Forc Setup'

inputs:
rust-version:
default: 1.77.2
forc-components:
default: '[email protected], [email protected]'

runs:
using: 'composite'
steps:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ inputs.rust-version }}
components: clippy, rustfmt

- name: Init cache
uses: Swatinem/rust-cache@v2

- name: Install Fuel toolchain
uses: FuelLabs/[email protected]
with:
name: fuel-bridge
components: ${{ inputs.forc-components }}
18 changes: 2 additions & 16 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
COVERAGE_FILE: ./coverage/report.json

jobs:
tests-jest:
name: JEST Tests
Expand Down Expand Up @@ -44,23 +41,11 @@ jobs:
- name: Run Jest Tests
run: |
pnpm test:ci --outputFile="${{ env.COVERAGE_FILE }}"
pnpm test:ci
timeout-minutes: 20
env:
NODE_OPTIONS: "--max-old-space-size=4096"

- name: Publish coverage
uses: artiomtr/[email protected]
if: ${{ steps.findPr.outputs.number }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
package-manager: pnpm
annotations: failed-tests
test-script: pnpm test:ci
working-directory: ./packages/app
coverage-file: ${{ env.COVERAGE_FILE }}
base-coverage-file: ${{ env.COVERAGE_FILE }}

- name: Stop Test Node
run: pnpm node:clean

Expand Down Expand Up @@ -123,6 +108,7 @@ jobs:
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/setup-rust

- name: Run PNPM install
id: pnpm-cache
Expand Down
3 changes: 2 additions & 1 deletion docker/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PROJECT=fuels-wallet
MIN_GAS_PRICE=1
WALLET_SECRET=0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298
DISPENSE_AMOUNT=500000000
DISPENSE_AMOUNT=2000000
FUEL_CORE_PORT=4000
FUEL_FAUCET_PORT=4040
FUEL_IP=0.0.0.0
6 changes: 4 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ services:
platform: linux/amd64
container_name: '${PROJECT:-fuel-node}_fuel-core'
environment:
FUEL_IP: ${FUEL_IP}
FUEL_CORE_PORT: ${FUEL_CORE_PORT}
NETWORK_NAME: '${PROJECT} local'
MIN_GAS_PRICE: ${MIN_GAS_PRICE}
# This is the private key of the consensus.PoA.signing_key in the chainConfig.json
# this key is responsible for validating the transactions
CONSENSUS_KEY: ${WALLET_SECRET}
CONSENSUS_KEY_SECRET: ${WALLET_SECRET}
build: ./fuel-core
ports:
- '${FUEL_CORE_PORT:-4000}:4000'
Expand All @@ -31,7 +33,7 @@ services:
WALLET_SECRET_KEY: ${WALLET_SECRET}
DISPENSE_AMOUNT: ${DISPENSE_AMOUNT}
FUEL_NODE_URL: http://${PROJECT:-fuel-node}_fuel-core:4000/v1/graphql
image: ghcr.io/fuellabs/faucet:v0.7.2
image: ghcr.io/fuellabs/faucet:4f7bec0
ports:
- '${FUEL_FAUCET_PORT:-4040}:3000'
links:
Expand Down
53 changes: 40 additions & 13 deletions docker/fuel-core/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,45 @@
FROM ghcr.io/fuellabs/fuel-core:v0.26.0
# IMPORTANT!
# Make sure to check:
# https://github.com/FuelLabs/chain-configuration/tree/master/upgradelog/ignition
# and apply the latest state_transition_function and consensus_parameter
# when upgrading fuel-core
FROM ghcr.io/fuellabs/fuel-core:v0.33.0

ENV MIN_GAS_PRICE="${MIN_GAS_PRICE}"
ENV CONSENSUS_KEY="${CONSENSUS_KEY}"
ENV NETWORK_NAME="${NETWORK_NAME}"
# dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y git curl jq && rm -rf /var/lib/apt/lists/*

# Install curl to use on
# healthcheck config
RUN apt update
RUN apt install curl -y
# copy chain config
WORKDIR /fuel

WORKDIR /root/
COPY ./genesis_coins.json .

COPY config ./config
COPY run.sh .
EXPOSE ${PORT}
RUN git clone \
https://github.com/FuelLabs/chain-configuration.git \
/chain-configuration

CMD ["sh", "./run.sh"]
# Copy the base local configuration
RUN cp -R /chain-configuration/local/* ./

# Copy the testnet consensus parameters and state transition bytecode
RUN cp /chain-configuration/upgradelog/ignition-dev/consensus_parameters/6.json \
./latest_consensus_parameters.json
RUN cp /chain-configuration/upgradelog/ignition-dev/state_transition_function/8.wasm \
./state_transition_bytecode.wasm

# update local state_config with custom genesis coins config
RUN jq '.coins = input' \
state_config.json genesis_coins.json > tmp.json \
&& mv tmp.json state_config.json

# update local state_config with testnet consensus parameters
RUN jq '.consensus_parameters = input' \
state_config.json latest_consensus_parameters.json > tmp.json \
&& mv tmp.json state_config.json

# expose fuel node port
EXPOSE ${FUEL_CORE_PORT}

# copy over script and run
COPY ./fuel_core.sh .
CMD ["sh", "./fuel_core.sh"]
Loading

0 comments on commit 7ba78a8

Please sign in to comment.