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

Fix epochDelegateAccount GraphQL command to match its description #15949

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

mrmr1993
Copy link
Member

This PR fixes epochDelegateAccount so that its behaviour matches the description, returning the account from the staking ledger to which this account has delegated. It has been broken since its inception in #3904, where its behaviour has been to always return the same account from the current staking ledger.

@mrmr1993 mrmr1993 requested a review from a team as a code owner August 21, 2024 11:56
@mrmr1993
Copy link
Member Author

!ci-build-me

@svv232
Copy link
Member

svv232 commented Aug 21, 2024

I have tested this with a local devnet node running these changes:

this request:

query MyQuery {
  version
  account(publicKey: "B62qpfgnUm7zVqi8MJHNB2m37rtgMNDbFNhC2DpMmmVpQt8x6gKv9Ww") {
    epochDelegateAccount {
      nonce
      inferredNonce
      receiptChainHash
      delegate
      votingFor
      locked
      index
      zkappUri
      provedState
      tokenSymbol
      leafHash
    }
  }
}

yields this response:

{
  "data": {
    "version": "7bbbbff4ffc9c44f2ef55c88f24f302183e03080",
    "account": {
      "epochDelegateAccount": {
        "nonce": "2",
        "inferredNonce": "2",
        "receiptChainHash": "2n22gwywRfoiMv9hraotYwan7yRm78pwvdgDBcSfW5TYbtJVgp92",
        "delegate": "B62qohbCC7T1vuZcoRifiu7t2T9nWeWKmmB84XpzEMN2LnhEMw6Pkd5",
        "votingFor": "2mzWc7ZF8hRKvLyoLpKLZ3TSm8XSjfxZq67dphJpnjhYmU5Vja5Q",
        "locked": null,
        "index": 10747,
        "zkappUri": null,
        "provedState": null,
        "tokenSymbol": "",
        "leafHash": "17116368938849220799805337553686664893477144178746778846453787514071392809639"
      }
    }
  }
}

notice how the public key and the delegate address differ along with the nonce in accordance with the account information in https://minascan.io/devnet/account/B62qpfgnUm7zVqi8MJHNB2m37rtgMNDbFNhC2DpMmmVpQt8x6gKv9Ww/txs

@mrmr1993 mrmr1993 merged commit 48b627d into compatible Aug 22, 2024
42 checks passed
@mrmr1993 mrmr1993 deleted the feature/fix-epochDelegateAccount branch August 22, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants