Skip to content

Commit

Permalink
Fixed signature of PoS eth key read methods
Browse files Browse the repository at this point in the history
  • Loading branch information
sug0 committed Sep 16, 2022
1 parent f263839 commit 0ef4072
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions proof_of_stake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ pub trait PosReadOnly {
fn read_validator_eth_cold_key(
&self,
key: &Self::Address,
) -> Option<Self::PublicKey>;
) -> Option<ValidatorEthKey<Self::PublicKey>>;

/// Read PoS validator's Eth validator set update signing key
fn read_validator_eth_hot_key(
&self,
key: &Self::Address,
) -> Option<Self::PublicKey>;
) -> Option<ValidatorEthKey<Self::PublicKey>>;
}

/// PoS system trait to be implemented in integration that can read and write
Expand Down Expand Up @@ -612,13 +612,13 @@ pub trait PosBase {
fn read_validator_eth_cold_key(
&self,
key: &Self::Address,
) -> Option<Self::PublicKey>;
) -> Option<ValidatorEthKey<Self::PublicKey>>;

/// Read PoS validator's Eth validator set update signing key
fn read_validator_eth_hot_key(
&self,
key: &Self::Address,
) -> Option<Self::PublicKey>;
) -> Option<ValidatorEthKey<Self::PublicKey>>;

/// Write PoS parameters.
fn write_pos_params(&mut self, params: &PosParams);
Expand Down
4 changes: 2 additions & 2 deletions shared/src/ledger/pos/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ where
fn read_validator_eth_cold_key(
&self,
key: &Self::Address,
) -> Option<Self::PublicKey> {
) -> Option<types::ValidatorEthKey<Self::PublicKey>> {
let (value, _gas) =
self.read(&validator_eth_cold_key_key(key)).unwrap();
value.map(|value| decode(value).unwrap())
Expand All @@ -514,7 +514,7 @@ where
fn read_validator_eth_hot_key(
&self,
key: &Self::Address,
) -> Option<Self::PublicKey> {
) -> Option<types::ValidatorEthKey<Self::PublicKey>> {
let (value, _gas) = self.read(&validator_eth_hot_key_key(key)).unwrap();
value.map(|value| decode(value).unwrap())
}
Expand Down
4 changes: 2 additions & 2 deletions shared/src/ledger/pos/vp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ where
fn read_validator_eth_cold_key(
&self,
key: &Self::Address,
) -> Option<Self::PublicKey> {
) -> Option<types::ValidatorEthKey<Self::PublicKey>> {
let value =
self.ctx.read_pre(&validator_eth_cold_key_key(key)).unwrap();
value.map(|value| decode(value).unwrap())
Expand All @@ -419,7 +419,7 @@ where
fn read_validator_eth_hot_key(
&self,
key: &Self::Address,
) -> Option<Self::PublicKey> {
) -> Option<types::ValidatorEthKey<Self::PublicKey>> {
let value = self.ctx.read_pre(&validator_eth_hot_key_key(key)).unwrap();
value.map(|value| decode(value).unwrap())
}
Expand Down
4 changes: 2 additions & 2 deletions vm_env/src/proof_of_stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ impl namada_proof_of_stake::PosReadOnly for PoS {
fn read_validator_eth_cold_key(
&self,
key: &Self::Address,
) -> Option<Self::PublicKey> {
) -> Option<types::ValidatorEthKey<Self::PublicKey>> {
tx::read(validator_eth_cold_key_key(key).to_string())
}

fn read_validator_eth_hot_key(
&self,
key: &Self::Address,
) -> Option<Self::PublicKey> {
) -> Option<types::ValidatorEthKey<Self::PublicKey>> {
tx::read(validator_eth_hot_key_key(key).to_string())
}
}
Expand Down

0 comments on commit 0ef4072

Please sign in to comment.