Skip to content

Commit 2350f4e

Browse files
committed
fix(client): align getCurrentValidators auto-renew fields with helicon-fuji
1 parent 7239019 commit 2350f4e

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

client/src/methods/pChain/types/getCurrentValidators.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type GetCurrentValidatorsParameters = {
3131
* @property validators[].validationRewardOwner - Specifies the owner of the potential reward earned from staking. Includes locktime, threshold, and an array of addresses. Omitted if subnetID is not the Primary Network
3232
* @property validators[].delegationRewardOwner - Specifies the owner of the potential reward earned from delegations. Includes locktime, threshold, and an array of addresses. Omitted if subnetID is not the Primary Network
3333
* @property validators[].validatorAuthority - Specifies the owner authorized to update auto-renewed validator config. Includes locktime, threshold, and an array of addresses. Only present for auto-renewed validators
34-
* @property validators[].period - Auto-renewed validator cycle period in seconds. Only present for auto-renewed validators
34+
* @property validators[].nextPeriod - Duration of the next auto-renewed validation cycle in seconds. Only present for auto-renewed validators
3535
* @property validators[].autoCompoundRewardShares - Auto-compound reward shares in parts per million. Only present for auto-renewed validators
3636
* @property validators[].signer - The node's BLS public key and proof of possession. Omitted if the validator doesn't have a BLS public key. Omitted if subnetID is not the Primary Network
3737
* @property validators[].delegatorCount - The number of delegators on this validator. Omitted if subnetID is not the Primary Network
@@ -124,10 +124,10 @@ export type GetCurrentValidatorsReturnType = {
124124
};
125125

126126
/**
127-
* Auto-renewed validator cycle period in seconds.
127+
* Duration of the next auto-renewed validation cycle in seconds.
128128
* Only present for auto-renewed validators.
129129
*/
130-
period?: string;
130+
nextPeriod?: string;
131131

132132
/**
133133
* Auto-compound reward shares in parts per million.

client/src/methods/wallet/pChain/addAutoRenewedValidatorTxCompat.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ const removeSerializedWeight = (
9191
* `unexpectedLayout()` rather than emitting a silently-corrupted, validly-signed
9292
* staking tx. We can't read the installed AvalancheJS version at runtime (its
9393
* `exports` map hides `package.json`), so the exact version pin in `package.json`
94-
* plus these structural checks are the guard. ACP-236's wire format is not yet
95-
* frozen (devnet only); revisit this whenever AvalancheJS is bumped.
94+
* plus these structural checks are the guard. ACP-236's wire format is frozen
95+
* (avalanche-foundation/ACPs#294) and AvalancheJS serializes it natively as of
96+
* ava-labs/avalanchejs#1000 (releases >= 5.1.1), which also removes the
97+
* `weight` property this shim reads — so the shim would throw there. Delete it
98+
* and use the native serialization when the `@avalabs/avalanchejs` pin is
99+
* bumped to a release containing that fix.
96100
*/
97101
export function useAvalancheGoAddAutoRenewedValidatorTxSerialization(
98102
tx: AddAutoRenewedValidatorTx

e2e/test/acp236-auto-renewed-validator.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ async function waitForAutoRenewedValidatorConfig(
139139
lastValidators = validators;
140140
const validator = validators.find((candidate) => candidate.txID === txID);
141141
if (
142-
validator?.period === expectedPeriod.toString() &&
142+
validator?.nextPeriod === expectedPeriod.toString() &&
143143
validator.autoCompoundRewardShares === expectedAutoCompoundRewardShares.toString()
144144
) {
145145
return validator;

0 commit comments

Comments
 (0)