11import { assert } from 'chai' ;
22import Config from './helpers/config.js' ;
3- import { TronWeb , providers } from './setup/TronWeb.js' ;
3+ import { Contract , TronWeb , providers } from './setup/TronWeb.js' ;
44import tronWebBuilder from './helpers/tronWebBuilder.js' ;
55import BigNumber from 'bignumber.js' ;
66import broadcaster from './helpers/broadcaster.js' ;
77import wait from './helpers/wait.js' ;
88import { Address } from '../src/types/Trx.js' ;
9- import { IContract } from '../src/lib/contract/index.js' ;
109import { RawAxiosRequestHeaders } from 'axios' ;
1110
1211const HttpProvider = providers . HttpProvider ;
@@ -754,7 +753,7 @@ describe('TronWeb Instance', function () {
754753 } ;
755754 let tronWeb : TronWeb ;
756755 let contractAddress ;
757- let contract : IContract ;
756+ let contract : Contract ;
758757
759758 before ( async function ( ) {
760759 tronWeb = tronWebBuilder . createInstance ( ) ;
@@ -814,13 +813,13 @@ describe('TronWeb Instance', function () {
814813 ) ;
815814
816815 contractAddress = result . receipt . transaction . contract_address ! ;
817- contract = ( await tronWeb . contract ( ) . at ( contractAddress ) ) as unknown as IContract ;
816+ contract = await tronWeb . contract ( ) . at ( contractAddress ) ;
818817 } ) ;
819818
820819 it ( 'should emit an unconfirmed event and get it' , async function ( ) {
821820 this . timeout ( 60000 ) ;
822821 tronWeb . setPrivateKey ( accounts . pks [ 1 ] ) ;
823- let txId = await contract . emitNow ( accounts . hex [ 2 ] , 2000 ) . send ( {
822+ let txId = await contract . methods . emitNow ( accounts . hex [ 2 ] , 2000 ) . send ( {
824823 from : accounts . hex [ 1 ] ,
825824 } ) ;
826825 let events ;
@@ -845,7 +844,7 @@ describe('TronWeb Instance', function () {
845844 } ;
846845 let tronWeb : TronWeb ;
847846 let contractAddress : Address ;
848- let contract : IContract ;
847+ let contract : Contract ;
849848 let eventLength = 0 ;
850849
851850 before ( async function ( ) {
@@ -906,15 +905,15 @@ describe('TronWeb Instance', function () {
906905 ) ;
907906
908907 contractAddress = result . receipt . transaction . contract_address ! ;
909- contract = ( await tronWeb . contract ( ) . at ( contractAddress ) ) as unknown as IContract ;
908+ contract = await tronWeb . contract ( ) . at ( contractAddress ) ;
910909 } ) ;
911910
912911 // available on trongrid
913912 it . skip ( 'should emit an event and wait for it' , async function ( ) {
914913 this . timeout ( 60000 ) ;
915914 await wait ( 120 ) ; // wait for abi syncing.
916915 tronWeb . setPrivateKey ( accounts . pks [ 3 ] ) ;
917- await contract . emitNow ( accounts . hex [ 4 ] , 4000 ) . send ( {
916+ await contract . methods . emitNow ( accounts . hex [ 4 ] , 4000 ) . send ( {
918917 from : accounts . hex [ 3 ] ,
919918 } ) ;
920919 eventLength ++ ;
0 commit comments