Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: fix transaction_chain when the paging_address == genesis_address #1504

Conversation

bchamagne
Copy link
Member

@bchamagne bchamagne commented Apr 17, 2024

Description

When querying a chain with paging_state = genesis we should act as if paging_state is nil

Example of broken behaviour (testnet data)

query {
 transactionChain(
    address: "00006AF4C3AE64D435DA162B27918D6BE3AF8610494E3021148709BBE11A5520334C",
    pagingAddress: "00006AF4C3AE64D435DA162B27918D6BE3AF8610494E3021148709BBE11A5520334C"
  ) {
		address
    
  }
}

This should reply the same thing as the following query

query {
 transactionChain(
    address: "00006AF4C3AE64D435DA162B27918D6BE3AF8610494E3021148709BBE11A5520334C"
  ) {
		address
  }
}

It currently return empty (instead of 2 txs)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Unit test + manual test

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@bchamagne bchamagne added bug Something isn't working API Involve API facing user labels Apr 17, 2024
@bchamagne bchamagne changed the title Fix TransactionChain.fetch with paging=genesis API: fix transaction_chain when the paging_address == genesis_address Apr 17, 2024
lib/archethic/transaction_chain.ex Outdated Show resolved Hide resolved
@bchamagne bchamagne force-pushed the fix-fetch-with-paging-equals-genesis branch from 934a4c9 to 2743df8 Compare April 18, 2024 09:47
@bchamagne bchamagne requested a review from Neylix April 18, 2024 09:47
@Neylix Neylix merged commit 30fcaeb into archethic-foundation:develop Apr 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Involve API facing user bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants