@@ -785,6 +785,41 @@ describe('Avalanche C-Chain', function () {
785785 } ) ;
786786 } ) ;
787787
788+ describe ( 'Hop Transaction Parameters' , ( ) => {
789+ const sandBox = sinon . createSandbox ( ) ;
790+
791+ afterEach ( function ( ) {
792+ sandBox . restore ( ) ;
793+ } ) ;
794+
795+ it ( 'should create hop transaction parameters with gasPriceMax > 0' , async function ( ) {
796+ const mockFeeEstimate = {
797+ feeEstimate : '120000' ,
798+ gasLimitEstimate : 500000 ,
799+ } ;
800+ sandBox . stub ( tavaxCoin , 'feeEstimate' ) . resolves ( mockFeeEstimate ) ;
801+ const recipients = [
802+ {
803+ address :
804+ 'P-fuji14xa0q4858ct3kfvpkwnw2dys3m63kt6famckf6~P-fuji1hljye3kesjtpj87m00e8vwkayg6eys6theuxfg~P-fuji1lelqx4cleh3dzk5kplstz6mwrt3duk7d7wwmpp' ,
805+ amount : '100000000000000000' ,
806+ } ,
807+ ] ;
808+
809+ const result = await tavaxCoin . createHopTransactionParams ( {
810+ recipients,
811+ type : 'Export' as keyof typeof TransactionType ,
812+ } ) ;
813+
814+ result . should . have . property ( 'hopParams' ) ;
815+ result . hopParams . should . have . properties ( [ 'userReqSig' , 'gasPriceMax' , 'paymentId' , 'gasLimit' ] ) ;
816+ result . hopParams . userReqSig . should . equal ( '0x' ) ;
817+ result . hopParams . gasPriceMax . should . be . above ( 0 ) ;
818+ result . hopParams . paymentId . should . be . a . String ( ) ;
819+ result . hopParams . gasLimit . should . equal ( 500000 ) ;
820+ } ) ;
821+ } ) ;
822+
788823 describe ( 'Explain Transaction' , ( ) => {
789824 it ( 'should explain a half signed import in C transaction' , async ( ) => {
790825 const testData = IMPORT_C ;
0 commit comments