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";
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({
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 { BigNum } from "validators/bignum";
@ -27,7 +27,7 @@ export const StakeMeta = object({
export type StakeAccountInfo = StructType<typeof StakeAccountInfo>;
export const StakeAccountInfo = object({
meta: StakeMeta,
stake: optional(
stake: nullable(
object({
delegation: object({
voter: Pubkey,