diff --git a/Cargo.lock b/Cargo.lock index 127d80c9abc..db6d4f68f1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -312,12 +312,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "base64" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" - [[package]] name = "base64" version = "0.21.0" @@ -1713,7 +1707,7 @@ name = "graph-chain-ethereum" version = "0.35.0" dependencies = [ "anyhow", - "base64 0.20.0", + "base64 0.22.1", "envconfig", "graph", "graph-runtime-derive", @@ -1766,7 +1760,7 @@ name = "graph-chain-substreams" version = "0.35.0" dependencies = [ "anyhow", - "base64 0.20.0", + "base64 0.22.1", "graph", "graph-runtime-wasm", "hex", diff --git a/chain/ethereum/Cargo.toml b/chain/ethereum/Cargo.toml index 42fa0decf9a..ca6ca05913c 100644 --- a/chain/ethereum/Cargo.toml +++ b/chain/ethereum/Cargo.toml @@ -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] diff --git a/chain/ethereum/src/adapter.rs b/chain/ethereum/src/adapter.rs index fc3d1ac3f4c..aeaa62b6e32 100644 --- a/chain/ethereum/src/adapter.rs +++ b/chain/ethereum/src/adapter.rs @@ -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; @@ -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); } @@ -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); } diff --git a/chain/substreams/Cargo.toml b/chain/substreams/Cargo.toml index ae6e954ec89..28e677c7f2f 100644 --- a/chain/substreams/Cargo.toml +++ b/chain/substreams/Cargo.toml @@ -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"] } diff --git a/chain/substreams/src/mapper.rs b/chain/substreams/src/mapper.rs index 6e28ff2c5b3..1d3c7ea23db 100644 --- a/chain/substreams/src/mapper.rs +++ b/chain/substreams/src/mapper.rs @@ -234,6 +234,7 @@ fn parse_changes( fn decode_value(value: &crate::codec::value::Typed) -> anyhow::Result { use crate::codec::value::Typed; + use base64::prelude::*; match value { Typed::Int32(new_value) => Ok(Value::Int(*new_value)), @@ -256,7 +257,8 @@ fn decode_value(value: &crate::codec::value::Typed) -> anyhow::Result { 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)), @@ -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}, @@ -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", )