File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ export class NodeHttp extends Http implements NodeRepository {
7272 ( body ) => {
7373 const nodeTimeDTO = body ;
7474 if ( nodeTimeDTO . communicationTimestamps . sendTimestamp && nodeTimeDTO . communicationTimestamps . receiveTimestamp ) {
75- return new NodeTime ( UInt64 . fromNumericString ( nodeTimeDTO . communicationTimestamps . sendTimestamp ) . toDTO ( ) ,
76- UInt64 . fromNumericString ( nodeTimeDTO . communicationTimestamps . receiveTimestamp ) . toDTO ( ) ) ;
75+ return new NodeTime ( UInt64 . fromNumericString ( nodeTimeDTO . communicationTimestamps . sendTimestamp ) ,
76+ UInt64 . fromNumericString ( nodeTimeDTO . communicationTimestamps . receiveTimestamp ) ) ;
7777 }
7878 throw Error ( 'Node time not available' ) ;
7979 } ,
Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- import { NetworkType } from '../blockchain/NetworkType' ;
1716import { UInt64 } from '../UInt64' ;
18- import { RoleType } from './RoleType' ;
1917/**
2018 * The node info structure describes basic information of a node.
2119 */
@@ -28,9 +26,9 @@ export class NodeTime {
2826 constructor ( /**
2927 * The request send timestamp
3028 */
31- public readonly sendTimeStamp ?: number [ ] ,
29+ public readonly sendTimeStamp ?: UInt64 ,
3230 /**
3331 * The request received timestamp
3432 */
35- public readonly receiveTimeStamp ?: number [ ] ) { }
33+ public readonly receiveTimeStamp ?: UInt64 ) { }
3634}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import {
2626 RolesTypeEnum ,
2727 ServerDTO ,
2828 ServerInfoDTO ,
29- StorageInfoDTO
29+ StorageInfoDTO ,
3030} from 'symbol-openapi-typescript-node-client' ;
3131import { instance , mock , reset , when } from 'ts-mockito' ;
3232import { DtoMapping } from '../../src/core/utils/DtoMapping' ;
@@ -125,8 +125,10 @@ describe('NodeHttp', () => {
125125
126126 const nodeTime = await nodeRepository . getNodeTime ( ) . toPromise ( ) ;
127127 expect ( nodeTime ) . to . be . not . null ;
128- expect ( nodeTime . receiveTimeStamp ) . to . deep . equals ( [ 1111 , 0 ] ) ;
129- expect ( nodeTime . sendTimeStamp ) . to . deep . equals ( [ 2222 , 0 ] ) ;
128+ if ( nodeTime . receiveTimeStamp && nodeTime . sendTimeStamp ) {
129+ expect ( nodeTime . receiveTimeStamp . toDTO ( ) ) . to . deep . equals ( [ 1111 , 0 ] ) ;
130+ expect ( nodeTime . sendTimeStamp . toDTO ( ) ) . to . deep . equals ( [ 2222 , 0 ] ) ;
131+ }
130132 } ) ;
131133
132134 it ( 'getNodeTim When No Timestamp' , async ( ) => {
You can’t perform that action at this time.
0 commit comments