internal/jsre: format blob fields from hexdecimal to int (#29166)
* internal/jsre: format receipt.{blobGasPrice,blobGasUsed} to int Signed-off-by: jsvisa <delweng@gmail.com> * internal/jsre: format tx.maxFeePerBlobGas to int Signed-off-by: jsvisa <delweng@gmail.com> * internal/jsre: format blob* in block Signed-off-by: jsvisa <delweng@gmail.com> --------- Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
c170814596
commit
e6e1d06687
@ -3734,7 +3734,7 @@ var inputCallFormatter = function (options){
|
|||||||
options.to = inputAddressFormatter(options.to);
|
options.to = inputAddressFormatter(options.to);
|
||||||
}
|
}
|
||||||
|
|
||||||
['maxFeePerGas', 'maxPriorityFeePerGas', 'gasPrice', 'gas', 'value', 'nonce'].filter(function (key) {
|
['maxFeePerBlobGas', 'maxFeePerGas', 'maxPriorityFeePerGas', 'gasPrice', 'gas', 'value', 'nonce'].filter(function (key) {
|
||||||
return options[key] !== undefined;
|
return options[key] !== undefined;
|
||||||
}).forEach(function(key){
|
}).forEach(function(key){
|
||||||
options[key] = utils.fromDecimal(options[key]);
|
options[key] = utils.fromDecimal(options[key]);
|
||||||
@ -3759,7 +3759,7 @@ var inputTransactionFormatter = function (options){
|
|||||||
options.to = inputAddressFormatter(options.to);
|
options.to = inputAddressFormatter(options.to);
|
||||||
}
|
}
|
||||||
|
|
||||||
['maxFeePerGas', 'maxPriorityFeePerGas', 'gasPrice', 'gas', 'value', 'nonce'].filter(function (key) {
|
['maxFeePerBlobGas', 'maxFeePerGas', 'maxPriorityFeePerGas', 'gasPrice', 'gas', 'value', 'nonce'].filter(function (key) {
|
||||||
return options[key] !== undefined;
|
return options[key] !== undefined;
|
||||||
}).forEach(function(key){
|
}).forEach(function(key){
|
||||||
options[key] = utils.fromDecimal(options[key]);
|
options[key] = utils.fromDecimal(options[key]);
|
||||||
@ -3789,6 +3789,9 @@ var outputTransactionFormatter = function (tx){
|
|||||||
if(tx.maxPriorityFeePerGas !== undefined) {
|
if(tx.maxPriorityFeePerGas !== undefined) {
|
||||||
tx.maxPriorityFeePerGas = utils.toBigNumber(tx.maxPriorityFeePerGas);
|
tx.maxPriorityFeePerGas = utils.toBigNumber(tx.maxPriorityFeePerGas);
|
||||||
}
|
}
|
||||||
|
if(tx.maxFeePerBlobGas !== undefined) {
|
||||||
|
tx.maxFeePerBlobGas = utils.toBigNumber(tx.maxFeePerBlobGas);
|
||||||
|
}
|
||||||
tx.value = utils.toBigNumber(tx.value);
|
tx.value = utils.toBigNumber(tx.value);
|
||||||
return tx;
|
return tx;
|
||||||
};
|
};
|
||||||
@ -3810,6 +3813,12 @@ var outputTransactionReceiptFormatter = function (receipt){
|
|||||||
if(receipt.effectiveGasPrice !== undefined) {
|
if(receipt.effectiveGasPrice !== undefined) {
|
||||||
receipt.effectiveGasPrice = utils.toBigNumber(receipt.effectiveGasPrice);
|
receipt.effectiveGasPrice = utils.toBigNumber(receipt.effectiveGasPrice);
|
||||||
}
|
}
|
||||||
|
if(receipt.blobGasPrice !== undefined) {
|
||||||
|
receipt.blobGasPrice = utils.toBigNumber(receipt.blobGasPrice);
|
||||||
|
}
|
||||||
|
if(receipt.blobGasUsed !== undefined) {
|
||||||
|
receipt.blobGasUsed = utils.toBigNumber(receipt.blobGasUsed);
|
||||||
|
}
|
||||||
if(utils.isArray(receipt.logs)) {
|
if(utils.isArray(receipt.logs)) {
|
||||||
receipt.logs = receipt.logs.map(function(log){
|
receipt.logs = receipt.logs.map(function(log){
|
||||||
return outputLogFormatter(log);
|
return outputLogFormatter(log);
|
||||||
@ -3864,11 +3873,17 @@ var outputBlockFormatter = function(block) {
|
|||||||
if (block.baseFeePerGas !== undefined) {
|
if (block.baseFeePerGas !== undefined) {
|
||||||
block.baseFeePerGas = utils.toBigNumber(block.baseFeePerGas);
|
block.baseFeePerGas = utils.toBigNumber(block.baseFeePerGas);
|
||||||
}
|
}
|
||||||
|
if (block.blobGasUsed !== undefined) {
|
||||||
|
block.blobGasUsed = utils.toBigNumber(block.blobGasUsed);
|
||||||
|
}
|
||||||
|
if (block.excessBlobGas !== undefined) {
|
||||||
|
block.excessBlobGas = utils.toBigNumber(block.excessBlobGas);
|
||||||
|
}
|
||||||
block.gasLimit = utils.toDecimal(block.gasLimit);
|
block.gasLimit = utils.toDecimal(block.gasLimit);
|
||||||
block.gasUsed = utils.toDecimal(block.gasUsed);
|
block.gasUsed = utils.toDecimal(block.gasUsed);
|
||||||
block.size = utils.toDecimal(block.size);
|
block.size = utils.toDecimal(block.size);
|
||||||
block.timestamp = utils.toDecimal(block.timestamp);
|
block.timestamp = utils.toDecimal(block.timestamp);
|
||||||
if(block.number !== null)
|
if (block.number !== null)
|
||||||
block.number = utils.toDecimal(block.number);
|
block.number = utils.toDecimal(block.number);
|
||||||
|
|
||||||
block.difficulty = utils.toBigNumber(block.difficulty);
|
block.difficulty = utils.toBigNumber(block.difficulty);
|
||||||
|
Loading…
Reference in New Issue
Block a user