Skip to content

Conversation

@zlayine
Copy link
Contributor

@zlayine zlayine commented Mar 8, 2025

PR Type

  • Bug fix

Description

  • Use signingPayloadJson for dynamic era extraction.

  • Add signingPayloadJson field in transaction queries.

  • Remove unused HexString import.

  • Update transaction era assignment.


Changes walkthrough 📝

Relevant files
Bug fix
GetTransaction.ts
Add signingPayloadJson in GetTransaction query                     

resources/js/graphql/query/GetTransaction.ts

  • Added signingPayloadJson field to transaction query.
  • Enhances available transaction fields.
  • +1/-0     
    GetTransactions.ts
    Add signingPayloadJson in GetTransactions query                   

    resources/js/graphql/query/GetTransactions.ts

  • Added signingPayloadJson field to transactions query.
  • Improves transaction data completeness.
  • +1/-0     
    transaction.ts
    Update transaction era assignment using signingPayloadJson

    resources/js/store/transaction.ts

  • Removed unused HexString import.
  • Updated era calculation from signingPayloadJson.
  • Replaced hardcoded era '00' with dynamic value.
  • +2/-3     

    Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @zlayine zlayine requested a review from leonardocustodio March 8, 2025 17:19
    @zlayine zlayine self-assigned this Mar 8, 2025
    @github-actions
    Copy link

    github-actions bot commented Mar 8, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Type Handling

    The dynamic era extraction from signingPayloadJson is introduced without any type conversion or validation. Verify that the new era field from the payload is in the expected format and that any necessary hex conversion (as in the previous implementation) is handled appropriately.

    const era = transaction.signingPayloadJson.era; // 00 is for immortal transactions
    const genesis = genesisHash.toHex(); // The genesis block
    const blockHash = genesisHash.toHex(); // For immortal transactions the blockhash needs to be the genesis
    
    const payloadToSign: SignerPayloadJSON = {
        specVersion: runtime.specVersion.toHex(),
        transactionVersion: runtime.transactionVersion.toHex(),
        address: address,
        blockHash: blockHash,
        blockNumber: '0x00',
        era: era,

    @github-actions
    Copy link

    github-actions bot commented Mar 8, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @leonardocustodio leonardocustodio merged commit 3e9be79 into master Mar 8, 2025
    4 checks passed
    @leonardocustodio leonardocustodio deleted the bugfix/PLA-2209/set-transaction-era branch March 8, 2025 17:21
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Development

    Successfully merging this pull request may close these issues.

    2 participants