Skip to content

Commit

Permalink
rusk: serialize genesis events as json on gql
Browse files Browse the repository at this point in the history
- Add dusk-core serde feature
- Remove obsolete structs
- Update CHANGELOG
  • Loading branch information
Neotamandua committed Feb 20, 2025
1 parent 0b4d732 commit c89f7cc
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 216 deletions.
2 changes: 2 additions & 0 deletions rusk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Change plonk verification to use embed verification data by default [#3507]
- Change responses for moonlight gql endpoints (archive node) [#3512]

## [1.1.0] - 2025-02-14

Expand Down Expand Up @@ -347,6 +348,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add build system that generates keys for circuits and caches them.

<!-- Issues -->
[#3512]: https://github.com/dusk-network/rusk/issues/3512
[#3507]: https://github.com/dusk-network/rusk/issues/3507
[#3494]: https://github.com/dusk-network/rusk/issues/3494
[#3481]: https://github.com/dusk-network/rusk/issues/3481
Expand Down
2 changes: 1 addition & 1 deletion rusk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ recovery-keys = ["rusk-recovery/keys"]
prover = ["dep:rusk-prover"]
testwallet = ["dep:futures"]
chain = ["dep:node", "dep:dusk-consensus", "dep:node-data"]
archive = ["chain", "node/archive"]
archive = ["chain", "node/archive", "dusk-core/serde"]
network-trace = ["node/network-trace"]
http-wasm = []
dynamic-verifier = []
Expand Down
13 changes: 10 additions & 3 deletions rusk/src/lib/http/chain/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use node::database::{Ledger, DB};
use node_data::ledger::Label;
#[cfg(feature = "archive")]
use {
archive::data::deserialized_archive_data::DeserializedMoonlightGroups,
archive::data::*,
archive::events::*,
archive::finalized_block::*,
Expand Down Expand Up @@ -180,16 +179,24 @@ impl Query {
})
}

/// Retrieves the events of all historical transactions that have been
/// affecting the moonlight balance of the given address.
#[cfg(feature = "archive")]
async fn full_moonlight_history(
&self,
ctx: &Context<'_>,
address: String,
ord: Option<String>,
) -> OptResult<DeserializedMoonlightGroups> {
) -> OptResult<MoonlightTransfers> {
full_moonlight_history(ctx, address, ord).await
}

/// Retrieves raw events from transactions where at least one event within a
/// transaction indicates a transfer of funds.
///
/// Filter by topic="moonlight" and target=TRANSFER_CONTRACT on events for a
/// tx, to get only events from moonlight transactions. (Instead of both
/// phoenix or moonlight transactions)
#[allow(clippy::too_many_arguments)]
#[cfg(feature = "archive")]
async fn moonlight_history(
Expand Down Expand Up @@ -223,7 +230,7 @@ impl Query {
moonlight_tx_by_memo(ctx, memo).await
}

/// Get contract events by height or hash.
/// Get contract events by block height or hash.
#[cfg(feature = "archive")]
async fn contract_events(
&self,
Expand Down
Loading

0 comments on commit c89f7cc

Please sign in to comment.