From 32bc847234ce99c997711ab1215314da16bbd104 Mon Sep 17 00:00:00 2001 From: glihm Date: Mon, 16 Oct 2023 11:11:07 -0600 Subject: [PATCH] fix formatting and casing for wallet requests --- apps/blockchain/ethereum/script/ERC721.s.sol | 4 ++-- apps/blockchain/ethereum/src/TestMessaging.sol | 0 apps/indexer/Makefile | 4 ++++ apps/indexer/docker-compose.yml | 7 ++++++- apps/indexer/src/starknet_indexer/client.rs | 1 + apps/indexer/src/starknet_indexer/events.rs | 5 +++++ apps/indexer/src/storage/mongo/request_store.rs | 1 - 7 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 apps/blockchain/ethereum/src/TestMessaging.sol diff --git a/apps/blockchain/ethereum/script/ERC721.s.sol b/apps/blockchain/ethereum/script/ERC721.s.sol index d5ad3806..6abe10fa 100644 --- a/apps/blockchain/ethereum/script/ERC721.s.sol +++ b/apps/blockchain/ethereum/script/ERC721.s.sol @@ -23,8 +23,8 @@ contract Deploy is Script { bytes memory dataInit = abi.encodeWithSelector( ERC721Bridgeable.initialize.selector, abi.encode( - "glihm_123", - "GLM_123" + "everai_123", + "EVR_123" ) ); diff --git a/apps/blockchain/ethereum/src/TestMessaging.sol b/apps/blockchain/ethereum/src/TestMessaging.sol new file mode 100644 index 00000000..e69de29b diff --git a/apps/indexer/Makefile b/apps/indexer/Makefile index fffb6612..6cf4d537 100644 --- a/apps/indexer/Makefile +++ b/apps/indexer/Makefile @@ -25,9 +25,13 @@ stop_local_devnodes: db_reset: sudo docker-compose -f ./docker-compose.yml down + docker volume rm indexer_starklane_testnet -f sudo docker-compose -f ./docker-compose.yml up -d run_dev: cargo build @make db_reset RUST_LOG=debug cargo run -- --config-file local.config --mongodb mongodb://localhost:27017/starklane + +run_server: + RUST_LOG=starklane_indexer=debug cargo run -- --config-file testnet.config --mongodb mongodb://localhost:27017/starklane_testnet --api-server-ip 127.0.0.1:7890 diff --git a/apps/indexer/docker-compose.yml b/apps/indexer/docker-compose.yml index 511bfb22..ced84eba 100644 --- a/apps/indexer/docker-compose.yml +++ b/apps/indexer/docker-compose.yml @@ -2,10 +2,15 @@ version: '3.1' services: - db: + starklane_db: # TODO: add volume for persistence when alpha is ready. container_name: starklane_db image: mongo restart: always ports: - 27017:27017 + volumes: + - starklane_testnet:/data/db + +volumes: + starklane_testnet: diff --git a/apps/indexer/src/starknet_indexer/client.rs b/apps/indexer/src/starknet_indexer/client.rs index ae9b62de..405b28a4 100644 --- a/apps/indexer/src/starknet_indexer/client.rs +++ b/apps/indexer/src/starknet_indexer/client.rs @@ -176,5 +176,6 @@ impl StarknetClient { calldata: vec![felt!("1"), felt!("0")], }; self.client.invoke_tx(vec![call]).await; + */ } diff --git a/apps/indexer/src/starknet_indexer/events.rs b/apps/indexer/src/starknet_indexer/events.rs index e6c76673..93401c1a 100644 --- a/apps/indexer/src/starknet_indexer/events.rs +++ b/apps/indexer/src/starknet_indexer/events.rs @@ -1,6 +1,7 @@ use anyhow::{anyhow, Result}; use serde_json::{json, Value}; use starknet::core::{types::FieldElement, types::*}; +use starknet::macros::selector; use crate::storage::{BridgeChain, CrossChainTx, CrossChainTxKind, Event, EventLabel, Request}; @@ -20,6 +21,10 @@ pub fn get_store_data( // keys[0] -> selector. // keys[1,2] -> req hash. // keys[3] -> timestamp. + if event.keys[0] == selector!("CollectionDeployedFromL1") { + return Ok((None, None, None)); + } + let hash = u256_to_hex(&event.keys[1..])?; let block_timestamp = event.keys[3]; let request_header = event.data[0]; diff --git a/apps/indexer/src/storage/mongo/request_store.rs b/apps/indexer/src/storage/mongo/request_store.rs index 8d539c19..81e26463 100644 --- a/apps/indexer/src/storage/mongo/request_store.rs +++ b/apps/indexer/src/storage/mongo/request_store.rs @@ -12,7 +12,6 @@ impl RequestStore for MongoStore { async fn reqs_by_wallet(&self, address: &str) -> Result> { let filter = doc! { "$or": [ - {"from": address}, {"to": address}, ] };