Skip to content

Commit 20002ea

Browse files
authored
Merge pull request #5 from ideal-lab5/cm/idn-events-updated
IDN events updated
2 parents e7d992c + 6661509 commit 20002ea

File tree

7 files changed

+138
-447
lines changed

7 files changed

+138
-447
lines changed

.github/workflows/rust.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
- name: Install rustfmt for nightly
3232
run: rustup component add --toolchain nightly rustfmt
3333

34+
- name: Install clippy for nightly
35+
run: rustup component add --toolchain nightly clippy
36+
3437
- name: Install llvm-tools-preview for stable
3538
run: rustup component add llvm-tools-preview --toolchain stable-x86_64-unknown-linux-gnu
3639

ideal-metadata/ideal.scale

24 KB
Binary file not shown.

indexer/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@ edition = "2021"
55

66
[dependencies]
77
ideal-metadata = { path = "../ideal-metadata" }
8-
acuity-index-substrate = { git = "https://github.com/ideal-lab5/idn-acuity-index-substrate", version = "=0.6.2" }
8+
acuity-index-substrate = { git = "https://github.com/ideal-lab5/idn-acuity-index-substrate" }
99
byte-unit = "4.0.19"
1010
clap = { version = "4.5.1", features = ["derive"] }
1111
clap-verbosity-flag = "2.2.0"
1212
serde = { version = "1.0.130", features = ["derive"] }
13-
serde_json = "1.0.68"
1413
sled = "0.34.7"
1514
subxt = "0.35.3"
1615
tokio = { version = "1.35.1", features = ["full"] }
17-
tracing = "0.1.40"
1816
tracing-log = "0.2.0"
1917
zerocopy = "0.7.32"
2018
hex = "0.4.3"
21-
hex-literal = "0.4.1"
2219
lazy_static = "1.4.0"

indexer/src/ideal.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use ideal_metadata::ideal_metadata::{
22
runtime_types::{
33
frame_system::pallet::Event as SystemEvent,
44
pallet_balances::pallet::Event as BalancesEvent,
5-
// Add other relevant event imports for your ideal network
5+
// IDN-specific pallet events
6+
pallet_idn_manager::pallet::Event as IdnManagerEvent,
67
},
78
Event,
89
};
@@ -16,7 +17,7 @@ use acuity_index_substrate::*;
1617
pub struct IdealIndexer;
1718

1819
impl acuity_index_substrate::shared::RuntimeIndexer for IdealIndexer {
19-
type RuntimeConfig = subxt::PolkadotConfig; // You might need to adjust this based on your chain's configuration
20+
type RuntimeConfig = subxt::PolkadotConfig;
2021
type ChainKey = ChainKey;
2122

2223
fn get_name() -> &'static str {
@@ -48,7 +49,10 @@ impl acuity_index_substrate::shared::RuntimeIndexer for IdealIndexer {
4849
Event::Balances(event) => {
4950
index_balances_event![BalancesEvent, event, indexer, block_number, event_index]
5051
},
51-
// Add other event handlers as needed
52+
// IDN-specific event handlers using upstream macros
53+
Event::IdnManager(event) => {
54+
index_idn_manager_event![IdnManagerEvent, event, indexer, block_number, event_index]
55+
},
5256
_ => 0,
5357
})
5458
}

indexer/src/main.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ mod tests;
1313

1414
mod config;
1515
mod ideal;
16-
mod pallets;
1716

1817
use ideal::IdealIndexer;
1918

@@ -64,9 +63,9 @@ impl IndexTrees for ChainTrees {
6463
#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, Hash)]
6564
#[serde(tag = "type", content = "value")]
6665
pub enum ChainKey {
67-
AccountId(Bytes32), // For balance events
68-
BlockHash(Bytes32), // For system events
69-
ExtrinsicHash(Bytes32), // For transaction events
66+
AccountId(Bytes32),
67+
BlockHash(Bytes32),
68+
ExtrinsicHash(Bytes32),
7069
}
7170

7271
impl IndexKey for ChainKey {

0 commit comments

Comments
 (0)