@@ -64,9 +64,10 @@ describe('Lazy registration of assets', () => {
64
64
fragment = await registryContract [ functionName ] . getFragment ( ...functionArgs )
65
65
assert . isDefined ( fragment )
66
66
67
- unsignedTx = await registryContract [ functionName ] . populateTransaction ( ...functionArgs )
67
+ unsignedTx = await registryContract [ functionName ] . populateTransaction ( ...functionArgs )
68
68
assert . isDefined ( unsignedTx )
69
69
70
+ // unsignedTx.from = relayer.getId()
70
71
console . log ( `unsignedTx: ` , unsignedTx )
71
72
72
73
signedTx = await publisherSigner . signTransaction ( unsignedTx )
@@ -80,27 +81,34 @@ describe('Lazy registration of assets', () => {
80
81
81
82
const gasLimit = await registryContract [ functionName ] . estimateGas ( ...functionArgs , {
82
83
from : relayer . getId ( ) ,
83
- } )
84
- const feeData = await nevermined . utils . contractHandler . getFeeData ( )
84
+ } )
85
85
86
- // const feeData = await nevermined.web3.getFeeData( )
86
+ console . log ( `Relayer ETH balance: ` , await relayer . getEtherBalance ( ) )
87
87
88
+ const feeData = await nevermined . utils . contractHandler . getFeeData ( )
89
+ console . log ( `Fee Data: ` , feeData )
90
+ // const feeData = await nevermined.web3.getFeeData()
91
+
88
92
tx . chainId = await nevermined . keeper . getNetworkId ( )
89
93
tx . type = 2
90
94
tx . nonce = await relayerSigner . getNonce ( )
91
95
tx . gasLimit = gasLimit
92
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
93
- if ( Object . keys ( feeData ) . includes ( 'gasPrice' ) )
94
- tx . gasPrice = Object . values ( feeData ) [ 'gasPrice' ] !
95
- else {
96
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
97
- tx . maxFeePerGas = Object . values ( feeData ) [ 'maxFeePerGas' ] !
98
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
99
- tx . maxPriorityFeePerGas = Object . values ( feeData ) [ 'maxPriorityFeePerGas' ] !
96
+ // tx.value = ethers.parseEther("0.01")
97
+
98
+ if ( Object . keys ( feeData ) . includes ( 'gasPrice' ) ) {
99
+ tx . gasPrice = feeData [ 'gasPrice' ] ! // eslint-disable-line @typescript-eslint/no-non-null-assertion
100
+ } else {
101
+
102
+ // tx.maxFeePerGas = ethers.parseUnits(Math.ceil(Number(feeData['maxFeePerGas']!)) + '', 'wei')
103
+ tx . maxFeePerGas = feeData [ 'maxFeePerGas' ] ! // eslint-disable-line @typescript-eslint/no-non-null-assertion
104
+
105
+ // tx.maxPriorityFeePerGas = ethers.parseUnits(Math.ceil(Number(feeData['maxPriorityFeePerGas']!)) + '', 'wei')
106
+ tx . maxPriorityFeePerGas = feeData [ 'maxPriorityFeePerGas' ] ! // eslint-disable-line @typescript-eslint/no-non-null-assertion
100
107
}
101
108
102
109
console . log ( `Deserialized tx: ` , JSON . stringify ( tx ) )
103
110
111
+ // const txResponse = await publisherSigner.sendTransaction(tx)
104
112
const txResponse = await nevermined . web3 . broadcastTransaction ( tx . serialized )
105
113
106
114
// const txResponse = await provider.sendTransaction(Transaction.from(signedTx))
0 commit comments