Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

RewardAccount: validate header type bits and bech32 prefix

オープン 初心者向け
#456 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
typescript
領域
api

調査の方向性

packages/evolution/src/RewardAccount.ts の FromBech32 と FromBytes から始め、次に Address.FromBech32 にある既存のチェックと #391 に関連する変更を比較します。reward ではないヘッダーと stake ではないプレフィックスを拒否しつつ、有効な stake および stake_test のラウンドトリップを維持するテストを追加します。これらのケースが指定どおりにパースされるか失敗すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement external-review

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.

主要言語
TypeScript
スター
22
フォーク
30
平均マージ
4日 13時間
マージ済み PR(30日)
25

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

IntersectMBO/evolution-sdk のほかの issue

IntersectMBO/evolution-sdk の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。