feat: Update uniswap v3 package to use big endian encoding (#199)
* feat: update uniswap v3 package to big endian encoding * chore: update use of format macro to make clippy happy
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
[package]
|
||||
name = "substreams-ethereum-uniswap-v3"
|
||||
version = "0.2.1"
|
||||
name = "ethereum-uniswap-v3"
|
||||
version = "0.3.0"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
name = "substreams_ethereum_uniswap_v3"
|
||||
name = "ethereum_uniswap_v3"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
specVersion: v0.1.0
|
||||
package:
|
||||
name: "substreams_arbitrum_uniswap_v3"
|
||||
version: v0.2.1
|
||||
name: "arbitrum_uniswap_v3"
|
||||
version: v0.3.0
|
||||
url: "https://github.com/propeller-heads/tycho-protocol-sdk/tree/main/substreams/ethereum-uniswap-v3"
|
||||
|
||||
|
||||
protobuf:
|
||||
files:
|
||||
@@ -15,7 +17,7 @@ protobuf:
|
||||
binaries:
|
||||
default:
|
||||
type: wasm/rust-v1
|
||||
file: ../../target/wasm32-unknown-unknown/substreams/substreams_ethereum_uniswap_v3.wasm
|
||||
file: ../target/wasm32-unknown-unknown/release/ethereum_uniswap_v3.wasm
|
||||
|
||||
modules:
|
||||
- name: map_pools_created
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
specVersion: v0.1.0
|
||||
package:
|
||||
name: "substreams_ethereum_uniswap_v3"
|
||||
version: v0.2.1
|
||||
name: "ethereum_uniswap_v3"
|
||||
version: v0.3.0
|
||||
url: "https://github.com/propeller-heads/tycho-protocol-sdk/tree/main/substreams/ethereum-uniswap-v3"
|
||||
|
||||
protobuf:
|
||||
files:
|
||||
@@ -15,7 +16,7 @@ protobuf:
|
||||
binaries:
|
||||
default:
|
||||
type: wasm/rust-v1
|
||||
file: ../../target/wasm32-unknown-unknown/substreams/substreams_ethereum_uniswap_v3.wasm
|
||||
file: ../target/wasm32-unknown-unknown/release/ethereum_uniswap_v3.wasm
|
||||
|
||||
modules:
|
||||
- name: map_pools_created
|
||||
|
||||
@@ -40,17 +40,17 @@ fn get_new_pools(
|
||||
attributes: vec![
|
||||
Attribute {
|
||||
name: "liquidity".to_string(),
|
||||
value: BigInt::from(0).to_signed_bytes_le(),
|
||||
value: BigInt::from(0).to_signed_bytes_be(),
|
||||
change: ChangeType::Creation.into(),
|
||||
},
|
||||
Attribute {
|
||||
name: "tick".to_string(),
|
||||
value: BigInt::from(0).to_signed_bytes_le(),
|
||||
value: BigInt::from(0).to_signed_bytes_be(),
|
||||
change: ChangeType::Creation.into(),
|
||||
},
|
||||
Attribute {
|
||||
name: "sqrt_price_x96".to_string(),
|
||||
value: BigInt::from(0).to_signed_bytes_le(),
|
||||
value: BigInt::from(0).to_signed_bytes_be(),
|
||||
change: ChangeType::Creation.into(),
|
||||
},
|
||||
],
|
||||
@@ -62,12 +62,12 @@ fn get_new_pools(
|
||||
static_att: vec![
|
||||
Attribute {
|
||||
name: "fee".to_string(),
|
||||
value: event.fee.to_signed_bytes_le(),
|
||||
value: event.fee.to_signed_bytes_be(),
|
||||
change: ChangeType::Creation.into(),
|
||||
},
|
||||
Attribute {
|
||||
name: "tick_spacing".to_string(),
|
||||
value: event.tick_spacing.to_signed_bytes_le(),
|
||||
value: event.tick_spacing.to_signed_bytes_be(),
|
||||
change: ChangeType::Creation.into(),
|
||||
},
|
||||
Attribute {
|
||||
|
||||
@@ -77,7 +77,7 @@ impl<'a> UniswapPoolStorage<'a> {
|
||||
};
|
||||
attributes.push(Attribute {
|
||||
name: storage_location.name.to_string(),
|
||||
value: value.to_signed_bytes_le(),
|
||||
value: value.to_signed_bytes_be(),
|
||||
change: ChangeType::Update.into(),
|
||||
});
|
||||
}
|
||||
@@ -108,7 +108,7 @@ impl<'a> UniswapPoolStorage<'a> {
|
||||
// We need this to keep the references to the names alive until we call
|
||||
// `get_changed_attributes()`
|
||||
for tick_idx in ticks_idx.iter() {
|
||||
tick_names.push(format!("ticks/{}/net-liquidity", tick_idx));
|
||||
tick_names.push(format!("ticks/{tick_idx}/net-liquidity"));
|
||||
}
|
||||
|
||||
// Then, iterate over ticks_idx and tick_names simultaneously
|
||||
|
||||
Reference in New Issue
Block a user