Explorer: Fix stake account validation (#11623)

This commit is contained in:
Justin Starry 2020-08-14 10:06:37 +08:00 committed by GitHub
parent 6194a29875
commit 1592597d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ import {
} from "validators/accounts/stake"; } from "validators/accounts/stake";
import BN from "bn.js"; import BN from "bn.js";
const MAX_EPOCH = new BN(2).pow(new BN(64)); const MAX_EPOCH = new BN(2).pow(new BN(64)).sub(new BN(1));
export function StakeAccountSection({ export function StakeAccountSection({
account, account,

View File

@ -1,4 +1,4 @@
import { object, StructType, number, optional, enums } from "superstruct"; import { object, StructType, number, nullable, enums } from "superstruct";
import { Pubkey } from "validators/pubkey"; import { Pubkey } from "validators/pubkey";
import { BigNum } from "validators/bignum"; import { BigNum } from "validators/bignum";
@ -27,7 +27,7 @@ export const StakeMeta = object({
export type StakeAccountInfo = StructType<typeof StakeAccountInfo>; export type StakeAccountInfo = StructType<typeof StakeAccountInfo>;
export const StakeAccountInfo = object({ export const StakeAccountInfo = object({
meta: StakeMeta, meta: StakeMeta,
stake: optional( stake: nullable(
object({ object({
delegation: object({ delegation: object({
voter: Pubkey, voter: Pubkey,