@@ -770,64 +770,27 @@ Method.prototype.buildCall = function () {
770
770
return method . requestManager . send ( payload , sendTxCallback ) ;
771
771
} ;
772
772
773
- // Send the actual transaction
774
- // if (isSendTx
775
- // && !!payload.params[0]
776
- // && typeof payload.params[0] === 'object'
777
- // && typeof payload.params[0].gasPrice === 'undefined'
778
- // ) {
779
-
780
- // var getGasPrice = (new Method({
781
- // name: 'getGasPrice',
782
- // call: 'eth_gasPrice',
783
- // params: 0
784
- // })).createFunction(method.requestManager);
785
-
786
- // getGasPrice(function (err, gasPrice) {
787
-
788
- // if (gasPrice) {
789
- // payload.params[0].gasPrice = gasPrice;
790
- // }
791
-
792
- // if (isSendTx) {
793
- // setTimeout(() => {
794
- // defer.eventEmitter.emit('sending', payload);
795
- // }, 0);
796
- // }
797
-
798
- // sendRequest(payload, method);
799
- // });
800
-
801
- // } else {
802
- // if (isSendTx) {
803
- // setTimeout(() => {
804
- // defer.eventEmitter.emit('sending', payload);
805
- // }, 0);
806
- // }
807
-
808
- // sendRequest(payload, method);
809
- // }
810
-
811
773
// Send the actual transaction
812
774
if ( isSendTx
813
775
&& ! ! payload . params [ 0 ]
814
776
&& typeof payload . params [ 0 ] === 'object'
815
777
&& typeof payload . params [ 0 ] . gasPrice === 'undefined'
816
- // && (
817
- // typeof payload.params[0].gasPrice === 'undefined'
818
- // && (
819
- // typeof payload.params[0].maxPriorityFeePerGas === 'undefined'
820
- // || typeof payload.params[0].maxFeePerGas === 'undefined'
821
- // )
822
- // )
823
778
) {
824
- // if (typeof payload.params[0].type === 'undefined')
825
- // payload.params[0].type = _handleTxType(payload.params[0]);
826
779
827
- _handleTxPricing ( method , payload . params [ 0 ] ) . then ( txPricing => {
828
- console . log ( 'debug1' , payload )
829
- payload . params [ 0 ] = { ...payload . params [ 0 ] , ...txPricing } ;
830
- console . log ( 'debug2' , payload )
780
+ var getGasPrice = ( new Method ( {
781
+ name : 'getGasPrice' ,
782
+ call : 'eth_gasPrice' ,
783
+ params : 0
784
+ } ) ) . createFunction ( method . requestManager ) ;
785
+
786
+ getGasPrice ( function ( err , gasPrice ) {
787
+ console . log ( 'debug1' , gasPrice , payload )
788
+
789
+ if ( gasPrice ) {
790
+ payload . params [ 0 ] . gasPrice = gasPrice ;
791
+ }
792
+
793
+ console . log ( 'debug2' , gasPrice , payload )
831
794
832
795
if ( isSendTx ) {
833
796
setTimeout ( ( ) => {
@@ -836,7 +799,8 @@ Method.prototype.buildCall = function () {
836
799
}
837
800
838
801
sendRequest ( payload , method ) ;
839
- } )
802
+ } ) ;
803
+
840
804
} else {
841
805
if ( isSendTx ) {
842
806
setTimeout ( ( ) => {
@@ -847,11 +811,50 @@ Method.prototype.buildCall = function () {
847
811
sendRequest ( payload , method ) ;
848
812
}
849
813
850
- if ( isSendTx ) {
851
- setTimeout ( ( ) => {
852
- defer . eventEmitter . emit ( 'sent' , payload ) ;
853
- } , 0 ) ;
854
- }
814
+ // Send the actual transaction
815
+ // if (isSendTx
816
+ // && !!payload.params[0]
817
+ // && typeof payload.params[0] === 'object'
818
+ // && typeof payload.params[0].gasPrice === 'undefined'
819
+ // // && (
820
+ // // typeof payload.params[0].gasPrice === 'undefined'
821
+ // // && (
822
+ // // typeof payload.params[0].maxPriorityFeePerGas === 'undefined'
823
+ // // || typeof payload.params[0].maxFeePerGas === 'undefined'
824
+ // // )
825
+ // // )
826
+ // ) {
827
+ // // if (typeof payload.params[0].type === 'undefined')
828
+ // // payload.params[0].type = _handleTxType(payload.params[0]);
829
+
830
+ // _handleTxPricing(method, payload.params[0]).then(txPricing => {
831
+ // console.log('debug1', payload)
832
+ // payload.params[0] = {...payload.params[0], ...txPricing};
833
+ // console.log('debug2', payload)
834
+
835
+ // if (isSendTx) {
836
+ // setTimeout(() => {
837
+ // defer.eventEmitter.emit('sending', payload);
838
+ // }, 0);
839
+ // }
840
+
841
+ // sendRequest(payload, method);
842
+ // })
843
+ // } else {
844
+ // if (isSendTx) {
845
+ // setTimeout(() => {
846
+ // defer.eventEmitter.emit('sending', payload);
847
+ // }, 0);
848
+ // }
849
+
850
+ // sendRequest(payload, method);
851
+ // }
852
+
853
+ // if (isSendTx) {
854
+ // setTimeout(() => {
855
+ // defer.eventEmitter.emit('sent', payload);
856
+ // }, 0);
857
+ // }
855
858
856
859
return defer . eventEmitter ;
857
860
} ;
0 commit comments