Commit 55ee461e authored by Liam Horne's avatar Liam Horne Committed by GitHub

refactor: improve logging for transactions being submitted to chain with gasPrice (#1016)

* refactor: improve logging for transactions being submitted to chain with gasPrice

* lint: apply lint autofixes
parent 1c1e405c
...@@ -178,15 +178,18 @@ export class StateBatchSubmitter extends BatchSubmitter { ...@@ -178,15 +178,18 @@ export class StateBatchSubmitter extends BatchSubmitter {
const nonce = await this.signer.getTransactionCount() const nonce = await this.signer.getTransactionCount()
const contractFunction = async (gasPrice): Promise<TransactionReceipt> => { const contractFunction = async (gasPrice): Promise<TransactionReceipt> => {
this.logger.info('Submitting appendStateBatch transaction', {
gasPrice,
nonce,
contractAddr: this.chainContract.address,
})
const contractTx = await this.chainContract.appendStateBatch( const contractTx = await this.chainContract.appendStateBatch(
batch, batch,
offsetStartsAtIndex, offsetStartsAtIndex,
{ nonce, gasPrice } { nonce, gasPrice }
) )
this.logger.info('Submitted appendStateBatch transaction', { this.logger.info('Submitted appendStateBatch transaction', {
nonce,
txHash: contractTx.hash, txHash: contractTx.hash,
contractAddr: this.chainContract.address,
from: contractTx.from, from: contractTx.from,
}) })
this.logger.debug('appendStateBatch transaction data', { this.logger.debug('appendStateBatch transaction data', {
......
...@@ -143,14 +143,17 @@ export class TransactionBatchSubmitter extends BatchSubmitter { ...@@ -143,14 +143,17 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
const contractFunction = async ( const contractFunction = async (
gasPrice gasPrice
): Promise<TransactionReceipt> => { ): Promise<TransactionReceipt> => {
this.logger.info('Submitting appendQueueBatch transaction', {
gasPrice,
nonce,
contractAddr: this.chainContract.address,
})
const tx = await this.chainContract.appendQueueBatch(99999999, { const tx = await this.chainContract.appendQueueBatch(99999999, {
nonce, nonce,
gasPrice, gasPrice,
}) })
this.logger.info('Submitted appendQueueBatch transaction', { this.logger.info('Submitted appendQueueBatch transaction', {
nonce,
txHash: tx.hash, txHash: tx.hash,
contractAddr: this.chainContract.address,
from: tx.from, from: tx.from,
}) })
this.logger.debug('appendQueueBatch transaction data', { this.logger.debug('appendQueueBatch transaction data', {
...@@ -250,14 +253,17 @@ export class TransactionBatchSubmitter extends BatchSubmitter { ...@@ -250,14 +253,17 @@ export class TransactionBatchSubmitter extends BatchSubmitter {
const nonce = await this.signer.getTransactionCount() const nonce = await this.signer.getTransactionCount()
const contractFunction = async (gasPrice): Promise<TransactionReceipt> => { const contractFunction = async (gasPrice): Promise<TransactionReceipt> => {
this.logger.info('Submitting appendSequencerBatch transaction', {
gasPrice,
nonce,
contractAddr: this.chainContract.address,
})
const tx = await this.chainContract.appendSequencerBatch(batchParams, { const tx = await this.chainContract.appendSequencerBatch(batchParams, {
nonce, nonce,
gasPrice, gasPrice,
}) })
this.logger.info('Submitted appendSequencerBatch transaction', { this.logger.info('Submitted appendSequencerBatch transaction', {
nonce,
txHash: tx.hash, txHash: tx.hash,
contractAddr: this.chainContract.address,
from: tx.from, from: tx.from,
}) })
this.logger.debug('appendSequencerBatch transaction data', { this.logger.debug('appendSequencerBatch transaction data', {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment