Skip to content

Commit

Permalink
🐛 Fix Hyllar Indexer computing wrong caller
Browse files Browse the repository at this point in the history
  • Loading branch information
BertrandD committed Feb 6, 2025
1 parent e81b706 commit 6b5cd87
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/indexer/contract_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use hyle_contract_sdk::{
use hyllar::{HyllarToken, HyllarTokenContract};
use serde::Serialize;
use tokio::sync::RwLock;
use tracing::info;
use tracing::{debug, info};

Check failure on line 19 in src/indexer/contract_handlers.rs

View workflow job for this annotation

GitHub Actions / clippy

unused import: `debug`

error: unused import: `debug` --> src/indexer/contract_handlers.rs:19:15 | 19 | use tracing::{debug, info}; | ^^^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]`

Check failure on line 19 in src/indexer/contract_handlers.rs

View workflow job for this annotation

GitHub Actions / clippy

unused import: `debug`

error: unused import: `debug` --> src/indexer/contract_handlers.rs:19:15 | 19 | use tracing::{debug, info}; | ^^^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]`
use utoipa::openapi::OpenApi;
use utoipa::ToSchema;
use utoipa_axum::router::OpenApiRouter;
Expand Down Expand Up @@ -78,9 +78,13 @@ impl ContractHandler for HyllarToken {

let data: StructuredBlobData<ERC20Action> = data.clone().try_into()?;

let caller: Identity = data
let caller = data
.caller
.map(|_| contract_name.0.clone().into())
.and_then(|idx| {
tx.blobs
.get(idx.0)
.map(|b| Identity(b.contract_name.0.clone()))
})
.unwrap_or(tx.identity.clone());

let contract = HyllarTokenContract::init(state, caller);
Expand Down

0 comments on commit 6b5cd87

Please sign in to comment.