Commit 387e253e authored by yann300's avatar yann300

use maxPriorityFeePerGas and maxFeePerGas

parent 519ef650
'use strict' 'use strict'
import { Transaction } from '@ethereumjs/tx' import { Transaction, FeeMarketEIP1559Transaction } from '@ethereumjs/tx'
import { Block } from '@ethereumjs/block' import { Block } from '@ethereumjs/block'
import { BN, bufferToHex, Address } from 'ethereumjs-util' import { BN, bufferToHex, Address } from 'ethereumjs-util'
import { EventManager } from '../eventManager' import { EventManager } from '../eventManager'
...@@ -71,14 +71,28 @@ export class TxRunnerVM { ...@@ -71,14 +71,28 @@ export class TxRunnerVM {
} }
} }
} }
const tx = Transaction.fromTxData({
nonce: new BN(res.nonce), let tx
gasPrice: '0x1', if (this.commonContext.hardfork === 'berlin' || this.commonContext.hardfork === 'muirglacier') {
gasLimit: gasLimit, tx = Transaction.fromTxData({
to: to, nonce: new BN(res.nonce),
value: value, gasPrice: '0x1',
data: Buffer.from(data.slice(2), 'hex') gasLimit: gasLimit,
}, { common: this.commonContext }).sign(account.privateKey) to: to,
value: value,
data: Buffer.from(data.slice(2), 'hex')
}, { common: this.commonContext }).sign(account.privateKey)
} else {
tx = FeeMarketEIP1559Transaction.fromTxData({
nonce: new BN(res.nonce),
maxPriorityFeePerGas: '0x01',
maxFeePerGas: '0x1',
gasLimit: gasLimit,
to: to,
value: value,
data: Buffer.from(data.slice(2), 'hex')
}).sign(account.privateKey)
}
const coinbases = ['0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a', '0x8945a1288dc78a6d8952a92c77aee6730b414778', '0x94d76e24f818426ae84aa404140e8d5f60e10e7e'] const coinbases = ['0x0e9281e9c6a0808672eaba6bd1220e144c9bb07a', '0x8945a1288dc78a6d8952a92c77aee6730b414778', '0x94d76e24f818426ae84aa404140e8d5f60e10e7e']
const difficulties = [new BN('69762765929000', 10), new BN('70762765929000', 10), new BN('71762765929000', 10)] const difficulties = [new BN('69762765929000', 10), new BN('70762765929000', 10), new BN('71762765929000', 10)]
......
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