@@ -43,11 +43,13 @@ describe('unit', () => {
4343
4444 const init = ( ) => {
4545 fakeTLProvider = new FakeTLProvider ( )
46- identityWallet = new IdentityWallet ( fakeTLProvider , FAKE_CHAIN_ID , {
47- identityFactoryAddress : IDENTITY_FACTORY_ADDRESS ,
48- identityImplementationAddress : IDENTITY_IMPLEMENTATION_ADDRESS ,
49- nonceMechanism : NonceMechanism . Random
50- } )
46+ identityWallet = new IdentityWallet (
47+ fakeTLProvider ,
48+ FAKE_CHAIN_ID ,
49+ IDENTITY_FACTORY_ADDRESS ,
50+ IDENTITY_IMPLEMENTATION_ADDRESS ,
51+ NonceMechanism . Random
52+ )
5153 }
5254
5355 describe ( '#create()' , ( ) => {
@@ -233,30 +235,15 @@ describe('unit', () => {
233235 } )
234236
235237 describe ( '#getNonce' , ( ) => {
236- const config = {
237- identityFactoryAddress : IDENTITY_FACTORY_ADDRESS ,
238- identityImplementationAddress : IDENTITY_IMPLEMENTATION_ADDRESS
239- }
240- const randomNonceConfig = {
241- ...config ,
242- nonceMechanism : NonceMechanism . Random
243- }
244- const countingNonceConfig = {
245- ...config ,
246- nonceMechanism : NonceMechanism . Counting
247- }
248- const foreignNonceConfig = {
249- ...config ,
250- nonceMechanism : 'foreign'
251- }
252-
253238 beforeEach ( ( ) => init ( ) )
254239
255240 it ( 'should generate nonce with random mechanism' , async ( ) => {
256241 const randomIdentityWallet = new IdentityWallet (
257242 fakeTLProvider ,
258243 FAKE_CHAIN_ID ,
259- randomNonceConfig
244+ IDENTITY_FACTORY_ADDRESS ,
245+ IDENTITY_IMPLEMENTATION_ADDRESS ,
246+ NonceMechanism . Random
260247 )
261248 assert . isString ( await randomIdentityWallet . getNonce ( ) )
262249 } )
@@ -265,24 +252,14 @@ describe('unit', () => {
265252 const countingIdentityWallet = new IdentityWallet (
266253 fakeTLProvider ,
267254 FAKE_CHAIN_ID ,
268- countingNonceConfig
255+ IDENTITY_FACTORY_ADDRESS ,
256+ IDENTITY_IMPLEMENTATION_ADDRESS ,
257+ NonceMechanism . Counting
269258 )
270259 const walletData = await countingIdentityWallet . create ( )
271260 await countingIdentityWallet . loadFrom ( walletData )
272261 assert . isString ( await countingIdentityWallet . getNonce ( ) )
273262 } )
274-
275- it ( 'should fail to generate nonce with foreign mechanism' , async ( ) => {
276- const foreignIdentityWallet = new IdentityWallet (
277- fakeTLProvider ,
278- FAKE_CHAIN_ID ,
279- foreignNonceConfig
280- )
281- assert . isRejected (
282- foreignIdentityWallet . getNonce ( ) ,
283- 'Can not generate nonce for unknown mechanism: foreign'
284- )
285- } )
286263 } )
287264 } )
288265
0 commit comments