From b4850f110283e42e1a56487133c5250c9f7c4333 Mon Sep 17 00:00:00 2001 From: Willem Olding Date: Tue, 9 Apr 2024 20:02:05 +1000 Subject: [PATCH 01/10] add rust gh actions --- .github/workflows/rust.yml | 57 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..56057fd --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,57 @@ +name: Rust + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: + - main +env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout Source + uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Setup protoc + uses: arduino/setup-protoc@v1.1.2 + - uses: actions-rs/cargo@v1 + with: + command: check + args: --all + lints: + name: clippy and fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + components: clippy,rustfmt + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + continue-on-error: false + with: + command: fmt + args: --all -- --check + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings From 6795c2695f5927f81c1dc536502b3e838fa6b32e Mon Sep 17 00:00:00 2001 From: Willem Olding Date: Tue, 9 Apr 2024 20:03:07 +1000 Subject: [PATCH 02/10] switch to gh zebra crates --- Cargo.lock | 8 ++++++++ Cargo.toml | 17 +++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 375648e..c757de6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4891,6 +4891,7 @@ dependencies = [ [[package]] name = "tower-batch-control" version = "0.2.41-beta.11" +source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" dependencies = [ "futures", "futures-core", @@ -4924,6 +4925,7 @@ dependencies = [ [[package]] name = "tower-fallback" version = "0.2.41-beta.11" +source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" dependencies = [ "futures-core", "pin-project", @@ -5851,6 +5853,7 @@ dependencies = [ [[package]] name = "zebra-chain" version = "1.0.0-beta.35" +source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" dependencies = [ "bitflags 2.5.0", "bitflags-serde-legacy", @@ -5908,6 +5911,7 @@ dependencies = [ [[package]] name = "zebra-consensus" version = "1.0.0-beta.35" +source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" dependencies = [ "bellman", "blake2b_simd", @@ -5943,6 +5947,7 @@ dependencies = [ [[package]] name = "zebra-node-services" version = "1.0.0-beta.35" +source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" dependencies = [ "zebra-chain", ] @@ -5950,6 +5955,7 @@ dependencies = [ [[package]] name = "zebra-script" version = "1.0.0-beta.35" +source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" dependencies = [ "displaydoc", "thiserror", @@ -5960,6 +5966,7 @@ dependencies = [ [[package]] name = "zebra-state" version = "1.0.0-beta.35" +source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" dependencies = [ "bincode", "chrono", @@ -5993,6 +6000,7 @@ dependencies = [ [[package]] name = "zebra-test" version = "1.0.0-beta.35" +source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" dependencies = [ "color-eyre", "futures", diff --git a/Cargo.toml b/Cargo.toml index 5ade780..65b3c9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,15 +49,16 @@ members = [ "cartezcash-lightwalletd", "tiny-cash", "tower-cartesi"] [workspace.dependencies] # patched zebra crates to support TinyCash network and expose things we need -# zebra-consensus = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa146fc702878ca84f63fe5c32898ffbdfcc", default-features = false } -# zebra-state = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa146fc702878ca84f63fe5c32898ffbdfcc", default-features = false } -# zebra-test = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa146fc702878ca84f63fe5c32898ffbdfcc", default-features = false } -# zebra-chain = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa146fc702878ca84f63fe5c32898ffbdfcc", default-features = false } +zebra-consensus = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa14", default-features = false } +zebra-state = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa14", default-features = false } +zebra-test = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa14", default-features = false } +zebra-chain = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa14", default-features = false } -zebra-consensus = { path = "../zebra/zebra-consensus", default-features = false } -zebra-state = { path = "../zebra/zebra-state", default-features = false } -zebra-test = { path = "../zebra/zebra-test", default-features = false } -zebra-chain = { path = "../zebra/zebra-chain", default-features = false } +# uncomment for local dev when modifying zebra +# zebra-consensus = { path = "../zebra/zebra-consensus", default-features = false } +# zebra-state = { path = "../zebra/zebra-state", default-features = false } +# zebra-test = { path = "../zebra/zebra-test", default-features = false } +# zebra-chain = { path = "../zebra/zebra-chain", default-features = false } [patch.crates-io] From 6560be976f14066c6a2b1b6467fa237080527367 Mon Sep 17 00:00:00 2001 From: Willem Olding Date: Tue, 9 Apr 2024 20:03:22 +1000 Subject: [PATCH 03/10] global format --- cartezcash-lightwalletd/src/service_impl.rs | 10 +++++---- src/main.rs | 23 ++++++++++----------- src/service/request.rs | 22 ++++++-------------- tiny-cash/src/write.rs | 11 +++++----- tower-cartesi/examples/echo.rs | 22 +++++++++----------- tower-cartesi/src/response.rs | 5 ++++- 6 files changed, 42 insertions(+), 51 deletions(-) diff --git a/cartezcash-lightwalletd/src/service_impl.rs b/cartezcash-lightwalletd/src/service_impl.rs index 1cd39af..6755acb 100644 --- a/cartezcash-lightwalletd/src/service_impl.rs +++ b/cartezcash-lightwalletd/src/service_impl.rs @@ -14,11 +14,11 @@ use crate::proto::compact_formats::*; use crate::proto::service::compact_tx_streamer_server::CompactTxStreamer; use crate::proto::service::*; +use ethers::middleware::SignerMiddleware; use ethers::prelude::abigen; use ethers::providers::{Http, Provider}; use ethers::signers::{LocalWallet, Signer}; use ethers::types::{Address, Bytes}; -use ethers::middleware::SignerMiddleware; abigen!( IInputBox, @@ -57,13 +57,15 @@ where ) -> std::result::Result, tonic::Status> { tracing::info!("send_transaction called. Fowarding to InputBox contract"); - let provider = - Provider::::try_from("http://127.0.0.1:8545").unwrap(); + let provider = Provider::::try_from("http://127.0.0.1:8545").unwrap(); let wallet: LocalWallet = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" .parse() .unwrap(); - let client = std::sync::Arc::new(SignerMiddleware::new(provider, wallet.with_chain_id(31337_u64))); + let client = std::sync::Arc::new(SignerMiddleware::new( + provider, + wallet.with_chain_id(31337_u64), + )); // Instantiate the contract let contract = IInputBox::new( diff --git a/src/main.rs b/src/main.rs index 0de4645..7f47d78 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,7 +43,12 @@ async fn main() -> Result<(), anyhow::Error> { let network = Network::Mainnet; - println!("Withdraw address is: {}", UnifiedAddress::from_receivers(Some(tiny_cash::mt_doom_address()), None).unwrap().encode(&MAIN_NETWORK)); + println!( + "Withdraw address is: {}", + UnifiedAddress::from_receivers(Some(tiny_cash::mt_doom_address()), None) + .unwrap() + .encode(&MAIN_NETWORK) + ); // TODO: Enable this when not debugging // tracing::info!("Initializing Halo2 verifier key"); @@ -59,8 +64,7 @@ async fn main() -> Result<(), anyhow::Error> { let state_service = Buffer::new(state_service, 30); let state_read_service = Buffer::new(state_read_service.boxed(), 30); - let mut cartezcash_app = - CarteZcashApp::new(network, state_service).await; + let mut cartezcash_app = CarteZcashApp::new(network, state_service).await; let svc = CompactTxStreamerServer::new(CompactTxStreamerImpl { state_read_service }); let addr = grpc_addr.parse()?; @@ -79,14 +83,12 @@ async fn main() -> Result<(), anyhow::Error> { } struct CarteZcashApp { - cartezcash: Buffer>, Request>, + cartezcash: + Buffer>, Request>, } impl CarteZcashApp { - pub async fn new( - network: Network, - state_service: StateService, - ) -> Self { + pub async fn new(network: Network, state_service: StateService) -> Self { // set up the services needed to run the rollup let verifier_service = tx::Verifier::new(network, state_service.clone()); let mut tinycash = Buffer::new( @@ -100,10 +102,7 @@ impl CarteZcashApp { initialize_network(&mut tinycash).await.unwrap(); Self { - cartezcash: Buffer::new( - BoxService::new(CarteZcashService::new(tinycash)), - 10, - ), + cartezcash: Buffer::new(BoxService::new(CarteZcashService::new(tinycash)), 10), } } } diff --git a/src/service/request.rs b/src/service/request.rs index 9c54202..6392efd 100644 --- a/src/service/request.rs +++ b/src/service/request.rs @@ -66,16 +66,12 @@ impl TryFrom<(tower_cartesi::AdvanceStateMetadata, Vec)> for Request { transaction bytes // arbitrary size */ - let txn = zebra_chain::transaction::Transaction::zcash_deserialize(payload.as_slice())?; + let txn = + zebra_chain::transaction::Transaction::zcash_deserialize(payload.as_slice())?; - tracing::info!( - "Received transaction request {}", - txn.hash() - ); + tracing::info!("Received transaction request {}", txn.hash()); - Ok(Request::Transact { - txn, - }) + Ok(Request::Transact { txn }) } _ => anyhow::bail!("unrecognised sender {}", metadata.msg_sender.to_string()), } @@ -88,14 +84,8 @@ impl std::fmt::Debug for Request { Request::Deposit { amount, to } => { write!(f, "Deposit {} to {}", amount, to) } - Request::Transact { - txn, - } => { - write!( - f, - "Transact hash {}", - txn.hash(), - ) + Request::Transact { txn } => { + write!(f, "Transact hash {}", txn.hash(),) } } } diff --git a/tiny-cash/src/write.rs b/tiny-cash/src/write.rs index 89e35a8..2ef8b7c 100644 --- a/tiny-cash/src/write.rs +++ b/tiny-cash/src/write.rs @@ -8,7 +8,6 @@ use std::{ }; use tower::{Service, ServiceExt}; -use zebra_chain::{transaction::{Memo, Transaction}, transparent::Script}; use zebra_chain::transparent; use zebra_chain::{ amount::{Amount, NonNegative}, @@ -18,6 +17,10 @@ use zebra_chain::{ work::{difficulty::CompactDifficulty, equihash::Solution}, }; use zebra_chain::{block, serialization::ZcashDeserialize}; +use zebra_chain::{ + transaction::{Memo, Transaction}, + transparent::Script, +}; use zebra_consensus::transaction as tx; use crate::extract_burn_info; @@ -253,9 +256,5 @@ fn mint_coinbase_txn( } fn empty_coinbase_txn(height: Height) -> Transaction { - mint_coinbase_txn( - Amount::zero(), - &Script::new(&[0x0; 32]), - height, - ) + mint_coinbase_txn(Amount::zero(), &Script::new(&[0x0; 32]), height) } diff --git a/tower-cartesi/examples/echo.rs b/tower-cartesi/examples/echo.rs index 9872243..0eedafa 100644 --- a/tower-cartesi/examples/echo.rs +++ b/tower-cartesi/examples/echo.rs @@ -1,12 +1,12 @@ +use futures_util::FutureExt; use std::env; -use std::future::Future; use std::error::Error; +use std::future::Future; use std::pin::Pin; -use std::task::{Poll, Context}; -use futures_util::FutureExt; +use std::task::{Context, Poll}; -use tower_service::Service; use tower_cartesi::{listen_http, Request, Response}; +use tower_service::Service; type BoxError = Box; @@ -35,24 +35,22 @@ impl Service for EchoApp { type Error = Box; type Future = Pin> + Send>>; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: Request) -> Self::Future { match req { Request::AdvanceState { metadata, payload } => { - println!("Received advance state request {:?} \npayload {:?}:", metadata, payload); + println!( + "Received advance state request {:?} \npayload {:?}:", + metadata, payload + ); } Request::InspectState { payload } => { println!("Received inspect state request {:?}", payload); } } - async { - Ok(tower_cartesi::Response::empty_accept()) - }.boxed() + async { Ok(tower_cartesi::Response::empty_accept()) }.boxed() } } diff --git a/tower-cartesi/src/response.rs b/tower-cartesi/src/response.rs index 165f9b6..bb8f57c 100644 --- a/tower-cartesi/src/response.rs +++ b/tower-cartesi/src/response.rs @@ -17,7 +17,10 @@ impl Response { } pub fn add_voucher(&mut self, destination: ethereum_types::Address, payload: &[u8]) { - self.outputs.push(Output::Voucher{destination, payload: payload.to_vec() }); + self.outputs.push(Output::Voucher { + destination, + payload: payload.to_vec(), + }); } pub fn finish_message(&self) -> Finish { From b65978bc30dd3bec795e4c05950763c874deefe3 Mon Sep 17 00:00:00 2001 From: Willem Olding Date: Tue, 9 Apr 2024 20:04:46 +1000 Subject: [PATCH 04/10] use correct zebra ref --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 65b3c9e..7de7ad9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,10 +49,10 @@ members = [ "cartezcash-lightwalletd", "tiny-cash", "tower-cartesi"] [workspace.dependencies] # patched zebra crates to support TinyCash network and expose things we need -zebra-consensus = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa14", default-features = false } -zebra-state = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa14", default-features = false } -zebra-test = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa14", default-features = false } -zebra-chain = { git = "https://github.com/willemolding/zebra", rev = "a8d1aa14", default-features = false } +zebra-consensus = { git = "https://github.com/willemolding/zebra", rev = "185e404bed938e3aa916aee1ae6999a70efceddb", default-features = false } +zebra-state = { git = "https://github.com/willemolding/zebra", rev = "185e404bed938e3aa916aee1ae6999a70efceddb", default-features = false } +zebra-test = { git = "https://github.com/willemolding/zebra", rev = "185e404bed938e3aa916aee1ae6999a70efceddb", default-features = false } +zebra-chain = { git = "https://github.com/willemolding/zebra", rev = "185e404bed938e3aa916aee1ae6999a70efceddb", default-features = false } # uncomment for local dev when modifying zebra # zebra-consensus = { path = "../zebra/zebra-consensus", default-features = false } From 765ad543534caafb61eac7504db14a6418c67a6f Mon Sep 17 00:00:00 2001 From: Willem Olding Date: Tue, 9 Apr 2024 20:05:01 +1000 Subject: [PATCH 05/10] update lock --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c757de6..ac51390 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4891,7 +4891,7 @@ dependencies = [ [[package]] name = "tower-batch-control" version = "0.2.41-beta.11" -source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" +source = "git+https://github.com/willemolding/zebra?rev=185e404bed938e3aa916aee1ae6999a70efceddb#185e404bed938e3aa916aee1ae6999a70efceddb" dependencies = [ "futures", "futures-core", @@ -4925,7 +4925,7 @@ dependencies = [ [[package]] name = "tower-fallback" version = "0.2.41-beta.11" -source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" +source = "git+https://github.com/willemolding/zebra?rev=185e404bed938e3aa916aee1ae6999a70efceddb#185e404bed938e3aa916aee1ae6999a70efceddb" dependencies = [ "futures-core", "pin-project", @@ -5853,7 +5853,7 @@ dependencies = [ [[package]] name = "zebra-chain" version = "1.0.0-beta.35" -source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" +source = "git+https://github.com/willemolding/zebra?rev=185e404bed938e3aa916aee1ae6999a70efceddb#185e404bed938e3aa916aee1ae6999a70efceddb" dependencies = [ "bitflags 2.5.0", "bitflags-serde-legacy", @@ -5911,7 +5911,7 @@ dependencies = [ [[package]] name = "zebra-consensus" version = "1.0.0-beta.35" -source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" +source = "git+https://github.com/willemolding/zebra?rev=185e404bed938e3aa916aee1ae6999a70efceddb#185e404bed938e3aa916aee1ae6999a70efceddb" dependencies = [ "bellman", "blake2b_simd", @@ -5947,7 +5947,7 @@ dependencies = [ [[package]] name = "zebra-node-services" version = "1.0.0-beta.35" -source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" +source = "git+https://github.com/willemolding/zebra?rev=185e404bed938e3aa916aee1ae6999a70efceddb#185e404bed938e3aa916aee1ae6999a70efceddb" dependencies = [ "zebra-chain", ] @@ -5955,7 +5955,7 @@ dependencies = [ [[package]] name = "zebra-script" version = "1.0.0-beta.35" -source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" +source = "git+https://github.com/willemolding/zebra?rev=185e404bed938e3aa916aee1ae6999a70efceddb#185e404bed938e3aa916aee1ae6999a70efceddb" dependencies = [ "displaydoc", "thiserror", @@ -5966,7 +5966,7 @@ dependencies = [ [[package]] name = "zebra-state" version = "1.0.0-beta.35" -source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" +source = "git+https://github.com/willemolding/zebra?rev=185e404bed938e3aa916aee1ae6999a70efceddb#185e404bed938e3aa916aee1ae6999a70efceddb" dependencies = [ "bincode", "chrono", @@ -6000,7 +6000,7 @@ dependencies = [ [[package]] name = "zebra-test" version = "1.0.0-beta.35" -source = "git+https://github.com/willemolding/zebra?rev=a8d1aa14#a8d1aa146fc702878ca84f63fe5c32898ffbdfcc" +source = "git+https://github.com/willemolding/zebra?rev=185e404bed938e3aa916aee1ae6999a70efceddb#185e404bed938e3aa916aee1ae6999a70efceddb" dependencies = [ "color-eyre", "futures", From 5cc0502252c11fa1eb0a4a5e6f4e6c88e7d1d709 Mon Sep 17 00:00:00 2001 From: Willem Olding Date: Tue, 9 Apr 2024 20:05:23 +1000 Subject: [PATCH 06/10] run clippy --- src/service/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service/mod.rs b/src/service/mod.rs index e0a9449..d9286ba 100644 --- a/src/service/mod.rs +++ b/src/service/mod.rs @@ -2,7 +2,7 @@ use futures_util::future::FutureExt; use std::future::Future; use std::pin::Pin; use tower::{BoxError, Service, ServiceExt}; -use zebra_chain::amount::{Amount, NonNegative}; + pub use request::Request; From 8b1e82afce7492beaaddc0ccb3cdde1f73b946ca Mon Sep 17 00:00:00 2001 From: Willem Olding Date: Tue, 9 Apr 2024 20:07:09 +1000 Subject: [PATCH 07/10] fix fmt broken by clippy --- src/service/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/service/mod.rs b/src/service/mod.rs index d9286ba..ed6bb86 100644 --- a/src/service/mod.rs +++ b/src/service/mod.rs @@ -3,7 +3,6 @@ use std::future::Future; use std::pin::Pin; use tower::{BoxError, Service, ServiceExt}; - pub use request::Request; mod request; From d07c10cdbab88995e8fdd05218699257b37c74e5 Mon Sep 17 00:00:00 2001 From: Willem Olding Date: Tue, 9 Apr 2024 20:14:29 +1000 Subject: [PATCH 08/10] skip nightly rust for action --- .github/workflows/rust.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 56057fd..28c4713 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -42,7 +42,6 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly override: true components: clippy,rustfmt - name: Run cargo fmt From 59fbcdd83fb9165c93e12a40ab6a22f2687d15bf Mon Sep 17 00:00:00 2001 From: Willem Olding Date: Tue, 9 Apr 2024 20:17:11 +1000 Subject: [PATCH 09/10] add rust-toolchain file --- rust-toolchain.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 rust-toolchain.toml diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..624eb0e --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.76.0" From 7665d29720557821d947c4f7e4064a8332c91c30 Mon Sep 17 00:00:00 2001 From: Willem Olding Date: Tue, 9 Apr 2024 20:20:11 +1000 Subject: [PATCH 10/10] remove clippy check --- .github/workflows/rust.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 28c4713..244f826 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,27 +30,19 @@ jobs: command: check args: --all lints: - name: clippy and fmt + name: fmt check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout Source + uses: actions/checkout@v3 - uses: Swatinem/rust-cache@v2 - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 with: token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - override: true - components: clippy,rustfmt - - name: Run cargo fmt - uses: actions-rs/cargo@v1 - continue-on-error: false - with: - command: fmt - args: --all -- --check + - name: Setup protoc + uses: arduino/setup-protoc@v1.1.2 - uses: actions-rs/cargo@v1 with: - command: clippy - args: -- -D warnings + command: fmt + args: --all --check