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 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)