Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
fix: Replace deprecated base64::encode with BASE64_STANDARD
Browse files Browse the repository at this point in the history
  • Loading branch information
oblique committed Jan 10, 2023
1 parent 000bd7c commit 1caebdf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ethers-providers/src/transports/common.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Code adapted from: https://github.com/althea-net/guac_rs/tree/master/web3/src/jsonrpc

use base64::prelude::*;
use ethers_core::types::U256;
use serde::{
de::{self, MapAccess, Unexpected, Visitor},
Expand Down Expand Up @@ -191,7 +192,7 @@ pub enum Authorization {

impl Authorization {
pub fn basic(username: impl Into<String>, password: impl Into<String>) -> Self {
let auth_secret = base64::encode(username.into() + ":" + &password.into());
let auth_secret = BASE64_STANDARD.encode(username.into() + ":" + &password.into());
Self::Basic(auth_secret)
}

Expand Down

0 comments on commit 1caebdf

Please sign in to comment.