From a053e3bc31e0d99a446bb293d131b740afb9fea2 Mon Sep 17 00:00:00 2001 From: peg Date: Thu, 24 Oct 2024 14:20:08 +0200 Subject: [PATCH] Rename struct (typo) --- pallets/attestation/src/mock.rs | 2 +- pallets/propagation/src/mock.rs | 2 +- pallets/registry/src/mock.rs | 2 +- pallets/staking/src/mock.rs | 4 ++-- pallets/staking/src/pck/mock.rs | 20 +++++++++++++++++--- pallets/staking/src/pck/mod.rs | 2 +- runtime/src/lib.rs | 2 +- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/pallets/attestation/src/mock.rs b/pallets/attestation/src/mock.rs index ed4cc5f9c..c546530e4 100644 --- a/pallets/attestation/src/mock.rs +++ b/pallets/attestation/src/mock.rs @@ -315,7 +315,7 @@ impl pallet_staking_extension::Config for Test { type AttestationHandler = (); type Currency = Balances; type MaxEndpointLength = MaxEndpointLength; - type PckCertChainVerifier = pallet_staking_extension::pck::MockPckCertChainVerifyer; + type PckCertChainVerifier = pallet_staking_extension::pck::MockPckCertChainVerifier; type Randomness = TestPastRandomness; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); diff --git a/pallets/propagation/src/mock.rs b/pallets/propagation/src/mock.rs index 25ed262a0..424010c8b 100644 --- a/pallets/propagation/src/mock.rs +++ b/pallets/propagation/src/mock.rs @@ -309,7 +309,7 @@ impl pallet_staking_extension::Config for Test { type AttestationHandler = (); type Currency = Balances; type MaxEndpointLength = MaxEndpointLength; - type PckCertChainVerifier = pallet_staking_extension::pck::MockPckCertChainVerifyer; + type PckCertChainVerifier = pallet_staking_extension::pck::MockPckCertChainVerifier; type Randomness = TestPastRandomness; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); diff --git a/pallets/registry/src/mock.rs b/pallets/registry/src/mock.rs index 9b31222be..ad5b26c3b 100644 --- a/pallets/registry/src/mock.rs +++ b/pallets/registry/src/mock.rs @@ -306,7 +306,7 @@ impl pallet_staking_extension::Config for Test { type AttestationHandler = (); type Currency = Balances; type MaxEndpointLength = MaxEndpointLength; - type PckCertChainVerifier = pallet_staking_extension::pck::MockPckCertChainVerifyer; + type PckCertChainVerifier = pallet_staking_extension::pck::MockPckCertChainVerifier; type Randomness = TestPastRandomness; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); diff --git a/pallets/staking/src/mock.rs b/pallets/staking/src/mock.rs index 8922a87aa..3fdd697d1 100644 --- a/pallets/staking/src/mock.rs +++ b/pallets/staking/src/mock.rs @@ -37,7 +37,7 @@ use sp_staking::{EraIndex, SessionIndex}; use sp_std::vec; use crate as pallet_staking_extension; -use pallet_staking_extension::pck::MockPckCertChainVerifyer; +use pallet_staking_extension::pck::MockPckCertChainVerifier; type Block = frame_system::mocking::MockBlock; type BlockNumber = u64; @@ -420,7 +420,7 @@ impl pallet_staking_extension::Config for Test { type AttestationHandler = MockAttestationHandler; type Currency = Balances; type MaxEndpointLength = MaxEndpointLength; - type PckCertChainVerifier = MockPckCertChainVerifyer; + type PckCertChainVerifier = MockPckCertChainVerifier; type Randomness = TestPastRandomness; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); diff --git a/pallets/staking/src/pck/mock.rs b/pallets/staking/src/pck/mock.rs index 068b0838c..5623cdd0d 100644 --- a/pallets/staking/src/pck/mock.rs +++ b/pallets/staking/src/pck/mock.rs @@ -1,3 +1,17 @@ +// Copyright (C) 2023 Entropy Cryptography Inc. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . use super::{CompressedVerifyingKey, PckCertChainVerifier, PckParseVerifyError}; use p256::ecdsa::{SigningKey, VerifyingKey}; use rand::{rngs::StdRng, SeedableRng}; @@ -9,13 +23,13 @@ pub const MOCK_PCK_DERIVED_FROM_NULL_ARRAY: [u8; 33] = [ 151, 134, 87, 68, 46, 37, 163, 127, 97, 252, 174, 108, ]; -/// A PCK certificate chain verifyer for testing +/// A PCK certificate chain verifier for testing. /// Rather than actually use test certificates, we give here the TSS account ID instead of the first /// certificate, and derive a keypair from it. The same keypair will be derived when creating a mock /// quote in entropy-tss -pub struct MockPckCertChainVerifyer {} +pub struct MockPckCertChainVerifier {} -impl PckCertChainVerifier for MockPckCertChainVerifyer { +impl PckCertChainVerifier for MockPckCertChainVerifier { fn verify_pck_certificate_chain( pck_certificate_chain: Vec>, ) -> Result { diff --git a/pallets/staking/src/pck/mod.rs b/pallets/staking/src/pck/mod.rs index a6d0fe9cc..3694d988a 100644 --- a/pallets/staking/src/pck/mod.rs +++ b/pallets/staking/src/pck/mod.rs @@ -13,7 +13,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . mod mock; -pub use mock::{signing_key_from_seed, MockPckCertChainVerifyer, MOCK_PCK_DERIVED_FROM_NULL_ARRAY}; +pub use mock::{signing_key_from_seed, MockPckCertChainVerifier, MOCK_PCK_DERIVED_FROM_NULL_ARRAY}; mod production; use super::VerifyingKey as CompressedVerifyingKey; use core::array::TryFromSliceError; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 85042d6cc..f801c6a94 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -718,7 +718,7 @@ impl pallet_staking_extension::Config for Runtime { type AttestationHandler = Attestation; type Currency = Balances; type MaxEndpointLength = MaxEndpointLength; - type PckCertChainVerifier = pallet_staking_extension::pck::MockPckCertChainVerifyer; + type PckCertChainVerifier = pallet_staking_extension::pck::MockPckCertChainVerifier; type Randomness = pallet_babe::RandomnessFromOneEpochAgo; type RuntimeEvent = RuntimeEvent; type WeightInfo = weights::pallet_staking_extension::WeightInfo;