Skip to content

Commit 78d22fe

Browse files
committed
initial commit
0 parents  commit 78d22fe

23 files changed

+1077
-0
lines changed

Diff for: .config/nextest.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[profile.default]
2+
retries = { backoff = "exponential", count = 2, delay = "2s", jitter = true }
3+
slow-timeout = { period = "30s", terminate-after = 4 }

Diff for: .github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @danipopes @gakonst @mattsse @onbjerg @prestwich @evalir

Diff for: .github/ISSUE_TEMPLATE/BUG-FORM.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Bug report
2+
description: File a bug report
3+
labels: ["bug"]
4+
title: "[Bug] "
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please ensure that the bug has not already been filed in the issue tracker.
10+
11+
Thanks for taking the time to report this bug!
12+
- type: dropdown
13+
attributes:
14+
label: Component
15+
description: What component is the bug in?
16+
multiple: true
17+
options:
18+
- contract
19+
- consensus, eips, genesis
20+
- network, json-rpc
21+
- nodes
22+
- provider, pubsub
23+
- rpc
24+
- signers
25+
- transports
26+
validations:
27+
required: true
28+
- type: input
29+
attributes:
30+
label: What version of Alloy are you on?
31+
placeholder: "Run `cargo tree | grep alloy` and paste the output here"
32+
- type: dropdown
33+
attributes:
34+
label: Operating System
35+
description: What operating system are you on?
36+
options:
37+
- Windows
38+
- macOS (Intel)
39+
- macOS (Apple Silicon)
40+
- Linux
41+
- Other (please specify)
42+
- type: textarea
43+
attributes:
44+
label: Describe the bug
45+
description: Please include code snippets as well if relevant.
46+
validations:
47+
required: true

Diff for: .github/ISSUE_TEMPLATE/FEATURE-FORM.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Feature request
2+
description: Suggest a feature
3+
labels: ["enhancement"]
4+
title: "[Feature] "
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Please ensure that the feature has not already been requested in the issue tracker.
10+
- type: dropdown
11+
attributes:
12+
label: Component
13+
description: What component is the feature for?
14+
multiple: true
15+
options:
16+
- contract
17+
- consensus, eips, genesis
18+
- network, json-rpc
19+
- nodes
20+
- provider, pubsub
21+
- rpc
22+
- signers
23+
- transports
24+
validations:
25+
required: true
26+
- type: textarea
27+
attributes:
28+
label: Describe the feature you would like
29+
description:
30+
Please also describe your goals for the feature. What problems it solves, how it would be
31+
used, etc.
32+
validations:
33+
required: true
34+
- type: textarea
35+
attributes:
36+
label: Additional context
37+
description: Add any other context to the feature (like screenshots, resources)

Diff for: .github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Support
4+
url: https://t.me/ethers_rs
5+
about: This issue tracker is only for bugs and feature requests. Support is available on Telegram!

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--
2+
Thank you for your Pull Request. Please provide a description above and review
3+
the requirements below.
4+
5+
Bug fixes and new features should include tests.
6+
7+
Contributors guide: https://github.com/alloy-rs/core/blob/main/CONTRIBUTING.md
8+
9+
The contributors guide includes instructions for running rustfmt and building the
10+
documentation.
11+
-->
12+
13+
<!-- ** Please select "Allow edits from maintainers" in the PR Options ** -->
14+
15+
## Motivation
16+
17+
<!--
18+
Explain the context and why you're making that change. What is the problem
19+
you're trying to solve? In some cases there is not a problem and this can be
20+
thought of as being the motivation for your change.
21+
-->
22+
23+
## Solution
24+
25+
<!--
26+
Summarize the solution and provide any necessary context needed to understand
27+
the code change.
28+
-->
29+
30+
## PR Checklist
31+
32+
- [ ] Added Tests
33+
- [ ] Added Documentation
34+
- [ ] Breaking changes

Diff for: .github/scripts/install_test_binaries.sh

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env bash
2+
# Installs Solc and Geth binaries
3+
# Note: intended for use only with CI (x86_64 Ubuntu, MacOS or Windows)
4+
set -e
5+
6+
GETH_BUILD=${GETH_BUILD:-"1.11.2-73b01f40"}
7+
8+
BIN_DIR=${BIN_DIR:-"$HOME/bin"}
9+
10+
PLATFORM="$(uname -s | awk '{print tolower($0)}')"
11+
if [ "$PLATFORM" != "linux" ] && [ "$PLATFORM" != "darwin" ]; then
12+
EXT=".exe"
13+
fi
14+
15+
main() {
16+
mkdir -p "$BIN_DIR"
17+
cd "$BIN_DIR"
18+
export PATH="$BIN_DIR:$PATH"
19+
if [ "$GITHUB_PATH" ]; then
20+
echo "$BIN_DIR" >> "$GITHUB_PATH"
21+
fi
22+
23+
install_geth
24+
25+
echo ""
26+
echo "Installed Geth:"
27+
geth version
28+
}
29+
30+
# Installs geth from https://geth.ethereum.org/downloads
31+
install_geth() {
32+
case "$PLATFORM" in
33+
linux|darwin)
34+
name="geth-$PLATFORM-amd64-$GETH_BUILD"
35+
curl -s "https://gethstore.blob.core.windows.net/builds/$name.tar.gz" | tar -xzf -
36+
mv -f "$name/geth" ./
37+
rm -rf "$name"
38+
chmod +x geth
39+
;;
40+
*)
41+
name="geth-windows-amd64-$GETH_BUILD"
42+
zip="$name.zip"
43+
curl -so "$zip" "https://gethstore.blob.core.windows.net/builds/$zip"
44+
unzip "$zip"
45+
mv -f "$name/geth.exe" ./
46+
rm -rf "$name" "$zip"
47+
;;
48+
esac
49+
}
50+
51+
main

Diff for: .github/workflows/ci.yml

+154
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
test:
17+
name: test ${{ matrix.rust }} ${{ matrix.flags }}
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
rust: ["stable", "nightly", "1.76"] # MSRV
24+
flags: ["--no-default-features", "", "--all-features"]
25+
exclude:
26+
# Some features have higher MSRV.
27+
- rust: "1.76" # MSRV
28+
flags: "--all-features"
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: dtolnay/rust-toolchain@master
32+
with:
33+
toolchain: ${{ matrix.rust }}
34+
- name: Install Anvil
35+
uses: foundry-rs/foundry-toolchain@v1
36+
with:
37+
version: nightly
38+
- name: Install test binaries
39+
shell: bash
40+
run: ./.github/scripts/install_test_binaries.sh
41+
- uses: Swatinem/rust-cache@v2
42+
with:
43+
cache-on-failure: true
44+
# Only run tests on latest stable and above
45+
- name: Install cargo-nextest
46+
if: ${{ matrix.rust != '1.76' }} # MSRV
47+
uses: taiki-e/install-action@nextest
48+
- name: build
49+
if: ${{ matrix.rust == '1.76' }} # MSRV
50+
run: cargo build --workspace ${{ matrix.flags }}
51+
- name: test
52+
if: ${{ matrix.rust != '1.76' }} # MSRV
53+
run: cargo nextest run --workspace ${{ matrix.flags }}
54+
55+
doctest:
56+
runs-on: ubuntu-latest
57+
timeout-minutes: 30
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: dtolnay/rust-toolchain@stable
61+
- uses: Swatinem/rust-cache@v2
62+
with:
63+
cache-on-failure: true
64+
- run: cargo test --workspace --doc
65+
- run: cargo test --all-features --workspace --doc
66+
67+
no-std:
68+
runs-on: ubuntu-latest
69+
timeout-minutes: 30
70+
steps:
71+
- uses: actions/checkout@v3
72+
- uses: dtolnay/rust-toolchain@stable
73+
with:
74+
target: riscv32imac-unknown-none-elf
75+
- uses: taiki-e/install-action@cargo-hack
76+
- uses: Swatinem/rust-cache@v2
77+
with:
78+
cache-on-failure: true
79+
- name: check
80+
run: ./scripts/check_no_std.sh
81+
82+
feature-checks:
83+
runs-on: ubuntu-latest
84+
timeout-minutes: 30
85+
steps:
86+
- uses: actions/checkout@v3
87+
- uses: dtolnay/rust-toolchain@stable
88+
- uses: taiki-e/install-action@cargo-hack
89+
- uses: Swatinem/rust-cache@v2
90+
with:
91+
cache-on-failure: true
92+
- name: cargo hack
93+
run: cargo hack check --feature-powerset --depth 1
94+
95+
clippy:
96+
runs-on: ubuntu-latest
97+
timeout-minutes: 30
98+
steps:
99+
- uses: actions/checkout@v4
100+
- uses: dtolnay/rust-toolchain@master
101+
with:
102+
toolchain: stable
103+
components: clippy
104+
- uses: Swatinem/rust-cache@v2
105+
with:
106+
cache-on-failure: true
107+
- run: cargo +stable clippy --workspace --all-targets --all-features
108+
env:
109+
RUSTFLAGS: -Dwarnings
110+
111+
docs:
112+
runs-on: ubuntu-latest
113+
timeout-minutes: 30
114+
steps:
115+
- uses: actions/checkout@v3
116+
- uses: dtolnay/rust-toolchain@nightly
117+
- uses: Swatinem/rust-cache@v2
118+
with:
119+
cache-on-failure: true
120+
- run: cargo doc --workspace --all-features --no-deps --document-private-items
121+
env:
122+
RUSTDOCFLAGS:
123+
--cfg docsrs -D warnings --show-type-layout --generate-link-to-definition
124+
--enable-index-page -Zunstable-options
125+
- name: Deploy documentation
126+
uses: peaceiris/actions-gh-pages@v3
127+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
128+
with:
129+
github_token: ${{ secrets.GITHUB_TOKEN }}
130+
publish_dir: target/doc
131+
force_orphan: true
132+
133+
fmt:
134+
runs-on: ubuntu-latest
135+
timeout-minutes: 30
136+
steps:
137+
- uses: actions/checkout@v3
138+
- uses: dtolnay/rust-toolchain@nightly
139+
with:
140+
components: rustfmt
141+
- run: cargo fmt --all --check
142+
143+
cfg-check:
144+
runs-on: ubuntu-latest
145+
timeout-minutes: 30
146+
steps:
147+
- uses: actions/checkout@v3
148+
- uses: dtolnay/rust-toolchain@nightly
149+
with:
150+
toolchain: nightly
151+
- uses: Swatinem/rust-cache@v2
152+
with:
153+
cache-on-failure: true
154+
- run: cargo check -Zcheck-cfg --workspace

Diff for: .github/workflows/deps.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: deps
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule: [cron: "00 00 * * *"]
9+
10+
jobs:
11+
cargo-deny:
12+
name: cargo deny check
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: EmbarkStudios/cargo-deny-action@v1
17+
with:
18+
command: check all

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/target
2+
/Cargo.lock
3+
.vscode
4+
.idea
5+
.env
6+
.DS_Store

0 commit comments

Comments
 (0)