Skip to content

Commit

Permalink
build(deps): bump base64 from 0.20.0 to 0.22.1 (#5428)
Browse files Browse the repository at this point in the history
* ---
updated-dependencies:
- dependency-name: base64
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* update deprecated methods

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Filipe Azevedo <filipe@azevedo.io>
  • Loading branch information
dependabot[bot] and mangas authored May 28, 2024
1 parent 7237e59 commit 5c5e4fa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
10 changes: 2 additions & 8 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 chain/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ graph-runtime-wasm = { path = "../../runtime/wasm" }
graph-runtime-derive = { path = "../../runtime/derive" }

[dev-dependencies]
base64 = "0.20.0"
base64 = "0.22.1"
uuid = { version = "1.8.0", features = ["v4"] }

[build-dependencies]
Expand Down
5 changes: 3 additions & 2 deletions chain/ethereum/src/adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,7 @@ mod tests {
use super::{EthereumBlockFilter, LogFilterNode};
use super::{EthereumCallFilter, EthereumLogFilter, TriggerFilter};

use base64::prelude::*;
use graph::blockchain::TriggerFilter as _;
use graph::firehose::{CallToFilter, CombinedFilter, LogFilter, MultiLogFilter};
use graph::petgraph::graphmap::GraphMap;
Expand Down Expand Up @@ -1268,7 +1269,7 @@ mod tests {
log_filters: vec![filter],
};

let output = base64::encode(filter.encode_to_vec());
let output = BASE64_STANDARD.encode(filter.encode_to_vec());
assert_eq!(expected_base64, output);
}

Expand All @@ -1295,7 +1296,7 @@ mod tests {
// addresses and signatures above.
let expected_base64 = "ChTu0rd1bilakwDlPdBJrrB1GJm64xIEqQWcuw==";

let output = base64::encode(filter.encode_to_vec());
let output = BASE64_STANDARD.encode(filter.encode_to_vec());
assert_eq!(expected_base64, output);
}

Expand Down
2 changes: 1 addition & 1 deletion chain/substreams/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ prost-types = { workspace = true }
anyhow = "1.0"
hex = "0.4.3"
semver = "1.0.23"
base64 = "0.20.0"
base64 = "0.22.1"

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
7 changes: 5 additions & 2 deletions chain/substreams/src/mapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ fn parse_changes(

fn decode_value(value: &crate::codec::value::Typed) -> anyhow::Result<Value> {
use crate::codec::value::Typed;
use base64::prelude::*;

match value {
Typed::Int32(new_value) => Ok(Value::Int(*new_value)),
Expand All @@ -256,7 +257,8 @@ fn decode_value(value: &crate::codec::value::Typed) -> anyhow::Result<Value> {
Ok(Value::String(string))
}

Typed::Bytes(new_value) => base64::decode(new_value)
Typed::Bytes(new_value) => BASE64_STANDARD
.decode(new_value)
.map(|bs| Value::Bytes(Bytes::from(bs)))
.map_err(|err| anyhow::Error::from(err)),

Expand All @@ -278,6 +280,7 @@ mod test {
use super::decode_value;
use crate::codec::value::Typed;
use crate::codec::{Array, Value};
use base64::prelude::*;
use graph::{
data::store::scalar::Bytes,
prelude::{BigDecimal, BigInt, Value as GraphValue},
Expand Down Expand Up @@ -308,7 +311,7 @@ mod test {
name: "bytes value".to_string(),
value: Value {
typed: Some(Typed::Bytes(
base64::encode(
BASE64_STANDARD.encode(
hex::decode(
"445247fe150195bd866516594e087e1728294aa831613f4d48b8ec618908519f",
)
Expand Down

0 comments on commit 5c5e4fa

Please sign in to comment.