import { SignedTransaction , RollupBlock , RollupTransitionPosition , RollupTransition , LocalFraudProof , StateSnapshot , } from './types' ; import { ContractFraudProof } from '../validator' ; export interface RollupStateValidator { returns getCurrentVerifiedPosition ( ) : Promise < RollupTransitionPosition > ; returns getTransactionFromTransitionAndSnapshots ( transition , snapshots ) : Promise < SignedTransaction > ; param nextTransition returns checkNextTransition ( nextTransition ) : Promise < LocalFraudProof > ; param blockNumber returns validateStoredBlock ( blockNumber ) : Promise < ContractFraudProof > ; param newBlock returns storeBlock ( newBlock ) : Promise < void > ; } export class LocalMachineError extends Error { constructor ( ) { super ( 'Transaction application failed for a reason other than the tx being invalid!' ) ; } } export class ValidationOutOfOrderError extends Error { constructor ( ) { super ( 'Blocks were fed to the validator out of sync.' ) ; } } export class AggregatorUnsupportedError extends Error { constructor ( ) { super ( 'We are currently unable to guard addresses which are created non-sequentially.' ) ; } }