Skip to content

Commit 61a6d48

Browse files
committed
Replace AddrKeyhash with StakeAddress in spo_distribution_store.rs and use to_/from_binary to encode the entire stake address (network + hash) so we can retrieve the stake address out of it.
1 parent d2798aa commit 61a6d48

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

common/src/stake_addresses.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,14 +1467,8 @@ mod tests {
14671467
let map = stake_addresses.get_drep_delegations_map(&addresses).unwrap();
14681468

14691469
assert_eq!(map.len(), 3);
1470-
assert_eq!(
1471-
map.get(&addr1).unwrap(),
1472-
&Some(DRepChoice::Abstain)
1473-
);
1474-
assert_eq!(
1475-
map.get(&addr2).unwrap(),
1476-
&Some(DRepChoice::Key(DREP_HASH))
1477-
);
1470+
assert_eq!(map.get(&addr1).unwrap(), &Some(DRepChoice::Abstain));
1471+
assert_eq!(map.get(&addr2).unwrap(), &Some(DRepChoice::Key(DREP_HASH)));
14781472
assert_eq!(map.get(&addr3).unwrap(), &None);
14791473
}
14801474

modules/rest_blockfrost/src/handlers/governance.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ use crate::types::{
44
DRepInfoREST, DRepMetadataREST, DRepUpdateREST, DRepVoteREST, DRepsListREST, ProposalVoteREST,
55
VoterRoleREST,
66
};
7-
use acropolis_common::{messages::{Message, RESTResponse, StateQuery, StateQueryResponse}, queries::{
8-
accounts::{AccountsStateQuery, AccountsStateQueryResponse},
9-
governance::{GovernanceStateQuery, GovernanceStateQueryResponse},
10-
}, Credential, GovActionId, StakeAddress, TxHash, Voter};
7+
use acropolis_common::{
8+
messages::{Message, RESTResponse, StateQuery, StateQueryResponse},
9+
queries::{
10+
accounts::{AccountsStateQuery, AccountsStateQueryResponse},
11+
governance::{GovernanceStateQuery, GovernanceStateQueryResponse},
12+
},
13+
Credential, GovActionId, StakeAddress, TxHash, Voter,
14+
};
1115
use anyhow::{anyhow, Result};
1216
use caryatid_sdk::Context;
1317
use reqwest::Client;

modules/spo_state/src/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use acropolis_common::{
1010
params::TECHNICAL_PARAMETER_POOL_RETIRE_MAX_EPOCH,
1111
queries::governance::VoteRecord,
1212
stake_addresses::StakeAddressMap,
13-
BlockInfo, PoolId, PoolMetadata, PoolRegistration, PoolRetirement, PoolUpdateEvent,
14-
Relay, StakeAddress, TxCertificate, TxHash, TxIdentifier, Voter, VotingProcedures,
13+
BlockInfo, PoolId, PoolMetadata, PoolRegistration, PoolRetirement, PoolUpdateEvent, Relay,
14+
StakeAddress, TxCertificate, TxHash, TxIdentifier, Voter, VotingProcedures,
1515
};
1616
use anyhow::Result;
1717
use imbl::HashMap;

0 commit comments

Comments
 (0)