Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mana_bits_exponent field #1128

Merged
merged 3 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bindings/nodejs/lib/types/models/info/node-info-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ export interface ProtocolParameters {
* The number of slots in an epoch expressed as an exponent of 2.
*/
slotsPerEpochExponent: number;
/**
* The number of bits used to represent Mana expressed as an exponent of 2.
*/
manaBitsExponent: number;
/**
* The amount of potential Mana generated by 1 IOTA in 1 slot.
*/
Expand Down
3 changes: 3 additions & 0 deletions sdk/src/types/block/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ pub struct ProtocolParameters {
pub(crate) slot_duration_in_seconds: u8,
/// The number of slots in an epoch expressed as an exponent of 2.
pub(crate) slots_per_epoch_exponent: u8,
/// The number of bits used to represent Mana expressed as an exponent of 2.
pub(crate) mana_bits_exponent: u8,
/// The amount of potential Mana generated by 1 IOTA in 1 slot.
pub(crate) mana_generation_rate: u8,
/// The scaling of `mana_generation_rate` expressed as an exponent of 2.
Expand Down Expand Up @@ -104,6 +106,7 @@ impl Default for ProtocolParameters {
slot_duration_in_seconds: 10,
epoch_nearing_threshold: 20.into(),
slots_per_epoch_exponent: Default::default(),
mana_bits_exponent: Default::default(),
mana_generation_rate: Default::default(),
mana_generation_rate_exponent: Default::default(),
mana_decay_factors: Default::default(),
Expand Down
4 changes: 2 additions & 2 deletions sdk/tests/types/block_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ fn compute() {
// TODO: Independently verify this value
assert_eq!(
block_id.to_string(),
"0xf0bd00c717f4a11d3a6381c4c06954b873c7bf1052a0b10465d04ba2de38bd420b00000000000000"
"0x8840fd83fcbc58dfcc6b6e63d3cf8f42694197b77ad7e244c3327af3b6cdd9780b00000000000000"
);
assert_eq!(
block_id.hash().to_string(),
"0xf0bd00c717f4a11d3a6381c4c06954b873c7bf1052a0b10465d04ba2de38bd42"
"0x8840fd83fcbc58dfcc6b6e63d3cf8f42694197b77ad7e244c3327af3b6cdd978"
);
assert_eq!(block_id.slot_index(), slot_index);
}