Skip to content

Commit

Permalink
chore: rearrange params
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed Feb 20, 2025
1 parent f604e33 commit 39f11f5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export declare function asyncShuffleList(activeIndices: Uint32Array, seed: Uint8

export declare function asyncUnshuffleList(activeIndices: Uint32Array, seed: Uint8Array, rounds: number): Promise<Uint32Array>

export declare function computeProposerIndexElectra(effectiveBalanceIncrements: Uint16Array, activeIndices: Uint32Array, seed: Uint8Array, maxEffectiveBalanceElectra: number, effectiveBalanceIncrement: number, rounds: number): number
export declare function computeProposerIndexElectra(seed: Uint8Array, activeIndices: Uint32Array, effectiveBalanceIncrements: Uint16Array, maxEffectiveBalanceElectra: number, effectiveBalanceIncrement: number, rounds: number): number

export declare function computeSyncCommitteeIndicesElectra(syncCommitteeSize: number, seed: Uint8Array, activeIndices: Uint32Array, effectiveBalanceIncrements: Uint16Array, maxEffectiveBalanceElectra: number, effectiveBalanceIncrement: number, rounds: number): Uint32Array
export declare function computeSyncCommitteeIndicesElectra(seed: Uint8Array, activeIndices: Uint32Array, effectiveBalanceIncrements: Uint16Array, syncCommitteeSize: number, maxEffectiveBalanceElectra: number, effectiveBalanceIncrement: number, rounds: number): Uint32Array

export const SHUFFLE_ROUNDS_MAINNET: number

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ impl ComputeShuffledIndex {

#[napi]
pub fn compute_proposer_index_electra(
effective_balance_increments: &[u16],
active_indices: &[u32],
seed: &[u8],
active_indices: &[u32],
effective_balance_increments: &[u16],
max_effective_balance_electra: i64,
effective_balance_increment: i64,
rounds: u32,
Expand All @@ -406,10 +406,10 @@ pub fn compute_proposer_index_electra(

#[napi]
pub fn compute_sync_committee_indices_electra(
sync_committee_size: u32,
seed: &[u8],
active_indices: &[u32],
effective_balance_increments: &[u16],
sync_committee_size: u32,
max_effective_balance_electra: i64,
effective_balance_increment: i64,
rounds: u32,
Expand Down
2 changes: 1 addition & 1 deletion test/perf/committeeIndices.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ describe("computeIndices", () => {
id: `RS - computeSyncCommitteeIndices - ${listSize} indices`,
fn: () => {
computeSyncCommitteeIndicesElectra(
SYNC_COMMITTEE_SIZE,
seed,
activeIndices,
effectiveBalanceIncrements,
SYNC_COMMITTEE_SIZE,
MAX_EFFECTIVE_BALANCE_ELECTRA,
EFFECTIVE_BALANCE_INCREMENT,
SHUFFLE_ROUND_COUNT
Expand Down
6 changes: 3 additions & 3 deletions test/unit/committeeIndices.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ describe("computeProposerIndex", () => {
}
expect(
computeProposerIndexElectra(
effectiveBalanceIncrements,
activeIndices,
seed,
activeIndices,
effectiveBalanceIncrements,
MAX_EFFECTIVE_BALANCE_ELECTRA,
EFFECTIVE_BALANCE_INCREMENT,
SHUFFLE_ROUND_COUNT
Expand All @@ -46,10 +46,10 @@ describe("getNextSyncCommitteeIndices", () => {
expect(
new Array(
...computeSyncCommitteeIndicesElectra(
SYNC_COMMITTEE_SIZE,
seed,
activeIndices,
effectiveBalanceIncrements,
SYNC_COMMITTEE_SIZE,
MAX_EFFECTIVE_BALANCE_ELECTRA,
EFFECTIVE_BALANCE_INCREMENT,
SHUFFLE_ROUND_COUNT
Expand Down

0 comments on commit 39f11f5

Please sign in to comment.