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

Return validator addresses in staking entities #1964

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Conversation

iamacook
Copy link
Member

Summary

As it is not possible to always return the current value for exit requests, we will not show the number of validators exiting in the transaction list of the UI. For individual validators, it's then possible to see their respective balances on the beacon chain explorer.

This returns the validators under a new validators property for all staking entities (apart from pre-executed deposits).

Changes

  • Add validators property to:
    • Confirmation view: exit requests and withdrawals
    • Transaction info: deposits (after execution), exit requests and withdrawals

@iamacook iamacook self-assigned this Sep 26, 2024
@coveralls
Copy link

coveralls commented Sep 26, 2024

Pull Request Test Coverage Report for Build 11054300850

Details

  • 11 of 11 (100.0%) changed or added relevant lines in 6 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 90.857%

Files with Coverage Reduction New Missed Lines %
src/routes/transactions/mappers/transfers/transfer-imitation.mapper.ts 1 79.35%
Totals Coverage Status
Change from base Build 11050950814: -0.04%
Covered Lines: 8424
Relevant Lines: 8901

💛 - Coveralls

@iamacook iamacook marked this pull request as ready for review September 26, 2024 12:08
@iamacook iamacook requested a review from a team as a code owner September 26, 2024 12:08
Comment on lines +628 to +639
const validators = [
faker.string.hexadecimal({
length: KilnDecoder.KilnPublicKeyLength,
// Transaction Service returns _publicKeys lowercase
casing: 'lower',
}),
faker.string.hexadecimal({
length: KilnDecoder.KilnPublicKeyLength,
casing: 'lower',
}),
] as Array<`0x${string}`>;
const validatorPublicKey = concat(validators);
Copy link
Member

@hectorgomezv hectorgomezv Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: validators is not being expected in the response, I think it would be better to include it:

      expect(actual).toEqual(
        expect.objectContaining({
          type: 'NativeStakingWithdraw',
          value: withdrawalEventParams.rewards.toString(),
          tokenInfo: {
            address: NULL_ADDRESS,
            decimals: chain.nativeCurrency.decimals,
            logoUri: chain.nativeCurrency.logoUri,
            name: chain.nativeCurrency.name,
            symbol: chain.nativeCurrency.symbol,
            trusted: true,
          },
          validators,
        }),
      );

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 9dd2b7a.

Comment on lines +546 to +557
const validators = [
faker.string.hexadecimal({
length: KilnDecoder.KilnPublicKeyLength,
// Transaction Service returns _publicKeys lowercase
casing: 'lower',
}),
faker.string.hexadecimal({
length: KilnDecoder.KilnPublicKeyLength,
casing: 'lower',
}),
] as Array<`0x${string}`>;
const validatorPublicKey = concat(validators);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: same here, validators is not being checked in the test.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 9dd2b7a.

@iamacook iamacook merged commit 9a56254 into main Sep 26, 2024
18 checks passed
@iamacook iamacook deleted the validator-addresses branch September 26, 2024 14:36
DenSmolonski pushed a commit to Zilliqa/safe-client-gateway that referenced this pull request Oct 24, 2024
Returns the validators under a new `validators` property for all staking entities (apart from pre-executed deposits):

- Add `validators` property to:
  - Confirmation view: exit requests and withdrawals
  - Transaction info: deposits (after execution), exit requests and withdrawals
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