1
1
import { hashBlock , signBlock } from 'nanocurrency' ;
2
2
import { Blocks } from '../../../lib/modules/blocks/blocks' ;
3
- import { CreateBlockParams , SignedBlock } from '../../../lib/modules/blocks/blocks-interface' ;
3
+ import { CreateBlockParams } from '../../../lib/modules/blocks/blocks-interface' ;
4
4
import { Block , BlockInfo } from '../../../lib/modules/blocks/blocks-schema' ;
5
5
import { Rpc } from '../../../lib/services/rpc/rpc' ;
6
- import { randomNanoAddresses } from '../../utils/utils' ;
7
6
8
- jest . mock ( 'nanocurrency' ) ;
7
+ jest . mock ( 'nanocurrency' , ( ) => ( {
8
+ ...jest . requireActual ( 'nanocurrency' ) ,
9
+ hashBlock : jest . fn ( ) ,
10
+ signBlock : jest . fn ( ) ,
11
+ } ) ) ;
9
12
10
13
// TODO: separate all mthods tests in describe blocks
11
14
describe ( 'Blocks' , ( ) => {
@@ -94,7 +97,7 @@ describe('Blocks', () => {
94
97
it ( 'should call block_info RPC method with the provided hash and parse the result' , async ( ) => {
95
98
const hash = 'blockHash' ;
96
99
const infoResponse = {
97
- block_account : 'block_account ' ,
100
+ block_account : 'nano_1t7qkq38d8imy6hoin48ywxpokorxoh8kqz4zntxk6c4qkpsznhitda4a5wo ' ,
98
101
amount : 'amount' ,
99
102
balance : 'balance' ,
100
103
height : 'height' ,
@@ -103,12 +106,12 @@ describe('Blocks', () => {
103
106
confirmed : 'confirmed' ,
104
107
contents : {
105
108
type : 'type' ,
106
- account : 'account ' ,
109
+ account : 'nano_1t7qkq38d8imy6hoin48ywxpokorxoh8kqz4zntxk6c4qkpsznhitda4a5wo ' ,
107
110
previous : 'previous' ,
108
- representative : 'representative ' ,
111
+ representative : 'nano_1tx1oxyczf9mczjnw8k8fktydjekry57aeet8f9cyxtpg9uf56owy4iup6ad ' ,
109
112
balance : 'balance' ,
110
113
link : 'link' ,
111
- link_as_account : 'link_as_account ' ,
114
+ link_as_account : 'nano_3barjiyag1agq4akumc4hstgmjiqd5mhi81y5enkwh95srs76q4fy1j8u4ie ' ,
112
115
signature : 'signature' ,
113
116
work : 'work' ,
114
117
} ,
0 commit comments