Skip to content

Commit 8bc4a25

Browse files
committed
rusk: add from_block, to_block & max_count params to full_moonlight_history in gql
1 parent 3ca7dec commit 8bc4a25

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

rusk/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Add `Content-Type: application/json` support for `/on/contracts` endpoint
1313
- Add transaction serialization check
1414
- Add max transaction size check
15+
- Add from_block, to_block & max_count params to `full_moonlight_history` in gql [#3613]
1516

1617
## [1.2.0] - 2025-03-20
1718

@@ -364,6 +365,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
364365
- Add build system that generates keys for circuits and caches them.
365366

366367
<!-- Issues -->
368+
[#3613]: https://github.com/dusk-network/rusk/issues/3613
367369
[#3512]: https://github.com/dusk-network/rusk/issues/3512
368370
[#3507]: https://github.com/dusk-network/rusk/issues/3507
369371
[#3494]: https://github.com/dusk-network/rusk/issues/3494

rusk/src/lib/http/chain/graphql.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,14 @@ impl Query {
184184
ctx: &Context<'_>,
185185
address: String,
186186
ord: Option<String>,
187+
from_block: Option<u64>,
188+
to_block: Option<u64>,
189+
max_count: Option<usize>,
187190
) -> OptResult<MoonlightTransfers> {
188-
full_moonlight_history(ctx, address, ord).await
191+
full_moonlight_history(
192+
ctx, address, ord, from_block, to_block, max_count,
193+
)
194+
.await
189195
}
190196

191197
/// Retrieves raw events from transactions where at least one event within a

rusk/src/lib/http/chain/graphql/archive/moonlight.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ pub async fn full_moonlight_history(
1919
ctx: &Context<'_>,
2020
address: String,
2121
ordering: Option<String>,
22+
from_block: Option<u64>,
23+
to_block: Option<u64>,
24+
max_count: Option<usize>,
2225
) -> OptResult<MoonlightTransfers> {
2326
let (_, archive) = ctx.data::<DBContext>()?;
2427
let v = bs58::decode(address).into_vec()?;
@@ -36,7 +39,9 @@ pub async fn full_moonlight_history(
3639
_ => None,
3740
};
3841

39-
if let Some(moonlight_events) = archive.full_moonlight_history(pk, ord)? {
42+
if let Some(moonlight_events) = archive
43+
.full_moonlight_history(pk, ord, from_block, to_block, max_count)?
44+
{
4045
Ok(Some(MoonlightTransfers(moonlight_events)))
4146
} else {
4247
Ok(None)

0 commit comments

Comments
 (0)