11import { Transaction } from '../../src' ;
22import { coins } from '@bitgo/statics' ;
33import assert from 'assert' ;
4- import should from 'should' ;
4+ // import should from 'should';
55import { Utils } from '../../src/lib/utils' ;
6- import { InvalidTransactionError , TransactionType as BitGoTransactionType } from '@bitgo/sdk-core' ;
7- import { rawTransaction , accounts , parsedRawTransaction } from '../resources/icp' ;
6+ import { InvalidTransactionError } from '@bitgo/sdk-core' ;
7+ // import { rawTransaction, accounts, parsedRawTransaction } from '../resources/icp';
88import sinon from 'sinon' ;
99
1010describe ( 'ICP Transaction' , ( ) => {
1111 let tx : Transaction ;
1212 let utils : Utils ;
13- let localRawTransaction : any ;
13+ // let localRawTransaction: any;
1414 const config = coins . get ( 'ticp' ) ;
1515
1616 beforeEach ( ( ) => {
1717 utils = new Utils ( ) ;
1818 tx = new Transaction ( config , utils ) ;
19- localRawTransaction = JSON . stringify ( rawTransaction ) ;
19+ // localRawTransaction = JSON.stringify(rawTransaction);
2020 sinon . stub ( utils , 'validateExpireTime' ) . returns ( true ) ;
2121 } ) ;
2222
@@ -35,42 +35,42 @@ describe('ICP Transaction', () => {
3535 } ) ;
3636 } ) ;
3737
38- describe ( 'from raw transaction' , ( ) => {
39- it ( 'build a json transaction from raw hex' , async ( ) => {
40- await tx . fromRawTransaction ( localRawTransaction ) ;
41- const json = tx . toJson ( ) ;
42- should . equal ( json . memo , parsedRawTransaction . metadata . memo ) ;
43- should . equal ( json . feeAmount , parsedRawTransaction . operations [ 2 ] . amount . value ) ;
44- should . equal ( json . sender , parsedRawTransaction . operations [ 0 ] . account . address ) ;
45- should . equal ( json . recipient , parsedRawTransaction . operations [ 1 ] . account . address ) ;
46- should . equal ( json . type , BitGoTransactionType . Send ) ;
47- should . equal ( json . senderPublicKey , accounts . account1 . publicKey ) ;
48- } ) ;
49- } ) ;
38+ // describe('from raw transaction', () => {
39+ // it('build a json transaction from raw hex', async () => {
40+ // await tx.fromRawTransaction(localRawTransaction);
41+ // const json = tx.toJson();
42+ // should.equal(json.memo, parsedRawTransaction.metadata.memo);
43+ // should.equal(json.feeAmount, parsedRawTransaction.operations[2].amount.value);
44+ // should.equal(json.sender, parsedRawTransaction.operations[0].account.address);
45+ // should.equal(json.recipient, parsedRawTransaction.operations[1].account.address);
46+ // should.equal(json.type, BitGoTransactionType.Send);
47+ // should.equal(json.senderPublicKey, accounts.account1.publicKey);
48+ // });
49+ // });
5050
51- describe ( 'Explain' , ( ) => {
52- it ( 'explain transaction' , async ( ) => {
53- await tx . fromRawTransaction ( localRawTransaction ) ;
54- const explain = tx . explainTransaction ( ) ;
51+ // describe('Explain', () => {
52+ // it('explain transaction', async () => {
53+ // await tx.fromRawTransaction(localRawTransaction);
54+ // const explain = tx.explainTransaction();
5555
56- explain . outputAmount . should . equal ( '1000000' ) ;
57- explain . outputs [ 0 ] . amount . should . equal ( '1000000' ) ;
58- explain . outputs [ 0 ] . address . should . equal ( accounts . account2 . address ) ;
59- explain . fee . fee . should . equal ( '-10000' ) ;
60- explain . changeAmount . should . equal ( '0' ) ;
61- if ( explain . displayOrder !== undefined ) {
62- explain . displayOrder . should . deepEqual ( [
63- 'id' ,
64- 'outputAmount' ,
65- 'changeAmount' ,
66- 'outputs' ,
67- 'changeOutputs' ,
68- 'fee' ,
69- ] ) ;
70- }
71- if ( explain . type !== undefined ) {
72- explain . type . should . equal ( BitGoTransactionType . Send ) ;
73- }
74- } ) ;
75- } ) ;
56+ // explain.outputAmount.should.equal('1000000');
57+ // explain.outputs[0].amount.should.equal('1000000');
58+ // explain.outputs[0].address.should.equal(accounts.account2.address);
59+ // explain.fee.fee.should.equal('-10000');
60+ // explain.changeAmount.should.equal('0');
61+ // if (explain.displayOrder !== undefined) {
62+ // explain.displayOrder.should.deepEqual([
63+ // 'id',
64+ // 'outputAmount',
65+ // 'changeAmount',
66+ // 'outputs',
67+ // 'changeOutputs',
68+ // 'fee',
69+ // ]);
70+ // }
71+ // if (explain.type !== undefined) {
72+ // explain.type.should.equal(BitGoTransactionType.Send);
73+ // }
74+ // });
75+ // });
7676} ) ;
0 commit comments