Summary
RewardAccount parsing is looser than Address parsing for the same class of input. RewardAccount.FromBech32 does not check the bech32 human-readable prefix, and RewardAccount.FromBytes does not validate the CIP-19 header type nibble. As a result, a non-stake prefix and a non-reward header type can still parse into a RewardAccount. This is the RewardAccount-side counterpart to #391, which added the equivalent checks on Address / EnterpriseAddress / BaseAddress.
Affected
- packages/evolution/src/RewardAccount.ts — FromBech32 (prefix not checked)
- packages/evolution/src/RewardAccount.ts — FromBytes (header type nibble not validated)
Fix
FromBytes: require the header type to be a reward type (14/15); reject others.
FromBech32: require the prefix to be stake / stake_test and to agree with the header networkId.
Mirror the checks already present in Address.FromBech32.
Test
Add coverage asserting that a non-reward header and a non-stake prefix both fail to parse as a RewardAccount, and that valid stake / stake_test inputs still round-trip.
Summary
RewardAccountparsing is looser thanAddressparsing for the same class of input.RewardAccount.FromBech32does not check the bech32 human-readable prefix, andRewardAccount.FromBytesdoes not validate the CIP-19 header type nibble. As a result, a non-stakeprefix and a non-reward header type can still parse into aRewardAccount. This is theRewardAccount-side counterpart to #391, which added the equivalent checks onAddress/EnterpriseAddress/BaseAddress.Affected
Fix
FromBytes: require the header type to be a reward type (14/15); reject others.FromBech32: require the prefix to bestake/stake_testand to agree with the header networkId.Mirror the checks already present in
Address.FromBech32.Test
Add coverage asserting that a non-reward header and a non-
stakeprefix both fail to parse as aRewardAccount, and that validstake/stake_testinputs still round-trip.