Skip to content

Commit

Permalink
Rename struct (typo)
Browse files Browse the repository at this point in the history
  • Loading branch information
ameba23 committed Oct 24, 2024
1 parent 3968d6e commit a053e3b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pallets/attestation/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ();
Expand Down
2 changes: 1 addition & 1 deletion pallets/propagation/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ();
Expand Down
2 changes: 1 addition & 1 deletion pallets/registry/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ();
Expand Down
4 changes: 2 additions & 2 deletions pallets/staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Test>;
type BlockNumber = u64;
Expand Down Expand Up @@ -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 = ();
Expand Down
20 changes: 17 additions & 3 deletions pallets/staking/src/pck/mock.rs
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
use super::{CompressedVerifyingKey, PckCertChainVerifier, PckParseVerifyError};
use p256::ecdsa::{SigningKey, VerifyingKey};
use rand::{rngs::StdRng, SeedableRng};
Expand All @@ -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<Vec<u8>>,
) -> Result<CompressedVerifyingKey, PckParseVerifyError> {
Expand Down
2 changes: 1 addition & 1 deletion pallets/staking/src/pck/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
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;
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Runtime>;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = weights::pallet_staking_extension::WeightInfo<Runtime>;
Expand Down

0 comments on commit a053e3b

Please sign in to comment.