feat(uniswap_v2): encode attribute values with big endian encoding
This commit is contained in:
2
substreams/Cargo.lock
generated
2
substreams/Cargo.lock
generated
@@ -1041,7 +1041,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "substreams-ethereum-uniswap-v2"
|
name = "substreams-ethereum-uniswap-v2"
|
||||||
version = "0.2.1"
|
version = "0.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"ethabi 18.0.0",
|
"ethabi 18.0.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "substreams-ethereum-uniswap-v2"
|
name = "substreams-ethereum-uniswap-v2"
|
||||||
version = "0.2.1"
|
version = "0.3.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
specVersion: v0.1.0
|
specVersion: v0.1.0
|
||||||
package:
|
package:
|
||||||
name: "ethereum_uniswap_v2"
|
name: "ethereum_uniswap_v2"
|
||||||
version: v0.2.1
|
version: v0.3.0
|
||||||
|
|
||||||
protobuf:
|
protobuf:
|
||||||
files:
|
files:
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ fn get_pools(block: ð::Block, new_pools: &mut Vec<TransactionChanges>, params
|
|||||||
attributes: vec![
|
attributes: vec![
|
||||||
Attribute {
|
Attribute {
|
||||||
name: "reserve0".to_string(),
|
name: "reserve0".to_string(),
|
||||||
value: BigInt::from(0).to_signed_bytes_le(),
|
value: BigInt::from(0).to_signed_bytes_be(),
|
||||||
change: ChangeType::Creation.into(),
|
change: ChangeType::Creation.into(),
|
||||||
},
|
},
|
||||||
Attribute {
|
Attribute {
|
||||||
name: "reserve1".to_string(),
|
name: "reserve1".to_string(),
|
||||||
value: BigInt::from(0).to_signed_bytes_le(),
|
value: BigInt::from(0).to_signed_bytes_be(),
|
||||||
change: ChangeType::Creation.into(),
|
change: ChangeType::Creation.into(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -64,7 +64,7 @@ fn get_pools(block: ð::Block, new_pools: &mut Vec<TransactionChanges>, params
|
|||||||
// Trading Fee is hardcoded to 0.3%, saved as int in bps (basis points)
|
// Trading Fee is hardcoded to 0.3%, saved as int in bps (basis points)
|
||||||
Attribute {
|
Attribute {
|
||||||
name: "fee".to_string(),
|
name: "fee".to_string(),
|
||||||
value: BigInt::from(30).to_signed_bytes_le(),
|
value: BigInt::from(30).to_signed_bytes_be(),
|
||||||
change: ChangeType::Creation.into(),
|
change: ChangeType::Creation.into(),
|
||||||
},
|
},
|
||||||
Attribute {
|
Attribute {
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ fn handle_sync(
|
|||||||
name: attribute_name,
|
name: attribute_name,
|
||||||
value: reserve_bytes
|
value: reserve_bytes
|
||||||
.clone()
|
.clone()
|
||||||
.to_signed_bytes_le(), //TODO: Unify bytes encoding (either be or le)
|
.to_signed_bytes_be(),
|
||||||
change: ChangeType::Update.into(),
|
change: ChangeType::Update.into(),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user