Skip to content
This repository was archived by the owner on Dec 1, 2022. It is now read-only.

Commit 6c66123

Browse files
committed
[consensus] also expose which account ids have been locked so far
1 parent 2e27ba3 commit 6c66123

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

fastpay_core/src/authority.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ impl Authority for AuthorityState {
464464
.get_mut(&instance_id)
465465
.ok_or(FastPayError::UnknownConsensusInstance(instance_id))?;
466466
let info = ConsensusInfoResponse {
467+
locked_accounts: instance.locked_accounts.clone(),
467468
proposed: instance.proposed.clone(),
468469
locked: instance.locked.clone(),
469470
received: instance.received.clone(),

fastpay_core/src/messages.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use super::{base_types::*, committee::Committee, error::FastPayError};
55
use ff::Field;
66
use serde::{Deserialize, Serialize};
7-
use std::collections::HashSet;
7+
use std::collections::{BTreeMap, HashSet};
88

99
#[cfg(test)]
1010
#[path = "unit_tests/messages_tests.rs"]
@@ -251,6 +251,7 @@ pub enum ConsensusOrder {
251251
#[derive(Clone, Debug, Serialize, Deserialize)]
252252
#[cfg_attr(test, derive(Eq, PartialEq))]
253253
pub struct ConsensusInfoResponse {
254+
pub locked_accounts: BTreeMap<AccountId, AccountOwner>,
254255
pub proposed: Option<ConsensusProposal>,
255256
pub locked: Option<Certificate>,
256257
pub received: Certificate,

fastpay_core/tests/staged/fastpay.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ ConsensusDecision:
160160
Confirm: UNIT
161161
ConsensusInfoResponse:
162162
STRUCT:
163+
- locked_accounts:
164+
MAP:
165+
KEY:
166+
TYPENAME: AccountId
167+
VALUE:
168+
TYPENAME: PublicKeyBytes
163169
- proposed:
164170
OPTION:
165171
TYPENAME: ConsensusProposal

0 commit comments

Comments
 (0)