Create a workspace and make clippy happy.
This commit is contained in:
1063
substreams/crates/tycho-substreams/Cargo.lock
generated
1063
substreams/crates/tycho-substreams/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -4,8 +4,8 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
substreams-ethereum = "0.9.9"
|
||||
substreams = "0.5"
|
||||
prost = "0.11"
|
||||
hex = "0.4.3"
|
||||
substreams-ethereum.workspace = true
|
||||
substreams.workspace = true
|
||||
prost.workspace = true
|
||||
hex.workspace = true
|
||||
itertools = "0.12.0"
|
||||
@@ -1,13 +0,0 @@
|
||||
reorder_imports = true
|
||||
imports_granularity = "Crate"
|
||||
use_small_heuristics = "Max"
|
||||
comment_width = 100
|
||||
wrap_comments = true
|
||||
binop_separator = "Back"
|
||||
trailing_comma = "Vertical"
|
||||
trailing_semicolon = false
|
||||
use_field_init_shorthand = true
|
||||
chain_width = 40
|
||||
ignore = [
|
||||
"src/pb",
|
||||
]
|
||||
@@ -63,6 +63,8 @@ pub fn store_balance_changes(deltas: BlockBalanceDeltas, store: impl StoreAdd<Bi
|
||||
});
|
||||
}
|
||||
|
||||
type TxAggregatedBalances = HashMap<Vec<u8>, (Transaction, HashMap<Vec<u8>, BalanceChange>)>;
|
||||
|
||||
/// Aggregates absolute balances per transaction and token.
|
||||
///
|
||||
/// ## Arguments
|
||||
@@ -82,7 +84,7 @@ pub fn store_balance_changes(deltas: BlockBalanceDeltas, store: impl StoreAdd<Bi
|
||||
pub fn aggregate_balances_changes(
|
||||
balance_store: StoreDeltas,
|
||||
deltas: BlockBalanceDeltas,
|
||||
) -> HashMap<Vec<u8>, (Transaction, HashMap<Vec<u8>, BalanceChange>)> {
|
||||
) -> TxAggregatedBalances {
|
||||
balance_store
|
||||
.deltas
|
||||
.into_iter()
|
||||
@@ -207,9 +209,9 @@ mod tests {
|
||||
let token_1 = hex::decode("babe00").unwrap();
|
||||
|
||||
let t0_key =
|
||||
format!("{}:{}", String::from_utf8(comp_id.clone()).unwrap(), hex::encode(&token_0));
|
||||
format!("{}:{}", String::from_utf8(comp_id.clone()).unwrap(), hex::encode(token_0));
|
||||
let t1_key =
|
||||
format!("{}:{}", String::from_utf8(comp_id.clone()).unwrap(), hex::encode(&token_1));
|
||||
format!("{}:{}", String::from_utf8(comp_id.clone()).unwrap(), hex::encode(token_1));
|
||||
StoreDeltas {
|
||||
deltas: vec![
|
||||
StoreDelta {
|
||||
@@ -283,12 +285,12 @@ mod tests {
|
||||
let res_0 = store.get_last(format!(
|
||||
"{}:{}",
|
||||
String::from_utf8(comp_id.clone()).unwrap(),
|
||||
hex::encode(&token_0)
|
||||
hex::encode(token_0)
|
||||
));
|
||||
let res_1 = store.get_last(format!(
|
||||
"{}:{}",
|
||||
String::from_utf8(comp_id.clone()).unwrap(),
|
||||
hex::encode(&token_1)
|
||||
hex::encode(token_1)
|
||||
));
|
||||
|
||||
assert_eq!(res_0, Some(BigInt::from_str("+999").unwrap()));
|
||||
|
||||
@@ -49,11 +49,7 @@ impl InterimContractChange {
|
||||
balance: vec![],
|
||||
code: vec![],
|
||||
slots: Default::default(),
|
||||
change: if creation {
|
||||
tycho::ChangeType::Creation.into()
|
||||
} else {
|
||||
tycho::ChangeType::Update.into()
|
||||
},
|
||||
change: if creation { tycho::ChangeType::Creation } else { tycho::ChangeType::Update },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,11 @@ use std::rc::Rc;
|
||||
use substreams::prelude::{BigInt, StoreDelete, StoreGet, StoreNew};
|
||||
use substreams::store::StoreAdd;
|
||||
|
||||
type BigIntStore = HashMap<String, Vec<(u64, BigInt)>>;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct MockStore {
|
||||
data: Rc<RefCell<HashMap<String, Vec<(u64, BigInt)>>>>,
|
||||
data: Rc<RefCell<BigIntStore>>,
|
||||
}
|
||||
|
||||
impl StoreDelete for MockStore {
|
||||
|
||||
Reference in New Issue
Block a user