mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-02 13:23:10 +00:00
clippy
This commit is contained in:
parent
2884fdd00a
commit
0b2650127a
@ -1,4 +1,3 @@
|
||||
use crate::block::Block;
|
||||
use crate::parse_request;
|
||||
|
||||
use super::errors::RpcParseError;
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
use std::io::{Cursor, Read};
|
||||
|
||||
use nssa_core::{
|
||||
account::Nonce,
|
||||
|
||||
@ -1,7 +1,4 @@
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
io::Cursor,
|
||||
};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
use nssa_core::{
|
||||
account::{Account, AccountWithMetadata},
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
use std::io::{Cursor, Read};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{PrivateKey, PublicKey, Signature, error::NssaError, public_transaction::Message};
|
||||
use crate::{PrivateKey, PublicKey, Signature, public_transaction::Message};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct WitnessSet {
|
||||
@ -24,7 +22,7 @@ impl WitnessSet {
|
||||
pub fn is_valid_for(&self, message: &Message) -> bool {
|
||||
let message_bytes = message.to_bytes();
|
||||
for (signature, public_key) in self.iter_signatures() {
|
||||
if !signature.is_valid_for(&message_bytes, &public_key) {
|
||||
if !signature.is_valid_for(&message_bytes, public_key) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
use std::io::{Cursor, Read};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::PrivateKey;
|
||||
|
||||
@ -23,7 +22,7 @@ impl PublicKey {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::{PrivateKey, PublicKey, signature::tests::test_vectors};
|
||||
use crate::{PublicKey, signature::tests::test_vectors};
|
||||
|
||||
#[test]
|
||||
fn test_public_key_generation_from_bip340_test_vectors() {
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
use std::io::{Cursor, Read};
|
||||
|
||||
use rand::{RngCore, rngs::OsRng};
|
||||
|
||||
use crate::{PrivateKey, PublicKey, error::NssaError, public_transaction::Message};
|
||||
use crate::{PrivateKey, PublicKey};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct Signature {
|
||||
@ -31,7 +30,7 @@ impl Signature {
|
||||
let pk = secp256k1::XOnlyPublicKey::from_byte_array(public_key.0).unwrap();
|
||||
let secp = secp256k1::Secp256k1::new();
|
||||
let sig = secp256k1::schnorr::Signature::from_byte_array(self.value);
|
||||
secp.verify_schnorr(&sig, &bytes, &pk).is_ok()
|
||||
secp.verify_schnorr(&sig, bytes, &pk).is_ok()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
use std::io::Cursor;
|
||||
|
||||
use actix_web::Error as HttpError;
|
||||
use base64::{engine::general_purpose, Engine};
|
||||
|
||||
@ -8,7 +8,6 @@ use common::{
|
||||
use accounts::account_core::{address::AccountAddress, Account};
|
||||
use anyhow::Result;
|
||||
use chain_storage::WalletChainStore;
|
||||
use common::transaction::TransactionBody;
|
||||
use config::WalletConfig;
|
||||
use log::info;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user