Skip to content

Commit

Permalink
Add format lints
Browse files Browse the repository at this point in the history
  • Loading branch information
iamalwaysuncomfortable committed Dec 3, 2024
1 parent c387b6b commit 24f6a2e
Show file tree
Hide file tree
Showing 28 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ jobs:
- run:
working_directory: wasm
command: |
cargo +nightly fmt --all -- --check
cargo fmt --all -- --check
workflows:
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/account/compute_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

use super::PrivateKey;
use crate::{
types::{native::ComputeKeyNative, Group, Scalar},
Address,
types::{Group, Scalar, native::ComputeKeyNative},
};

use core::{convert::TryFrom, ops::Deref};
Expand Down Expand Up @@ -103,8 +103,8 @@ impl From<&ComputeKeyNative> for ComputeKey {
mod tests {
use super::*;
use crate::{
PrivateKey,
types::native::{AddressNative, CurrentNetwork},
PrivateKey,
};

use snarkvm_console::network::Network;
Expand Down
2 changes: 1 addition & 1 deletion wasm/src/account/graph_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use super::ViewKey;
use crate::types::{Field, native::GraphKeyNative};
use crate::types::{native::GraphKeyNative, Field};

use core::{convert::TryFrom, fmt, ops::Deref, str::FromStr};
use wasm_bindgen::prelude::*;
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/account/private_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use crate::{
types::native::{CurrentNetwork, Environment, FromBytes, PrimeField, PrivateKeyNative, ToBytes},
Address,
Encryptor,
PrivateKeyCiphertext,
Signature,
ViewKey,
types::native::{CurrentNetwork, Environment, FromBytes, PrimeField, PrivateKeyNative, ToBytes},
};

use core::{convert::TryInto, fmt, ops::Deref, str::FromStr};
use rand::{SeedableRng, rngs::StdRng};
use rand::{rngs::StdRng, SeedableRng};
use wasm_bindgen::prelude::*;

/// Private key of an Aleo account
Expand Down
6 changes: 3 additions & 3 deletions wasm/src/account/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use crate::{Address, PrivateKey, Scalar, types::native::SignatureNative};
use crate::{types::native::SignatureNative, Address, PrivateKey, Scalar};

use core::{fmt, ops::Deref, str::FromStr};
use rand::{SeedableRng, rngs::StdRng};
use rand::{rngs::StdRng, SeedableRng};
use wasm_bindgen::prelude::*;

/// Cryptographic signature of a message signed by an Aleo account
Expand Down Expand Up @@ -128,7 +128,7 @@ impl FromStr for Signature {
mod tests {
use super::*;

use rand::{Rng, SeedableRng, rngs::StdRng};
use rand::{rngs::StdRng, Rng, SeedableRng};
use wasm_bindgen_test::*;

const ITERATIONS: u64 = 1_000;
Expand Down
2 changes: 1 addition & 1 deletion wasm/src/account/view_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use super::{Address, PrivateKey};
use crate::record::RecordCiphertext;

use crate::{Scalar, types::native::ViewKeyNative};
use crate::{types::native::ViewKeyNative, Scalar};
use core::{convert::TryFrom, fmt, ops::Deref, str::FromStr};
use wasm_bindgen::prelude::*;

Expand Down
8 changes: 4 additions & 4 deletions wasm/src/ledger/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use crate::{
input_to_js_value,
output_to_js_value,
types::native::{FromBytes, ToBytes, TransactionNative, U64Native},
Field,
Group,
RecordCiphertext,
RecordPlaintext,
Transition,
VerifyingKey,
ViewKey,
input_to_js_value,
output_to_js_value,
types::native::{FromBytes, ToBytes, TransactionNative, U64Native},
};

use js_sys::{Array, Object, Reflect, Uint8Array};
use std::{ops::Deref, str::FromStr};
use wasm_bindgen::{JsValue, prelude::wasm_bindgen};
use wasm_bindgen::{prelude::wasm_bindgen, JsValue};

/// Webassembly Representation of an Aleo transaction
///
Expand Down
8 changes: 4 additions & 4 deletions wasm/src/ledger/transition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use crate::{
input_to_js_value,
output_to_js_value,
types::native::{FromBytes, ToBytes, TransitionNative},
Field,
Group,
RecordCiphertext,
RecordPlaintext,
ViewKey,
input_to_js_value,
output_to_js_value,
types::native::{FromBytes, ToBytes, TransitionNative},
};

use js_sys::{Array, Object, Reflect, Uint8Array};
use std::{ops::Deref, str::FromStr};
use wasm_bindgen::{JsValue, prelude::wasm_bindgen};
use wasm_bindgen::{prelude::wasm_bindgen, JsValue};

#[wasm_bindgen]
pub struct Transition(TransitionNative);
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/programs/data/ciphertext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use crate::{
native::{CiphertextNative, FromBytes, ToBytes},
Field,
Group,
Plaintext,
ViewKey,
native::{CiphertextNative, FromBytes, ToBytes},
};

use js_sys::Uint8Array;
Expand Down Expand Up @@ -131,7 +131,7 @@ impl From<&Ciphertext> for CiphertextNative {
#[cfg(test)]
mod tests {
use super::*;
use crate::{PrivateKey, Transition, plaintext_to_js_value};
use crate::{plaintext_to_js_value, PrivateKey, Transition};
use snarkvm_console::{collections::OrHalt, program::compute_function_id, types::U16};

use crate::types::native::{CurrentNetwork, FieldNative, IdentifierNative, Network, ProgramID};
Expand Down
2 changes: 1 addition & 1 deletion wasm/src/programs/data/helpers/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use crate::{
Plaintext,
plaintext_to_js_value,
types::native::{ArgumentNative, FutureNative},
Plaintext,
};

use js_sys::{Array, JsString, Object, Reflect};
Expand Down
2 changes: 1 addition & 1 deletion wasm/src/programs/data/helpers/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use crate::{Ciphertext, Field, Plaintext, plaintext_to_js_value, types::native::InputNative};
use crate::{plaintext_to_js_value, types::native::InputNative, Ciphertext, Field, Plaintext};

use js_sys::{JsString, Object, Reflect};
use wasm_bindgen::JsValue;
Expand Down
6 changes: 3 additions & 3 deletions wasm/src/programs/data/helpers/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use crate::{
future_to_js_value,
plaintext_to_js_value,
types::native::OutputNative,
Ciphertext,
Field,
Plaintext,
RecordCiphertext,
future_to_js_value,
plaintext_to_js_value,
types::native::OutputNative,
};

use js_sys::{JsString, Object, Reflect};
Expand Down
6 changes: 3 additions & 3 deletions wasm/src/programs/data/plaintext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use crate::{
plaintext_to_js_value,
types::native::{FromBytes, IdentifierNative, PlaintextNative, ToBytes},
Address,
Ciphertext,
Field,
Scalar,
plaintext_to_js_value,
types::native::{FromBytes, IdentifierNative, PlaintextNative, ToBytes},
};
use std::ops::Deref;

use js_sys::Uint8Array;
use std::str::FromStr;
use wasm_bindgen::{JsValue, prelude::wasm_bindgen};
use wasm_bindgen::{prelude::wasm_bindgen, JsValue};

/// SnarkVM Plaintext object. Plaintext is a fundamental monadic type used to represent Aleo
/// primitive types (boolean, field, group, i8, i16, i32, i64, i128, u8, u16, u32, u64, u128,
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/programs/manager/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use super::*;

use crate::{OfflineQuery, PrivateKey, RecordPlaintext, Transaction, execute_fee, log};
use crate::{execute_fee, log, OfflineQuery, PrivateKey, RecordPlaintext, Transaction};

use crate::types::native::{
CurrentAleo,
Expand All @@ -29,7 +29,7 @@ use crate::types::native::{
TransactionNative,
};
use js_sys::Object;
use rand::{SeedableRng, rngs::StdRng};
use rand::{rngs::StdRng, SeedableRng};
use std::str::FromStr;

#[wasm_bindgen]
Expand Down
10 changes: 5 additions & 5 deletions wasm/src/programs/manager/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ use super::*;
use core::ops::Add;

use crate::{
execute_fee,
execute_program,
log,
process_inputs,
ExecutionResponse,
OfflineQuery,
PrivateKey,
RecordPlaintext,
Transaction,
execute_fee,
execute_program,
log,
process_inputs,
};

use crate::types::native::{
Expand All @@ -38,7 +38,7 @@ use crate::types::native::{
TransactionNative,
};
use js_sys::{Array, Object};
use rand::{SeedableRng, rngs::StdRng};
use rand::{rngs::StdRng, SeedableRng};
use std::str::FromStr;

#[wasm_bindgen]
Expand Down
10 changes: 5 additions & 5 deletions wasm/src/programs/manager/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
use super::*;

use crate::{
OfflineQuery,
PrivateKey,
RecordPlaintext,
Transaction,
execute_fee,
execute_program,
log,
process_inputs,
OfflineQuery,
PrivateKey,
RecordPlaintext,
Transaction,
};

use crate::types::native::{
Expand All @@ -36,7 +36,7 @@ use crate::types::native::{
TransactionNative,
};
use js_sys::Array;
use rand::{SeedableRng, rngs::StdRng};
use rand::{rngs::StdRng, SeedableRng};
use std::str::FromStr;

#[wasm_bindgen]
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/programs/manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ const DEFAULT_URL: &str = "https://api.explorer.provable.com/v1";
use crate::{KeyPair, PrivateKey, ProvingKey, RecordPlaintext, VerifyingKey};

use crate::types::native::{
cost_in_microcredits,
deployment_cost,
IdentifierNative,
ProcessNative,
ProgramIDNative,
ProgramNative,
ProvingKeyNative,
QueryNative,
VerifyingKeyNative,
cost_in_microcredits,
deployment_cost,
};
use js_sys::{Object, Reflect};
use std::str::FromStr;
Expand Down
4 changes: 2 additions & 2 deletions wasm/src/programs/manager/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

use super::*;

use crate::{OfflineQuery, PrivateKey, RecordPlaintext, Transaction, execute_program, log, process_inputs};
use crate::{execute_program, log, process_inputs, OfflineQuery, PrivateKey, RecordPlaintext, Transaction};

use crate::types::native::{CurrentAleo, IdentifierNative, ProcessNative, ProgramNative, TransactionNative};
use js_sys::Array;
use rand::{SeedableRng, rngs::StdRng};
use rand::{rngs::StdRng, SeedableRng};
use std::{ops::Add, str::FromStr};

#[wasm_bindgen]
Expand Down
10 changes: 5 additions & 5 deletions wasm/src/programs/manager/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
use super::*;

use crate::{
OfflineQuery,
PrivateKey,
RecordPlaintext,
Transaction,
execute_fee,
execute_program,
log,
process_inputs,
OfflineQuery,
PrivateKey,
RecordPlaintext,
Transaction,
};

use crate::types::native::{
Expand All @@ -35,7 +35,7 @@ use crate::types::native::{
RecordPlaintextNative,
TransactionNative,
};
use rand::{SeedableRng, rngs::StdRng};
use rand::{rngs::StdRng, SeedableRng};
use std::{ops::Add, str::FromStr};
use wasm_bindgen::JsValue;

Expand Down
2 changes: 1 addition & 1 deletion wasm/src/programs/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::{

use js_sys::{Array, Object, Reflect};
use std::{ops::Deref, str::FromStr};
use wasm_bindgen::{JsValue, prelude::wasm_bindgen};
use wasm_bindgen::{prelude::wasm_bindgen, JsValue};

/// Webassembly Representation of an Aleo program
#[wasm_bindgen]
Expand Down
2 changes: 1 addition & 1 deletion wasm/src/programs/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::types::native::{

use crate::{Execution, KeyPair, Program, ProvingKey, VerifyingKey};
use std::{ops::Deref, str::FromStr};
use wasm_bindgen::{JsValue, prelude::wasm_bindgen};
use wasm_bindgen::{prelude::wasm_bindgen, JsValue};

/// Webassembly Representation of an Aleo function execution response
///
Expand Down
2 changes: 1 addition & 1 deletion wasm/src/record/record_ciphertext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with the Aleo SDK library. If not, see <https://www.gnu.org/licenses/>.

use crate::{Field, GraphKey, RecordPlaintext, ViewKey, types::native::RecordCiphertextNative};
use crate::{types::native::RecordCiphertextNative, Field, GraphKey, RecordPlaintext, ViewKey};

use std::{ops::Deref, str::FromStr};
use wasm_bindgen::prelude::*;
Expand Down
Loading

0 comments on commit 24f6a2e

Please sign in to comment.