Skip to content

Commit 914d81d

Browse files
authored
Merge pull request #3101 from OffchainLabs/cargo_fmt
Add cargo fmt check for rust
2 parents 7e5c0bb + f890324 commit 914d81d

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

.github/workflows/arbitrator-ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ jobs:
170170
- name: Check stylus_bechmark
171171
run: cargo check --manifest-path arbitrator/tools/stylus_benchmark/Cargo.toml
172172

173+
- name: Rustfmt
174+
run: cargo fmt -p arbutil -p prover -p jit -p stylus --manifest-path arbitrator/Cargo.toml -- --check
175+
176+
- name: Rustfmt - tools/stylus_benchmark
177+
run: cargo fmt --all --manifest-path arbitrator/tools/stylus_benchmark/Cargo.toml -- --check
178+
173179
- name: Make proofs from test cases
174180
run: make -j test-gen-proofs
175181

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,8 @@ contracts/test/prover/proofs/%.json: $(arbitrator_cases)/%.wasm $(prover_bin)
574574

575575
.make/fmt: $(DEP_PREDICATE) build-node-deps .make/yarndeps $(ORDER_ONLY_PREDICATE) .make
576576
golangci-lint run --disable-all -E gofmt --fix
577+
cargo fmt -p arbutil -p prover -p jit -p stylus --manifest-path arbitrator/Cargo.toml -- --check
578+
cargo fmt --all --manifest-path arbitrator/wasm-testsuite/Cargo.toml -- --check
577579
yarn --cwd contracts prettier:solidity
578580
@touch $@
579581

arbitrator/arbutil/src/evm/req.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ impl<D: DataReader, H: RequestHandler<D>> EvmApi<D> for EvmApiRequestor<D, H> {
276276
req.extend(gas_left.to_be_bytes());
277277

278278
let (_, data, cost) = self.request(EvmApiMethod::AccountCode, req);
279-
if !data.slice().is_empty() || arbos_version < super::ARBOS_VERSION_STYLUS_LAST_CODE_CACHE_FIX {
279+
if !data.slice().is_empty()
280+
|| arbos_version < super::ARBOS_VERSION_STYLUS_LAST_CODE_CACHE_FIX
281+
{
280282
self.last_code = Some((address, data.clone()));
281283
}
282284
(data, cost)

arbitrator/stylus/src/test/api.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,12 @@ impl EvmApi<VecReader> for TestEvmApi {
180180
unimplemented!()
181181
}
182182

183-
fn account_code(&mut self, _arbos_version: u64, _address: Bytes20, _gas_left: Gas) -> (VecReader, Gas) {
183+
fn account_code(
184+
&mut self,
185+
_arbos_version: u64,
186+
_address: Bytes20,
187+
_gas_left: Gas,
188+
) -> (VecReader, Gas) {
184189
unimplemented!()
185190
}
186191

0 commit comments

Comments
 (0)