diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31247dc..b6fedc9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,5 +24,7 @@ jobs: run: make build-wasm-pkg - name: Build lib run: make build-grpc-pkg + - name: Build core + run: make build-core-pkg - name: Run tests run: cargo test --verbose --workspace diff --git a/ain-core/build.rs b/ain-core/build.rs index 23c5bd1..675a855 100644 --- a/ain-core/build.rs +++ b/ain-core/build.rs @@ -13,7 +13,10 @@ fn main() { let target_dir = &root.join("target"); let mut content = String::new(); - File::open(lib_path).unwrap().read_to_string(&mut content).unwrap(); + File::open(lib_path) + .unwrap() + .read_to_string(&mut content) + .unwrap(); let tt: TokenStream = content.parse().unwrap(); let codegen = cxx_gen::generate_header_and_cc(tt, &cxx_gen::Opt::default()).unwrap(); diff --git a/ain-core/src/lib.rs b/ain-core/src/lib.rs index 669b5b2..19fbb96 100644 --- a/ain-core/src/lib.rs +++ b/ain-core/src/lib.rs @@ -15,7 +15,11 @@ mod calc { fn calc_dex_fee(algo_dusd: f64, dusd_supply: f64) -> f64; - fn calc_loan_interest_rate(reserve_dfi: f64, reserve_dusd: f64, dfi_oracle_price: f64) -> f64; + fn calc_loan_interest_rate( + reserve_dfi: f64, + reserve_dusd: f64, + dfi_oracle_price: f64, + ) -> f64; } } diff --git a/ain-grpc/src/codegen.rs b/ain-grpc/src/codegen.rs index 2fd6a0e..46ed3f6 100644 --- a/ain-grpc/src/codegen.rs +++ b/ain-grpc/src/codegen.rs @@ -4,6 +4,7 @@ pub mod types { tonic::include_proto!("types"); } +#[allow(clippy::useless_conversion)] pub mod rpc { tonic::include_proto!("rpc"); } @@ -13,7 +14,7 @@ impl Serialize for types::BlockResult { where S: serde::Serializer, { - if self.hash != "" { + if self.hash.is_empty() { return serializer.serialize_str(&self.hash); } @@ -30,7 +31,7 @@ impl Serialize for types::Transaction { where S: serde::Serializer, { - if self.hash != "" { + if self.hash.is_empty() { return serializer.serialize_str(&self.hash); } diff --git a/ain-grpc/src/lib.rs b/ain-grpc/src/lib.rs index 78ccc65..0a9449a 100644 --- a/ain-grpc/src/lib.rs +++ b/ain-grpc/src/lib.rs @@ -120,6 +120,7 @@ fn start_servers( Ok(runtime) } +#[allow(clippy::boxed_local)] fn stop_servers(mut runtime: Box) -> Result<(), Box> { log::info!("Stopping gRPC and JSON RPC servers"); runtime.stop();