Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added basic rust lint and build workflow check #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions .github/workflows/basic_checks.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 8 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use chrono::prelude::*;
use ethers::core::types::Filter as EthersFilter;
use ethers::core::types::H160;
use ethers::core::types::H256;

Check warning on line 4 in src/main.rs

View workflow job for this annotation

GitHub Actions / Check

unused import: `ethers::core::types::H256`
use ethers::core::types::U256 as EthersU256;

Check warning on line 5 in src/main.rs

View workflow job for this annotation

GitHub Actions / Check

unused import: `ethers::core::types::U256 as EthersU256`
use ethers::prelude::*;
use ethers::signers::LocalWallet;
use ethers::{
core::{
abi::AbiDecode,

Check warning on line 10 in src/main.rs

View workflow job for this annotation

GitHub Actions / Check

unused imports: `Address`, `abi::AbiDecode`
types::{Address, BlockNumber, ValueOrArray},
},
providers::{Middleware, Provider},
Expand All @@ -33,7 +33,7 @@
use std::time::UNIX_EPOCH;
use tokio::sync::mpsc;
use tokio::sync::RwLock;
use tokio::time::Duration;

Check warning on line 36 in src/main.rs

View workflow job for this annotation

GitHub Actions / Check

unused import: `tokio::time::Duration`
use unyfy_matching_engine::matching::*;
use unyfy_matching_engine::models::Orderbook;
use unyfy_matching_engine::models::RBTree;
Expand Down Expand Up @@ -375,7 +375,8 @@
U256::from_str_hex(pubkey.as_str()).unwrap(),
ask_tree.clone(),
)
.await {
.await
{
Some(result) => Some(result),
None => None,
};
Expand Down Expand Up @@ -729,7 +730,12 @@
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::<OrderPlacedFilter>(client.clone())
.from_block(latest_block_number)
Expand Down
Loading