Skip to content

Commit

Permalink
Fix staking pallet benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
ameba23 committed Oct 3, 2024
1 parent eda8bf0 commit e02b0f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions pallets/staking/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ fn prep_bond_and_validate<T: Config>(
reward_destination,
));

let server_info = ServerInfo {
let joining_server_info = JoiningServerInfo {
tss_account: threshold,
x25519_public_key,
endpoint: vec![20, 20],
provisioning_certification_key: BoundedVec::with_max_capacity(),
pck_certificate_chain: Vec::new(),
};

if validate_also {
assert_ok!(<Staking<T>>::validate(
RawOrigin::Signed(bonder).into(),
ValidatorPrefs::default(),
server_info,
joining_server_info,
));
}
}
Expand Down Expand Up @@ -256,14 +256,14 @@ benchmarks! {

let validator_preference = ValidatorPrefs::default();

let server_info = ServerInfo {
let joining_server_info = JoiningServerInfo {
tss_account: threshold.clone(),
x25519_public_key: NULL_ARR,
endpoint: vec![20],
provisioning_certification_key: BoundedVec::with_max_capacity(),
pck_certificate_chain: Vec::new(),
};

}: _(RawOrigin::Signed(bonder.clone()), validator_preference, server_info)
}: _(RawOrigin::Signed(bonder.clone()), validator_preference, joining_server_info)
verify {
assert_last_event::<T>(Event::<T>::NodeInfoChanged(bonder, vec![20], threshold).into());
}
Expand Down
2 changes: 1 addition & 1 deletion pallets/staking/src/pck/production.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl PckCertChainVerifier for ProductionPckCertChainVerifyer {
) -> Result<CompressedVerifyingKey, PckParseVerifyError> {
// TODO validate chain of arbitrary length
let pck_uncompressed = parse_pck_cert_chain(
pck_certificate_chain.get(0).unwrap().to_vec(),
pck_certificate_chain.first().unwrap().to_vec(),
pck_certificate_chain.get(1).unwrap().to_vec(),
)?;
// Compress public key
Expand Down

0 comments on commit e02b0f4

Please sign in to comment.