From 06e8a3a87354cea8cbeef580b2c932d3285a721c Mon Sep 17 00:00:00 2001 From: DarshanAgarwal09 Date: Tue, 2 Jan 2024 19:21:18 +0530 Subject: [PATCH 1/2] added basic rust lint and build check --- .github/workflows/basic_checks.yml | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/basic_checks.yml diff --git a/.github/workflows/basic_checks.yml b/.github/workflows/basic_checks.yml new file mode 100644 index 0000000..1b397f2 --- /dev/null +++ b/.github/workflows/basic_checks.yml @@ -0,0 +1,39 @@ +name: 'basic_checks' +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + check: + name: Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: check + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - run: rustup component add rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check \ No newline at end of file From c7024c6735b2cdd1b1a25f907170957bc578cd89 Mon Sep 17 00:00:00 2001 From: DarshanAgarwal09 Date: Tue, 2 Jan 2024 19:26:11 +0530 Subject: [PATCH 2/2] add linting error fix --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0c068fc..cd542f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -375,7 +375,8 @@ async fn handle_websocket_messages( U256::from_str_hex(pubkey.as_str()).unwrap(), ask_tree.clone(), ) - .await { + .await + { Some(result) => Some(result), None => None, }; @@ -729,7 +730,12 @@ async fn main() -> Result<()> { let curr_addr = warp::any().map(move || current_address.clone()); pretty_env_logger::init(); - let latest_block_number = client.get_block(BlockNumber::Latest).await?.unwrap().number.unwrap(); + let latest_block_number = client + .get_block(BlockNumber::Latest) + .await? + .unwrap() + .number + .unwrap(); let placed_order_event = Contract::event_of_type::(client.clone()) .from_block(latest_block_number)