@@ -171,88 +171,88 @@ describe('TransactionHttp', () => {
171171 } ) ;
172172 } ) ;
173173
174- // describe('MosaicDefinitionTransaction', () => {
175- // let listener: Listener;
176- // before (() => {
177- // listener = new Listener(config.apiUrl);
178- // return listener.open();
179- // });
180- // after(() => {
181- // return listener.close();
182- // });
183- // it('aggregate', (done) => {
184- // const nonce = MosaicNonce.createRandom();
185- // const mosaicDefinitionTransaction = MosaicDefinitionTransaction.create(
186- // Deadline.create(),
187- // nonce,
188- // MosaicId.createFromNonce(nonce, account.publicAccount),
189- // MosaicProperties.create({
190- // supplyMutable: true,
191- // transferable: true,
192- // divisibility: 3,
193- // restrictable: true,
194- // }),
195- // NetworkType.MIJIN_TEST,
196- // );
197- // const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(),
198- // [mosaicDefinitionTransaction.toAggregate(account.publicAccount)],
199- // NetworkType.MIJIN_TEST,
200- // []);
201- // const signedTransaction = aggregateTransaction.signWith(account, generationHash);
202- // listener.confirmed(account.address).subscribe((transaction: Transaction) => {
203- // done();
204- // });
205- // listener.status(account.address).subscribe((error) => {
206- // console.log('Error:', error);
207- // assert(false);
208- // done();
209- // });
210- // transactionHttp.announce(signedTransaction);
211- // });
212- // });
213-
214- // describe('AccountMetadataTransaction', () => {
215- // let listener: Listener;
216- // before (() => {
217- // listener = new Listener(config.apiUrl);
218- // return listener.open();
219- // });
220- // after(() => {
221- // return listener.close();
222- // });
223- // it('aggregate', (done) => {
224- // const accountMetadataTransaction = AccountMetadataTransaction.create(
225- // Deadline.create(),
226- // account.publicKey,
227- // UInt64.fromUint(5),
228- // 10 ,
229- // new Uint8Array(10 ),
230- // NetworkType.MIJIN_TEST,
231- // );
232-
233- // const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(),
234- // [accountMetadataTransaction.toAggregate(account.publicAccount)],
235- // NetworkType.MIJIN_TEST,
236- // [],
237- // );
238- // const signedTransaction = aggregateTransaction.signWith(account, generationHash);
239- // listener.confirmed(account.address).subscribe((transaction: AggregateTransaction) => {
240- // transaction.innerTransactions.forEach((innerTx) => {
241- // expect((innerTx as AccountMetadataTransaction).targetPublicKey, 'TargetPublicKey').not.to.be.undefined;
242- // expect((innerTx as AccountMetadataTransaction).scopedMetadataKey, 'ScopedMetadataKey').not.to.be.undefined;
243- // expect((innerTx as AccountMetadataTransaction).valueSizeDelta, 'ValueSizeDelta').not.to.be.undefined;
244- // expect((innerTx as AccountMetadataTransaction).value, 'Value').not.to.be.undefined;
245- // });
246- // done();
247- // });
248- // listener.status(account.address).subscribe((error) => {
249- // console.log('Error:', error);
250- // assert(false);
251- // done();
252- // });
253- // transactionHttp.announce(signedTransaction);
254- // });
255- // });
174+ describe ( 'MosaicDefinitionTransaction' , ( ) => {
175+ let listener : Listener ;
176+ before ( ( ) => {
177+ listener = new Listener ( config . apiUrl ) ;
178+ return listener . open ( ) ;
179+ } ) ;
180+ after ( ( ) => {
181+ return listener . close ( ) ;
182+ } ) ;
183+ it ( 'aggregate' , ( done ) => {
184+ const nonce = MosaicNonce . createRandom ( ) ;
185+ const mosaicDefinitionTransaction = MosaicDefinitionTransaction . create (
186+ Deadline . create ( ) ,
187+ nonce ,
188+ MosaicId . createFromNonce ( nonce , account . publicAccount ) ,
189+ MosaicProperties . create ( {
190+ supplyMutable : true ,
191+ transferable : true ,
192+ divisibility : 3 ,
193+ restrictable : true ,
194+ } ) ,
195+ NetworkType . MIJIN_TEST ,
196+ ) ;
197+ const aggregateTransaction = AggregateTransaction . createComplete ( Deadline . create ( ) ,
198+ [ mosaicDefinitionTransaction . toAggregate ( account . publicAccount ) ] ,
199+ NetworkType . MIJIN_TEST ,
200+ [ ] ) ;
201+ const signedTransaction = aggregateTransaction . signWith ( account , generationHash ) ;
202+ listener . confirmed ( account . address ) . subscribe ( ( transaction : Transaction ) => {
203+ done ( ) ;
204+ } ) ;
205+ listener . status ( account . address ) . subscribe ( ( error ) => {
206+ console . log ( 'Error:' , error ) ;
207+ assert ( false ) ;
208+ done ( ) ;
209+ } ) ;
210+ transactionHttp . announce ( signedTransaction ) ;
211+ } ) ;
212+ } ) ;
213+
214+ describe ( 'AccountMetadataTransaction' , ( ) => {
215+ let listener : Listener ;
216+ before ( ( ) => {
217+ listener = new Listener ( config . apiUrl ) ;
218+ return listener . open ( ) ;
219+ } ) ;
220+ after ( ( ) => {
221+ return listener . close ( ) ;
222+ } ) ;
223+ it ( 'aggregate' , ( done ) => {
224+ const accountMetadataTransaction = AccountMetadataTransaction . create (
225+ Deadline . create ( ) ,
226+ account . publicKey ,
227+ UInt64 . fromUint ( 5 ) ,
228+ 1 ,
229+ new Uint8Array ( 11 ) ,
230+ NetworkType . MIJIN_TEST ,
231+ ) ;
232+
233+ const aggregateTransaction = AggregateTransaction . createComplete ( Deadline . create ( ) ,
234+ [ accountMetadataTransaction . toAggregate ( account . publicAccount ) ] ,
235+ NetworkType . MIJIN_TEST ,
236+ [ ] ,
237+ ) ;
238+ const signedTransaction = aggregateTransaction . signWith ( account , generationHash ) ;
239+ listener . confirmed ( account . address ) . subscribe ( ( transaction : AggregateTransaction ) => {
240+ transaction . innerTransactions . forEach ( ( innerTx ) => {
241+ expect ( ( innerTx as AccountMetadataTransaction ) . targetPublicKey , 'TargetPublicKey' ) . not . to . be . undefined ;
242+ expect ( ( innerTx as AccountMetadataTransaction ) . scopedMetadataKey , 'ScopedMetadataKey' ) . not . to . be . undefined ;
243+ expect ( ( innerTx as AccountMetadataTransaction ) . valueSizeDelta , 'ValueSizeDelta' ) . not . to . be . undefined ;
244+ expect ( ( innerTx as AccountMetadataTransaction ) . value , 'Value' ) . not . to . be . undefined ;
245+ } ) ;
246+ done ( ) ;
247+ } ) ;
248+ listener . status ( account . address ) . subscribe ( ( error ) => {
249+ console . log ( 'Error:' , error ) ;
250+ assert ( false ) ;
251+ done ( ) ;
252+ } ) ;
253+ transactionHttp . announce ( signedTransaction ) ;
254+ } ) ;
255+ } ) ;
256256
257257 describe ( 'MosaicMetadataTransaction' , ( ) => {
258258 let listener : Listener ;
@@ -313,7 +313,7 @@ describe('TransactionHttp', () => {
313313 const registerNamespaceTransaction = NamespaceRegistrationTransaction . createRootNamespace (
314314 Deadline . create ( ) ,
315315 namespaceName ,
316- UInt64 . fromUint ( 5 ) ,
316+ UInt64 . fromUint ( 10 ) ,
317317 NetworkType . MIJIN_TEST ,
318318 ) ;
319319 namespaceId = new NamespaceId ( namespaceName ) ;
0 commit comments