Skip to content

Commit

Permalink
Apply linter
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBEN committed Aug 7, 2023
1 parent ed37553 commit 5f39029
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
1 change: 0 additions & 1 deletion concordium-std/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2918,7 +2918,6 @@ where
fn delete(mut self) { self.clear(); }
}


impl Serial for HashSha2256 {
fn serial<W: Write>(&self, out: &mut W) -> Result<(), W::Err> { self.0.serial(out) }
}
Expand Down
8 changes: 3 additions & 5 deletions concordium-std/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use crate::{
cell::UnsafeCell, marker::PhantomData, num::NonZeroU32, Cursor, HasStateApi, Serial, Vec,
};
use concordium_contracts_common::{
AccountBalance, Amount, ParseError
};
use concordium_contracts_common::{AccountBalance, Amount, ParseError};
use core::{fmt, str::FromStr};
// Re-export for backward compatibility.
pub use concordium_contracts_common::ExchangeRates;
Expand Down Expand Up @@ -695,13 +693,13 @@ pub type QueryContractBalanceResult = Result<Amount, QueryContractBalanceError>;

/// A wrapper around [`Result`] that fixes the error variant to
/// [`QueryAccountPublicKeysError`] and result to [`AccountPublicKeys`].
pub type QueryAccountPublicKeysResult = Result<crate::AccountPublicKeys, QueryAccountPublicKeysError>;
pub type QueryAccountPublicKeysResult =
Result<crate::AccountPublicKeys, QueryAccountPublicKeysError>;

/// A wrapper around [`Result`] that fixes the error variant to
/// [`CheckAccountSignatureError`] and result to [`bool`].
pub type CheckAccountSignatureResult = Result<bool, CheckAccountSignatureError>;


/// A type representing the attributes, lazily acquired from the host.
#[derive(Clone, Copy, Default)]
pub struct AttributesCursor {
Expand Down
11 changes: 6 additions & 5 deletions examples/cis3-nft-sponsored-txs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
//! identities) and each credential has one (or several) public-private key
//! pairs. The key/signature structures of an account are represented as
//! two-level maps (e.g. BTreeMap<CredentialIndexU8, BTreeMap<PublicKeyIndexU8,
//! Ed25519PublicKey>> or BTreeMap<CredentialIndexU8, BTreeMap<SignatureIndexU8,
//! Signature>>). The outer map has an `AccountThreshold` (number of credentials
//! needed to sign the transaction initiated by that account) and the inner map
//! has a `SignatureThreshold` (number of Ed25519Signatures needed for a
//! PublicKey>> or BTreeMap<CredentialIndexU8, BTreeMap<SignatureIndexU8,
//! Signature>>). The outer map of `BTreeMap<CredentialIndexU8,
//! BTreeMap<PublicKeyIndexU8, PublicKey>>` has an `AccountThreshold` (number of
//! credentials needed to sign the transaction initiated by that account) and
//! the inner map has a `SignatureThreshold` (number of Signatures needed for a
//! specific credential so that this credential is considered to have signed the
//! transaction initiated by that account). The CIS3 standard supports multi-sig
//! accounts. But for simplicity, this contract supports only basic accounts
Expand Down Expand Up @@ -344,7 +345,7 @@ type ContractError = Cis2Error<CustomContractError>;

type ContractResult<A> = Result<A, ContractError>;

/// Mapping CustomContractError to ContractError
/// Mapping account signature error to CustomContractError
impl From<CheckAccountSignatureError> for CustomContractError {
fn from(e: CheckAccountSignatureError) -> Self {
match e {
Expand Down
5 changes: 4 additions & 1 deletion examples/cis3-nft-sponsored-txs/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ fn setup_chain_and_contract() -> (Chain, ContractInitSuccess) {

inner_key_map.insert(
KeyIndex(0u8),
VerifyKey::Ed25519VerifyKey(ed25519_dalek::PublicKey::from_bytes(&PUBLIC_KEY).unwrap()),
VerifyKey::Ed25519VerifyKey(
ed25519_dalek::PublicKey::from_bytes(&PUBLIC_KEY)
.expect("Should be able to create public key"),
),
);

let credential_public_keys = CredentialPublicKeys {
Expand Down

0 comments on commit 5f39029

Please sign in to comment.