File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -859,14 +859,16 @@ export default class CodeChain {
859859 public async waitForTermChange ( target : number , timeout ?: number ) {
860860 const start = Date . now ( ) ;
861861 while ( true ) {
862- const termMetadata = await stake . getTermMetadata ( this . sdk ) ;
862+ const termMetadata = ( await stake . getTermMetadata ( this . sdk ) ) ! ;
863863 if ( termMetadata && termMetadata . currentTermId >= target ) {
864864 return termMetadata ;
865865 }
866866 await wait ( 1000 ) ;
867867 if ( timeout ) {
868868 if ( Date . now ( ) - start > timeout * 1000 ) {
869- throw new Error ( `Term didn't changed in ${ timeout } s` ) ;
869+ throw new Error (
870+ `Term didn't changed to ${ target } in ${ timeout } s. It is ${ termMetadata . currentTermId } now`
871+ ) ;
870872 }
871873 }
872874 }
You can’t perform that action at this time.
0 commit comments