Skip to content

Commit

Permalink
Update base64 dependency (#2686)
Browse files Browse the repository at this point in the history
  • Loading branch information
mina86 authored Oct 28, 2023
1 parent 5a655b0 commit 7e5bdce
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ anchor-client = { path = "../client", version = "0.29.0" }
anchor-lang = { path = "../lang", version = "0.29.0" }
anchor-syn = { path = "../lang/syn", features = ["event-cpi", "idl-parse", "init-if-needed"], version = "0.29.0" }
anyhow = "1.0.32"
base64 = "0.13.1"
base64 = "0.21"
bincode = "1.3.3"
cargo_toml = "0.15.3"
chrono = "0.4.19"
Expand Down
5 changes: 4 additions & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2659,6 +2659,9 @@ fn write_idl(idl: &Idl, out: OutFile) -> Result<()> {

/// Print `base64+borsh` encoded IDL instruction.
fn print_idl_instruction(ix_name: &str, ix: &Instruction, idl_address: &Pubkey) -> Result<()> {
use base64::engine::general_purpose::STANDARD;
use base64::Engine;

println!("Print only mode. No execution!");
println!("Instruction: {ix_name}");
println!("IDL address: {idl_address}");
Expand All @@ -2680,7 +2683,7 @@ fn print_idl_instruction(ix_name: &str, ix: &Instruction, idl_address: &Pubkey)

println!(
"Base64 encoded instruction: {}",
base64::encode(serialized_ix)
STANDARD.encode(serialized_ix)
);

Ok(())
Expand Down
6 changes: 5 additions & 1 deletion client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,16 @@ fn handle_program_log<T: anchor_lang::Event + anchor_lang::AnchorDeserialize>(
self_program_str: &str,
l: &str,
) -> Result<(Option<T>, Option<String>, bool), ClientError> {
use anchor_lang::__private::base64;
use base64::engine::general_purpose::STANDARD;
use base64::Engine;

// Log emitted from the current program.
if let Some(log) = l
.strip_prefix(PROGRAM_LOG)
.or_else(|| l.strip_prefix(PROGRAM_DATA))
{
let borsh_bytes = match anchor_lang::__private::base64::decode(log) {
let borsh_bytes = match STANDARD.decode(log) {
Ok(borsh_bytes) => borsh_bytes,
_ => {
#[cfg(feature = "debug")]
Expand Down
2 changes: 1 addition & 1 deletion lang/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ anchor-derive-space = { path = "./derive/space", version = "0.29.0" }
anchor-syn = { path = "./syn", version = "0.29.0", optional = true }

arrayref = "0.3"
base64 = "0.13"
base64 = "0.21"
bincode = "1"
borsh = ">=0.9, <0.11"
bytemuck = "1"
Expand Down

1 comment on commit 7e5bdce

@vercel
Copy link

@vercel vercel bot commented on 7e5bdce Oct 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

anchor-docs – ./

anchor-docs-git-master-200ms.vercel.app
anchor-docs-200ms.vercel.app
www.anchor-lang.com
anchor-lang.com

Please sign in to comment.