export const buildTestCases = < T extends { title ? : string ; description : string ; } | { title : string ; description ? : string ; } > ( testCases ) : T [ ] => testCases . map ( t => ( { ... t , toString : ( ) => t . title ?? t . description , } ) ) ; export const getAccountFromJSON = ( account ) => ( { ... account , address : Buffer . from ( account . address , 'hex' ) , balance : BigInt ( account . balance ) , publicKey : Buffer . from ( account . publicKey , 'hex' ) , nonce : BigInt ( account . nonce ) , keys : { ... account . keys , mandatoryKeys : account . keys . mandatoryKeys . map ( ( b ) => Buffer . from ( b , 'hex' ) ) , optionalKeys : account . keys . optionalKeys . map ( ( b ) => Buffer . from ( b . data , 'hex' ) ) , } , asset : { ... account . asset , delegate : { ... account . asset . delegate , totalVotesReceived : BigInt ( account . asset . delegate . totalVotesReceived ) , } , sentVotes : account . asset . sentVotes . map ( ( v ) => ( { ... v , delegateAddress : Buffer . from ( v . delegateAddress , 'hex' ) , amount : BigInt ( v . amount ) , } ) ) , unlocking : account . asset . unlocking . map ( ( v ) => ( { ... v , delegateAddress : Buffer . from ( v . delegateAddress , 'hex' ) , amount : BigInt ( v . amount ) , } ) ) , } , } ) ;