Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit d01730a

Browse files
authored
deps: Upgrade base64 to 0.21.0, remove where it's not used (#4204)
1 parent ca0f337 commit d01730a

File tree

7 files changed

+20
-16
lines changed

7 files changed

+20
-16
lines changed

Cargo.lock

Lines changed: 8 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

governance/addin-mock/program/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ thiserror = "1.0"
2828

2929
[dev-dependencies]
3030
assert_matches = "1.5.0"
31-
base64 = "0.13"
3231
proptest = "1.1"
3332
solana-program-test = "1.14.12"
3433
solana-sdk = "1.14.12"

governance/chat/program/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ thiserror = "1.0"
2929

3030
[dev-dependencies]
3131
assert_matches = "1.5.0"
32-
base64 = "0.13"
3332
proptest = "1.1"
3433
solana-program-test = "1.14.12"
3534
solana-sdk = "1.14.12"

governance/program/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ thiserror = "1.0"
2727

2828
[dev-dependencies]
2929
assert_matches = "1.5.0"
30-
base64 = "0.13"
30+
base64 = "0.21"
3131
proptest = "1.1"
3232
solana-program-test = "1.14.12"
3333
solana-sdk = "1.14.12"

governance/program/src/state/proposal_transaction.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,12 @@ pub fn get_proposal_transaction_data_for_proposal(
248248
#[cfg(test)]
249249
mod test {
250250

251-
use std::str::FromStr;
252-
253-
use solana_program::{bpf_loader_upgradeable, clock::Epoch};
254-
255-
use super::*;
251+
use {
252+
super::*,
253+
base64::{engine::general_purpose, Engine as _},
254+
solana_program::{bpf_loader_upgradeable, clock::Epoch},
255+
std::str::FromStr,
256+
};
256257

257258
fn create_test_account_meta_data() -> AccountMetaData {
258259
AccountMetaData {
@@ -341,15 +342,15 @@ mod test {
341342
instruction_data.serialize(&mut instruction_bytes).unwrap();
342343

343344
// base64 encoded message is accepted as the input in the UI
344-
let base64 = base64::encode(instruction_bytes.clone());
345+
let encoded = general_purpose::STANDARD_NO_PAD.encode(&instruction_bytes);
345346

346347
// Assert
347348
let instruction =
348349
Instruction::from(&InstructionData::deserialize(&mut &instruction_bytes[..]).unwrap());
349350

350351
assert_eq!(upgrade_instruction, instruction);
351352

352-
assert_eq!(base64,"Aqj2kU6IobDiEBU+92OuKwDCuT0WwSTSwFN6EASAAAAHAAAAchkHXTU9jF+rKpILT6dzsVyNI9NsQy9cab+GGvdwNn0AAfh2HVruy2YibpgcQUmJf5att5YdPXSv1k2pRAKAfpSWAAFDVQuXWos2urmegSPblI813GlTm7CJ/8rv+9yzNE3yfwAB3Gw+apCyfrRNqJ6f1160Htkx+uYZT6FIILQ3WzNA4KwAAQan1RcZLFxRIYzJTD1K8X9Y2u4Im6H9ROPb2YoAAAAAAAAGp9UXGMd0yShWY5hpHV62i164o5tLbVxzVVshAAAAAAAA3Gw+apCyfrRNqJ6f1160Htkx+uYZT6FIILQ3WzNA4KwBAAQAAAADAAAA");
353+
assert_eq!(encoded,"Aqj2kU6IobDiEBU+92OuKwDCuT0WwSTSwFN6EASAAAAHAAAAchkHXTU9jF+rKpILT6dzsVyNI9NsQy9cab+GGvdwNn0AAfh2HVruy2YibpgcQUmJf5att5YdPXSv1k2pRAKAfpSWAAFDVQuXWos2urmegSPblI813GlTm7CJ/8rv+9yzNE3yfwAB3Gw+apCyfrRNqJ6f1160Htkx+uYZT6FIILQ3WzNA4KwAAQan1RcZLFxRIYzJTD1K8X9Y2u4Im6H9ROPb2YoAAAAAAAAGp9UXGMd0yShWY5hpHV62i164o5tLbVxzVVshAAAAAAAA3Gw+apCyfrRNqJ6f1160Htkx+uYZT6FIILQ3WzNA4KwBAAQAAAADAAAA");
353354
}
354355

355356
#[test]

token-lending/program/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ uint = "0.9"
2323

2424
[dev-dependencies]
2525
assert_matches = "1.5.0"
26-
base64 = "0.13"
26+
base64 = "0.21"
2727
log = "0.4.14"
2828
proptest = "1.1"
2929
solana-program-test = "1.14.12"

token-lending/program/tests/helpers/genesis.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use base64::{engine::general_purpose, Engine as _};
12
use serde::{Deserialize, Serialize};
23
use solana_program::bpf_loader_upgradeable;
34
use solana_program_test::*;
@@ -24,7 +25,7 @@ impl From<Account> for Base64Account {
2425
owner: account.owner.to_string(),
2526
balance: account.lamports,
2627
executable: account.executable,
27-
data: base64::encode(&account.data),
28+
data: general_purpose::STANDARD_NO_PAD.encode(&account.data),
2829
}
2930
}
3031
}

0 commit comments

Comments
 (0)