Skip to content

Commit a34d8bf

Browse files
committed
refactor(models): unify naming for AuthorityMarksConfig
1 parent 63d5340 commit a34d8bf

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

src/models/config/mod.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,16 @@ impl BlockchainConfigParams {
512512
self.set_raw(ConfigParam43::ID, ok!(CellBuilder::build_from(size_limits)))
513513
}
514514

515-
/// Returns authority params.
516-
pub fn get_authority_params(&self) -> Result<AuthorityParams, Error> {
515+
/// Returns authority marks config.
516+
pub fn get_authority_marks_config(&self) -> Result<AuthorityMarksConfig, Error> {
517517
ok!(self.get::<ConfigParam100>()).ok_or(Error::CellUnderflow)
518518
}
519519

520-
/// Updates authority params.
521-
pub fn set_authority_params(&mut self, params: AuthorityParams) -> Result<bool, Error> {
520+
/// Updates authority marks config.
521+
pub fn set_authority_marks_config(
522+
&mut self,
523+
params: &AuthorityMarksConfig,
524+
) -> Result<bool, Error> {
522525
self.set_raw(ConfigParam100::ID, ok!(CellBuilder::build_from(params)))
523526
}
524527

@@ -1143,12 +1146,11 @@ define_config_params! {
11431146
#[serde(transparent)]
11441147
50 => ConfigParam50(MintOnceConfig),
11451148

1146-
/// Authority params
1149+
/// Authority marks config.
11471150
///
1148-
/// Contains dictionary with special addresses (in masterchain) which can mark other accounts
1149-
/// and system marks currency IDs.
1151+
/// Contains an [`AuthorityMarksConfig`].
11501152
#[serde(transparent)]
1151-
100 => ConfigParam100(AuthorityParams),
1153+
100 => ConfigParam100(AuthorityMarksConfig),
11521154
}
11531155

11541156
#[cfg(feature = "serde")]

src/models/config/params.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,6 @@ pub struct MintOnceConfig {
7373
pub delta: CurrencyCollection,
7474
}
7575

76-
/// System currencies to mark accounts
77-
#[derive(Debug, Clone, Eq, PartialEq, Store, Load)]
78-
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
79-
pub struct AuthorityParams {
80-
/// System authority addresses
81-
pub authority_addresses: Dict<HashBytes, ()>,
82-
/// Black mark currency id
83-
pub black_mark_id: u32,
84-
/// White mark currency id.
85-
pub white_mark_id: u32,
86-
}
87-
8876
/// Config voting setup params.
8977
#[derive(Debug, Clone, Eq, PartialEq, Store, Load)]
9078
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
@@ -1627,6 +1615,19 @@ const fn shift_ceil_price(value: u128) -> u128 {
16271615
(value >> 16) + r as u128
16281616
}
16291617

1618+
/// Authority marks configuration.
1619+
#[derive(Debug, Clone, Eq, PartialEq, Store, Load)]
1620+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1621+
#[tlb(tag = "#01")]
1622+
pub struct AuthorityMarksConfig {
1623+
/// Addresses in masterchain that can manage authority marks.
1624+
pub authority_addresses: Dict<HashBytes, ()>,
1625+
/// Black mark extra currency id.
1626+
pub black_mark_id: u32,
1627+
/// White mark extra currency id.
1628+
pub white_mark_id: u32,
1629+
}
1630+
16301631
#[cfg(test)]
16311632
mod tests {
16321633
use super::*;

0 commit comments

Comments
 (0)