Skip to content

Commit 706a29c

Browse files
committed
go
1 parent 14c719d commit 706a29c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

program/rust/src/validator.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ use {
3030
transaction_context::TransactionAccount,
3131
},
3232
std::{
33-
cmp::max, collections::{
33+
cmp::max,
34+
collections::{
3435
BTreeMap,
3536
HashMap,
36-
}, mem::size_of
37+
},
38+
mem::size_of,
3739
},
3840
};
3941

@@ -158,9 +160,9 @@ fn checked_load_price_account(price_account_info: &[u8]) -> Option<&PriceAccount
158160

159161
pub const PUBLISHER_CAPS_DENOMINATOR: u64 = 1_000_000;
160162

161-
pub fn compute_publisher_stake_caps(accounts: Vec<&[u8]>, timestamp: i64, z : u64) -> Vec<u8> {
163+
pub fn compute_publisher_stake_caps(account_datas: Vec<&[u8]>, timestamp: i64, z: u64) -> Vec<u8> {
162164
let mut publisher_caps: BTreeMap<Pubkey, u64> = BTreeMap::new();
163-
for account in accounts {
165+
for account in account_datas {
164166
if let Some(price_account) = checked_load_price_account(account) {
165167
let cap: u64 = PUBLISHER_CAPS_DENOMINATOR
166168
.checked_div(max(u64::from(price_account.num_), z))
@@ -174,7 +176,7 @@ pub fn compute_publisher_stake_caps(accounts: Vec<&[u8]>, timestamp: i64, z : u6
174176
}
175177
}
176178

177-
let message = PublisherStakeCapsMessage {
179+
PublisherStakeCapsMessage {
178180
publish_time: timestamp,
179181
caps: publisher_caps
180182
.into_iter()
@@ -184,7 +186,5 @@ pub fn compute_publisher_stake_caps(accounts: Vec<&[u8]>, timestamp: i64, z : u6
184186
})
185187
.collect::<Vec<PublisherStakeCap>>()
186188
.into(),
187-
};
188-
189-
return message.to_bytes();
189+
}.to_bytes()
190190
}

0 commit comments

Comments
 (0)