Skip to content
Closed

Main #532

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .circleci/cargo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2.1
#
jobs:
build-and-test:
docker:
- image: cimg/rust:1.89.0
steps:
- checkout
- restore_cache:
keys:
- v1-cargo-{{ checksum "Cargo.lock" }}
- v1-cargo-
- run:
name: "Check formatting"
command: cargo fmt -- --check
- run:
name: "Run tests"
command: cargo test
- save_cache:
key: v1-cargo-{{ checksum "Cargo.lock" }}
paths:
- "~/.cargo/bin"
- "~/.cargo/registry/index"
- "~/.cargo/registry/cache"
- "~/.cargo/git/db"
- "target"
- run:
name: "Check formatting"
command: cargo fmt -- --check
- run:
name: "Run tests"
command: cargo test
26 changes: 26 additions & 0 deletions .circleci/ci-web3-gamefi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference

version: 2.1
executors:
my-custom-executor:
docker:
- image: cimg/base:stable
auth:
# ensure you have first added these secrets
# visit app.circleci.com/settings/project/github/Dargon789/foundry/environment-variables
username: $DOCKER_HUB_USER
password: $DOCKER_HUB_PASSWORD
jobs:
web3-defi-game-project-:

executor: my-custom-executor
steps:
- checkout
- run: |
# echo Hello, World!

workflows:
my-custom-workflow:
jobs:
- web3-defi-game-project-
31 changes: 31 additions & 0 deletions .circleci/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2.1
jobs:
build-and-test:
docker:
- image: cimg/rust:1.89.0
steps:
- checkout
- restore_cache:
keys:
- v1-cargo-{{ checksum "Cargo.lock" }}
- v1-cargo-
- run:
name: "Check formatting"
command: cargo fmt -- --check
- run:
name: "Run tests"
command: cargo test
- save_cache:
key: v1-cargo-{{ checksum "Cargo.lock" }}
paths:
- "~/.cargo/bin"
- "~/.cargo/registry/index"
- "~/.cargo/registry/cache"
- "~/.cargo/git/db"
- "target"
- run:
name: "Check formatting"
command: cargo fmt -- --check
- run:
name: "Run tests"
command: cargo test
37 changes: 37 additions & 0 deletions .circleci/ci_cargo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: 2.1

jobs:
build-and-test:
docker:
- image: cimg/rust:1.88.0
steps:
- checkout
- restore_cache:
keys:
- v1-cargo-{{ checksum "Cargo.lock" }}
- v1-cargo-
- run:
name: "Check formatting"
command: cargo fmt -- --check
- run:
name: "Run tests"
command: cargo test
- save_cache:
key: v1-cargo-{{ checksum "Cargo.lock" }}
paths:
- "~/.cargo/bin"
- "~/.cargo/registry/index"
- "~/.cargo/registry/cache"
- "~/.cargo/git/db"
- "target"
- run:
name: "Check formatting"
command: cargo fmt -- --check
- run:
name: "Run tests"
command: cargo test

workflows:
ci:
jobs:
- build-and-test
31 changes: 31 additions & 0 deletions .circleci/ci_v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 2.1

jobs:
build-and-test:
docker:
- image: cimg/rust:1.89.0
steps:
- checkout
- restore_cache:
keys:
- v1-cargo-{{ checksum "Cargo.lock" }}
- v1-cargo-
- run:
name: "Check formatting"
command: cargo fmt -- --check
- run:
name: "Run tests"
command: cargo test
- save_cache:
key: v1-cargo-{{ checksum "Cargo.lock" }}
paths:
- "~/.cargo/bin"
- "~/.cargo/registry/index"
- "~/.cargo/registry/cache"
- "~/.cargo/git/db"
- "target"

workflows:
ci:
jobs:
- build-and-test
70 changes: 70 additions & 0 deletions .circleci/dev_stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference

version: 2.1
executors:
my-custom-executor:
docker:
- image: cimg/base:stable
jobs:
web3-defi-game-project-:

executor: my-custom-executor
steps:
- checkout
- run: |
# echo Hello, World!

workflows:
my-custom-workflow:
jobs:
- web3-defi-game-project-

jobs:
my-job:
steps:
- run: echo "Hello, world!"
- run:
command: echo "This step will automatically rerun up to 3 times if it fails with a 10 second delay between attempts"
max_auto_reruns: 3
auto_rerun_delay: 10s

workflows:
dev_stage_pre-prod:
jobs:
- test_dev:
filters: # using regex filters requires the entire branch to match
branches:
only: # only branches matching the below regex filters will run
- dev
- /user-.*/
- test_stage:
filters:
branches:
only: stage
- test_pre-prod:
filters:
branches:
only: /pre-prod(?:-.+)?$/


build-test-deploy:
jobs:
- build:
filters: # required since `test` has tag filters AND requires `build`
tags:
only: /^config-test.*/
- test:
requires:
- build
filters: # required since `deploy` has tag filters AND requires `test`
tags:
only: /^config-test.*/
- deploy:
requires:
- test
filters:
tags:
only: /^config-test.*/
branches:
ignore: /.*/
26 changes: 26 additions & 0 deletions .circleci/web3_defi_gamefi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference

version: 2.1
executors:
my-custom-executor:
docker:
- image: cimg/base:stable
auth:
# ensure you have first added these secrets
# visit app.circleci.com/settings/project/github/Dargon789/foundry/environment-variables
username: $DOCKER_HUB_USER
password: $DOCKER_HUB_PASSWORD
jobs:
web3-defi-game-project-:

executor: my-custom-executor
steps:
- checkout
- run: |
# echo Hello, World!

workflows:
my-custom-workflow:
jobs:
- web3-defi-game-project-
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. Chrome, safari]
- Browser [e.g. Chrome, Safari]
- Version [e.g. 22]
- Browser [e.g. Chrome, Safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
Expand Down
Empty file modified .github/scripts/commit-benchmark-results.sh
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion .github/scripts/compare-nightly.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ for key in all_keys:
if p is None:
print(f"| `{key}` | N/A | {t:.5f}s | — | 🆕 New |")
continue
delta = (t - p) / p * 100
delta = (t - p) / p * 100 if p > 0 else 0
Comment thread
Dargon789 marked this conversation as resolved.
if delta >= fail:
status = "🔴 Regression"
has_regression = True
Expand Down
Empty file modified .github/scripts/read-benchmark-results.sh
100755 → 100644
Empty file.
38 changes: 37 additions & 1 deletion .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ jobs:
mkdir -p "$ARTIFACT_DIR"
ls -la "$ARTIFACT_DIR" || true

- name: Require trusted workflow_run context for artifact consumption
if: ${{ github.event_name != 'workflow_run' }}
run: |
echo "Refusing to consume artifacts outside workflow_run context." >&2
exit 1

- name: Download Release Assets
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
Expand All @@ -151,7 +157,37 @@ jobs:
# Extract artifacts into an isolated temp directory, not the workspace
path: ${{ steps.paths.outputs.artifact_dir }}
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id || inputs.run_id }}
run-id: ${{ github.event.workflow_run.id }}

- name: Validate Downloaded Artifacts
env:
ARTIFACT_DIR: ${{ steps.paths.outputs.artifact_dir }}
run: |
set -euo pipefail

echo "Validating artifacts in: $ARTIFACT_DIR"

if [[ ! -d "$ARTIFACT_DIR" ]]; then
echo "ERROR: Artifact directory does not exist: $ARTIFACT_DIR" >&2
exit 1
fi

if ! find "$ARTIFACT_DIR" -mindepth 1 -print -quit | grep -q .; then
echo "ERROR: Artifact directory is empty: $ARTIFACT_DIR" >&2
exit 1
fi

# Reject files with suspicious paths (absolute paths or parent directory traversals)
# Use null-delimited paths to safely handle filenames with newlines or whitespace
while IFS= read -r -d '' path; do
rel="${path#"$ARTIFACT_DIR"/}"
if [[ "$rel" == /* ]] || [[ "$rel" == *".."* ]]; then
echo "ERROR: Suspicious artifact path detected: $rel" >&2
exit 1
fi
done < <(find "$ARTIFACT_DIR" -type f -print0)

echo "Artifact validation completed successfully."

- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
Expand Down
2 changes: 1 addition & 1 deletion counter/.gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CounterTest:testFuzz_SetNumber(uint256) (runs: 256, μ: 30177, ~: 32354)
CounterTest:testFuzz_SetNumber(uint256) (runs: 256, μ: 30410, ~: 32354)
CounterTest:test_Increment() (gas: 31851)
4 changes: 3 additions & 1 deletion crates/anvil/server/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ pub async fn handle_request<Handler: RpcHandler>(
Request::Single(call) => handle_call(call, handler).await.map(Response::Single),
Request::Batch(calls) => {
if calls.is_empty() {
return Some(Response::error(RpcError::invalid_request()));
return Some(Response::Batch(vec![anvil_rpc::response::RpcResponse::from(
RpcError::invalid_request(),
)]));
}
future::join_all(calls.into_iter().map(move |call| handle_call(call, handler.clone())))
.map(responses_as_batch)
Expand Down
6 changes: 6 additions & 0 deletions crates/doc/src/parser/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ impl Comments {
}
}

impl From<Vec<Comment>> for Comments {
fn from(value: Vec<Comment>) -> Self {
Self(value)
}
}

/// The collection of references to natspec [Comment] items.
#[derive(Debug, Default, PartialEq, Eq, Deref)]
pub struct CommentsRef<'a>(Vec<&'a Comment>);
Expand Down
1 change: 1 addition & 0 deletions crates/forge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ alloy-primitives = { workspace = true, features = ["serde"] }
alloy-provider = { workspace = true, features = ["reqwest", "ws", "ipc"] }
alloy-signer.workspace = true
alloy-transport.workspace = true
alloy-hardforks.workspace = true

tempo-alloy.workspace = true

Expand Down
2 changes: 1 addition & 1 deletion crates/forge/src/cmd/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ fn merge_outcomes(base: &mut TestOutcome, other: TestOutcome) {
let base_suite = e.get_mut();
base_suite.test_results.extend(other_suite.test_results);
base_suite.warnings.extend(other_suite.warnings);
base_suite.duration = base_suite.duration.max(other_suite.duration);
base_suite.duration += other_suite.duration;
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions crates/script/src/simulate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,9 @@ impl<FEN: FoundryEvmNetwork> FilledTransactionsState<FEN> {

// Get the native token symbol for the chain using NamedChain
let token_symbol = NamedChain::try_from(provider_info.chain)
.unwrap_or_default()
let token_symbol = alloy_chains::Chain::from_id(provider_info.chain)
Comment thread
Dargon789 marked this conversation as resolved.
.native_currency_symbol()
.unwrap_or("ETH");

// We don't store it in the transactions, since we want the most updated value.
// Right before broadcasting.
let per_gas = if let Some(gas_price) = self.args.with_gas_price {
Expand Down
Loading
Loading