AccountId20.eq should not fail on null/undefined (#5560)

* AccountId20.eq should not fail on null/undefined

* CHANGELOG
This commit is contained in:
Jaco
2023-03-23 12:34:29 +02:00
committed by GitHub
parent 4f7f7769be
commit b80a28f65d
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -5,6 +5,7 @@
Contributed:
- Add support for new Frontier `AccountId20` mapping (Thanks to https://github.com/koushiro)
- Adjust MMR RPCs & runtime calls to align with latest (Thanks to https://github.com/Lederstrumpf)
Changes:
@@ -12,6 +13,7 @@ Changes:
- Adjust signing header retrieval, catering for discarded state fallbacks
- Basic support for markdown generation for different chains (only Kusama & Polkadot currently added)
- Add not-to-be-used `ISize` type support (same as `USize`, throwing on use - added for completeness)
- Ensure `AccountId20.eq` does not fail on null/undefined inputs
- Expand tests around `toU8a()` where the `isBare` flag is is being used
+1 -1
View File
@@ -36,7 +36,7 @@ export class GenericEthereumAccountId extends U8aFixed {
* @description Compares the value of the input to see if there is a match
*/
public override eq (other?: unknown): boolean {
return super.eq(decodeAccountId(other as AnyU8a));
return !!other && super.eq(decodeAccountId(other as AnyU8a));
}
/**