Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/relay/src/formatters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ const tinybarsToWeibars = (value: number | null, allowNegativeValues: boolean =
if (value && value > constants.TOTAL_SUPPLY_TINYBARS)
throw new Error('Value cannot be more than the total supply of tinybars in the blockchain');

return value == null ? null : value * constants.TINYBAR_TO_WEIBAR_COEF;
return value == null ? null : BigInt(value) * BigInt(constants.TINYBAR_TO_WEIBAR_COEF);
};

export {
Expand Down
2 changes: 1 addition & 1 deletion packages/relay/src/lib/factories/transactionFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export const createTransactionFromContractResult = (cr: any): Transaction | null
blockHash: toHash32(cr.block_hash),
blockNumber: nullableNumberTo0x(cr.block_number),
from: cr.from.substring(0, 42),
gas: nanOrNumberTo0x(cr.gas_used),
gas: nanOrNumberTo0x(cr.gas_limit),
gasPrice,
hash: cr.hash.substring(0, 66),
input: cr.function_parameters,
Expand Down
3 changes: 2 additions & 1 deletion packages/relay/tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ export const blockTransactionCount = 77;
export const gasUsed1 = 200000;
export const gasUsed2 = 800000;
export const maxGasLimit = 250000;
export const maxGasLimit2 = maxGasLimit - 1000;
export const firstTransactionTimestampSeconds = '1653077541';
export const contractAddress1 = '0x000000000000000000000000000000000000055f';
export const contractTimestamp1 = `${firstTransactionTimestampSeconds}.983983199`;
Expand Down Expand Up @@ -466,7 +467,7 @@ export const defaultContractResults = {
from: LONG_ZERO_ADDRESS,
function_parameters:
'0x2b6adf430000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000084865792c204d6121000000000000000000000000000000000000000000000000',
gas_limit: maxGasLimit - 1000,
gas_limit: maxGasLimit2,
gas_used: gasUsed2,
hash: contractHash2,
timestamp: `${contractTimestamp2}`,
Expand Down
5 changes: 4 additions & 1 deletion packages/relay/tests/lib/eth/eth-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
export const BLOCK_TRANSACTION_COUNT = 77;
export const GAS_USED_1 = 200000;
export const GAS_USED_2 = 800000;
export const GAS_LIMIT = 1_000_000;
export const GAS_USED_RATIO = 0.5;
export const BLOCK_NUMBER = 3;
export const BLOCK_NUMBER_2 = 4;
Expand Down Expand Up @@ -106,7 +107,9 @@ export const ETH_FEE_HISTORY_VALUE = ConfigService.get('ETH_FEE_HISTORY_FIXED');
export const BLOCK_HASH_PREV_TRIMMED = '0xf7d6481f659c866c35391ee230c374f163642ebf13a5e604e04a95a9ca48a298';
export const BLOCK_NUMBER_HEX = `0x${BLOCK_NUMBER.toString(16)}`;
export const MAX_GAS_LIMIT = 250000;
export const MAX_GAS_LIMIT2 = MAX_GAS_LIMIT - 1000;
export const MAX_GAS_LIMIT_HEX = numberTo0x(MAX_GAS_LIMIT);
export const MAX_GAS_LIMIT2_HEX = numberTo0x(MAX_GAS_LIMIT2);
export const BLOCK_TIMESTAMP_HEX = numberTo0x(Number(BLOCK_TIMESTAMP));
export const NO_TRANSACTIONS = '?transactions=false';
export const FIRST_TRX_TIMESTAMP_SEC = '1653077541';
Expand Down Expand Up @@ -596,7 +599,7 @@ export const DEFAULT_TRANSACTION = {
blockNumber: '0x11',
chainId: '0x12a',
from: `${defaultEvmAddress}`,
gas: '0x7b',
gas: '0xf4240',
gasPrice: '0xad78ebc5ac620000',
hash: DEFAULT_TX_HASH,
input: '0x0707',
Expand Down
6 changes: 4 additions & 2 deletions packages/relay/tests/lib/eth/eth_getBlockByNumber.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ import {
DEFAULT_LOGS,
DEFAULT_NETWORK_FEES,
GAS_USED_1,
GAS_USED_2,
LATEST_BLOCK_QUERY,
LATEST_BLOCK_RESPONSE,
LINKS_NEXT_RES,
LOG_QUERY,
LOGS_RESPONSE_MOCK,
MAX_GAS_LIMIT_HEX,
MAX_GAS_LIMIT2_HEX,
MOST_RECENT_BLOCK,
NO_SUCH_BLOCK_EXISTS_RES,
NOT_FOUND_RES,
Expand Down Expand Up @@ -107,8 +108,9 @@ describe('@ethGetBlockByNumber using MirrorNode', async function () {
function verifyTransactions(transactions: Array<Transaction>) {
expect(transactions.length).equal(2);
expect(transactions[0].hash).equal(CONTRACT_HASH_1);
expect(transactions[0].gas).equal(MAX_GAS_LIMIT_HEX);
expect(transactions[1].hash).equal(CONTRACT_HASH_2);
expect(transactions[1].gas).equal(hashNumber(GAS_USED_2));
expect(transactions[1].gas).equal(MAX_GAS_LIMIT2_HEX);
}

overrideEnvsInMochaDescribe({ ETH_GET_TRANSACTION_COUNT_MAX_BLOCK_RANGE: 1 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ describe('@ethGetTransactionByHash eth_getTransactionByHash tests', async functi
it('handles transactions with null gas_used', async function () {
const detailedResultsWithNullNullableValues = {
...defaultDetailedContractResultByHash,
gas_used: null,
gas_limit: null,
};
const uniqueTxHash = '0x14aad7b827375d12d73af57b6a3e84353645fd31305ea58ff52dda53ec640533';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('TransactionFactory', () => {
);
expect(formattedResult.chainId).to.equal('0x12a');
expect(formattedResult.from).to.equal('0x05fba803be258049a27b820088bab1cad2058871');
expect(formattedResult.gas).to.equal(expectedValues.gas ?? '0x61a80');
expect(formattedResult.gas).to.equal(expectedValues.gas ?? '0x7a120');
expect(formattedResult.gasPrice).to.equal(expectedValues.gasPrice ?? '0x0');
expect(formattedResult.hash).to.equal('0xfc4ab7133197016293d2e14e8cf9c5227b07357e6385184f1cd1cb40d783cfbd');
expect(formattedResult.input).to.equal('0x08090033');
Expand All @@ -57,6 +57,7 @@ describe('TransactionFactory', () => {
from: '0x05fba803be258049a27b820088bab1cad2058871',
function_parameters: '0x08090033',
gas_used: 400000,
gas_limit: 500_000,
to: '0x0000000000000000000000000000000000000409',
hash: '0xfc4ab7133197016293d2e14e8cf9c5227b07357e6385184f1cd1cb40d783cfbd',
block_hash: '0xb0f10139fa0bf9e66402c8c0e5ed364e07cf83b3726c8045fabf86a07f4887130e4650cb5cf48a9f6139a805b78f0312',
Expand Down Expand Up @@ -100,7 +101,7 @@ describe('TransactionFactory', () => {
const formattedResult: any = createTransactionFromContractResult({
...contractResult,
block_number: null,
gas_used: null,
gas_limit: null,
gas_price: '0x',
max_priority_fee_per_gas: '0x',
max_fee_per_gas: '0x',
Expand Down
6 changes: 3 additions & 3 deletions packages/relay/tests/lib/formatters.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,15 +660,15 @@ describe('Formatters', () => {
describe('tinybarsToWeibars', () => {
for (const allowNegativeValues of [true, false]) {
it(`should convert tinybars to weibars allowNegativeValues = ${allowNegativeValues}`, () => {
expect(tinybarsToWeibars(10, allowNegativeValues)).to.eql(100000000000);
expect(tinybarsToWeibars(10, allowNegativeValues)).to.eql(BigInt(100000000000));
});

it(`should return null if null is passed allowNegativeValues = ${allowNegativeValues}`, () => {
expect(tinybarsToWeibars(null, allowNegativeValues)).to.eql(null);
});

it(`should return 0 for 0 input allowNegativeValues = ${allowNegativeValues}`, () => {
expect(tinybarsToWeibars(0, allowNegativeValues)).to.eql(0);
expect(tinybarsToWeibars(0, allowNegativeValues)).to.eql(BigInt(0));
});

it(`should throw an error when value is larger than the total supply of tinybars allowNegativeValues = ${allowNegativeValues}`, () => {
Expand Down Expand Up @@ -706,7 +706,7 @@ describe('Formatters', () => {

it('should handle edge case values correctly', () => {
expect(tinybarsToWeibars(constants.TOTAL_SUPPLY_TINYBARS, false)).to.eql(
constants.TOTAL_SUPPLY_TINYBARS * constants.TINYBAR_TO_WEIBAR_COEF,
BigInt(constants.TOTAL_SUPPLY_TINYBARS) * BigInt(constants.TINYBAR_TO_WEIBAR_COEF),
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
## wildcard: result.blockHash, result.blockNumber, result.transactionIndex

>> {"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByBlockHashAndIndex","params":["0xbb198addc8a129024ed75dbe52a8c89a6baa97980c855241790439db182a210b","0x0"]}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xed7ad3f8312a90317566aa1d6bc64b237658d3c5d5b6364de912c8735be650a1","blockNumber":"0x5d","chainId":"0x12a","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x30d40","gasPrice":"0x2c68af0bb14000","hash":"0xce8bfc3ea57c50a185e2fe61fc8d680a16b5a18dad9d6f05afdbdeb3c3a4516e","input":"0x","nonce":"0x0","r":"0xa685541e887688a4e3f0dbd00e58313f3a466fc0f012bfd4845497b4b16b575e","s":"0x7b300e3c6b327a9c878f1d4476587f8ed8f5303853500b6594f096c945602","to":"0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69","transactionIndex":"0x6","type":"0x0","v":"0x278","value":"0x2e90edd000"}}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xed7ad3f8312a90317566aa1d6bc64b237658d3c5d5b6364de912c8735be650a1","blockNumber":"0x5d","chainId":"0x12a","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x3d090","gasPrice":"0x2c68af0bb14000","hash":"0xce8bfc3ea57c50a185e2fe61fc8d680a16b5a18dad9d6f05afdbdeb3c3a4516e","input":"0x","nonce":"0x0","r":"0xa685541e887688a4e3f0dbd00e58313f3a466fc0f012bfd4845497b4b16b575e","s":"0x7b300e3c6b327a9c878f1d4476587f8ed8f5303853500b6594f096c945602","to":"0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69","transactionIndex":"0x6","type":"0x0","v":"0x278","value":"0x2e90edd000"}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
## wildcard: result.blockHash, result.blockNumber, result.transactionIndex

>> {"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByBlockNumberAndIndex","params":["0x1","0x0"]}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xed7ad3f8312a90317566aa1d6bc64b237658d3c5d5b6364de912c8735be650a1","blockNumber":"0x5d","chainId":"0x12a","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x30d40","gasPrice":"0x2c68af0bb14000","hash":"0xce8bfc3ea57c50a185e2fe61fc8d680a16b5a18dad9d6f05afdbdeb3c3a4516e","input":"0x","nonce":"0x0","r":"0xa685541e887688a4e3f0dbd00e58313f3a466fc0f012bfd4845497b4b16b575e","s":"0x7b300e3c6b327a9c878f1d4476587f8ed8f5303853500b6594f096c945602","to":"0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69","transactionIndex":"0x6","type":"0x0","v":"0x278","value":"0x2e90edd000"}}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xed7ad3f8312a90317566aa1d6bc64b237658d3c5d5b6364de912c8735be650a1","blockNumber":"0x5d","chainId":"0x12a","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x3d090","gasPrice":"0x2c68af0bb14000","hash":"0xce8bfc3ea57c50a185e2fe61fc8d680a16b5a18dad9d6f05afdbdeb3c3a4516e","input":"0x","nonce":"0x0","r":"0xa685541e887688a4e3f0dbd00e58313f3a466fc0f012bfd4845497b4b16b575e","s":"0x7b300e3c6b327a9c878f1d4476587f8ed8f5303853500b6594f096c945602","to":"0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69","transactionIndex":"0x6","type":"0x0","v":"0x278","value":"0x2e90edd000"}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
## wildcard: result.blockHash, result.blockNumber, result.transactionIndex

>> {"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByHash","params":["0xa0762610d794acddd2dca15fb7c437ada3611c886f3bea675d53d8da8a6c41b2"]}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x7822bab5f72f55f0d80152c2be40e8a2676269b1e45f34f1cbd185dfea8fa5c0","blockNumber":"0x65","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x30d40","gasPrice":"0x2c68af0bb14000","hash":"0xae79281488265143ccde1d153bbaac3891d02fec1b7253dcd9bc2396d0168417","input":"0x","nonce":"0x1","to":"0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69","transactionIndex":"0x7","value":"0x2e90edd000","type":"0x1","accessList":[],"chainId":"0x12a","v":"0x1","r":"0x273ba8165ec42f17763fcb799ee5feabf5520ef8611b43f0480c027bb010327a","s":"0x404c040241f2746e8c3747f7c3b8ecea21e8b73d24e50bfc1cf25c3954592e90","yParity":"0x1"}}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x7822bab5f72f55f0d80152c2be40e8a2676269b1e45f34f1cbd185dfea8fa5c0","blockNumber":"0x65","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x3d090","gasPrice":"0x2c68af0bb14000","hash":"0xae79281488265143ccde1d153bbaac3891d02fec1b7253dcd9bc2396d0168417","input":"0x","nonce":"0x1","to":"0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69","transactionIndex":"0x7","value":"0x2e90edd000","type":"0x1","accessList":[],"chainId":"0x12a","v":"0x1","r":"0x273ba8165ec42f17763fcb799ee5feabf5520ef8611b43f0480c027bb010327a","s":"0x404c040241f2746e8c3747f7c3b8ecea21e8b73d24e50bfc1cf25c3954592e90","yParity":"0x1"}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
## wildcard: result.blockHash, result.blockNumber, result.transactionIndex

>> {"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByHash","params":["0x847f7a3261988dc4a34be85f4c28d5d534d47775792e9d25e1d9250cb2fb77eb"]}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xf3488b008a901089c36a4c8f8e14727da61453e139fb8ef7389f199552e09716","blockNumber":"0x75","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x30d40","gasPrice":"0x0","maxFeePerGas":"0x1312d0","maxPriorityFeePerGas":"0x1312d0","hash":"0xc1c8f23c76930f81a075b55c85a5ee2da8177644da46cbdc3424ded08a9ef93c","input":"0x","nonce":"0x2","to":"0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69","transactionIndex":"0x4","value":"0x2e90edd000","type":"0x2","accessList":[],"chainId":"0x12a","v":"0x0","r":"0x80f53012410d59b1b38f2c58e48cdd98edf4b6d9d1195897f9a0bbbbcb23f914","s":"0x66aa7309cce8594daebf6a057a20d84cabb4e9fd1049bfa03c9eeb5316991a8d","yParity":"0x0"}}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xf3488b008a901089c36a4c8f8e14727da61453e139fb8ef7389f199552e09716","blockNumber":"0x75","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x3d090","gasPrice":"0x0","maxFeePerGas":"0x1312d0","maxPriorityFeePerGas":"0x1312d0","hash":"0xc1c8f23c76930f81a075b55c85a5ee2da8177644da46cbdc3424ded08a9ef93c","input":"0x","nonce":"0x2","to":"0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69","transactionIndex":"0x4","value":"0x2e90edd000","type":"0x2","accessList":[],"chainId":"0x12a","v":"0x0","r":"0x80f53012410d59b1b38f2c58e48cdd98edf4b6d9d1195897f9a0bbbbcb23f914","s":"0x66aa7309cce8594daebf6a057a20d84cabb4e9fd1049bfa03c9eeb5316991a8d","yParity":"0x0"}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
## wildcard: result.blockHash, result.blockNumber, result.transactionIndex, result.hash

>> {"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByHash","params":["0xbdb37c763e721bf1a0e94e0bc72db704110b2ccc6720713708744422a2cc95d6"]}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x877f61e0bdf472c95af28db22b2556ac8ff8f986940e233adb9e2a33f14ffe50","blockNumber":"0x78","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x30d40","gasPrice":"0x2c68af0bb14000","hash":"0x8a3a7255dbccd79bb3ef12fa9238d35b6449e1fe1f2bc82b195eaaf162f2517f","input":"0x6080604052348015600f57600080fd5b50609e8061001e6000396000f3fe608060405260043610602a5760003560e01c80635c36b18614603557806383197ef014605557600080fd5b36603057005b600080fd5b348015604057600080fd5b50600160405190815260200160405180910390f35b348015606057600080fd5b50606633ff5b00fea2646970667358221220886a6d6d6c88bcfc0063129ca2391a3d98aee75ad7fe3e870ec6679215456a3964736f6c63430008090033","nonce":"0x4","to":"0x6092b61cbb93803cb92250422a90314982430652","transactionIndex":"0x1","value":"0x0","type":"0x0","chainId":"0x12a","v":"0x277","r":"0x617a994b794b634a59c000341b656be0fce142647de35c64d719b9a06b92506a","s":"0x5033c9fe6227db7545e5bdc7133e36df4b49171b9c00cd3cc4e6f984c850d3e1"}}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x877f61e0bdf472c95af28db22b2556ac8ff8f986940e233adb9e2a33f14ffe50","blockNumber":"0x78","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x3d090","gasPrice":"0x2c68af0bb14000","hash":"0x8a3a7255dbccd79bb3ef12fa9238d35b6449e1fe1f2bc82b195eaaf162f2517f","input":"0x6080604052348015600f57600080fd5b50609e8061001e6000396000f3fe608060405260043610602a5760003560e01c80635c36b18614603557806383197ef014605557600080fd5b36603057005b600080fd5b348015604057600080fd5b50600160405190815260200160405180910390f35b348015606057600080fd5b50606633ff5b00fea2646970667358221220886a6d6d6c88bcfc0063129ca2391a3d98aee75ad7fe3e870ec6679215456a3964736f6c63430008090033","nonce":"0x4","to":"0x6092b61cbb93803cb92250422a90314982430652","transactionIndex":"0x1","value":"0x0","type":"0x0","chainId":"0x12a","v":"0x277","r":"0x617a994b794b634a59c000341b656be0fce142647de35c64d719b9a06b92506a","s":"0x5033c9fe6227db7545e5bdc7133e36df4b49171b9c00cd3cc4e6f984c850d3e1"}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
## wildcard: result.blockHash, result.blockNumber, result.contractAddress, result.root, result.transactionHash, result.transactionIndex

>> {"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByHash","params":["0xbdb37c763e721bf1a0e94e0bc72db704110b2ccc6720713708744422a2cc95d6"]}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xad351bb438d86efe4a763a75c35c6e26c3b3736a6f33f870a17749b5dfc9da09","blockNumber":"0x71","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x30d40","gasPrice":"0x2c68af0bb14000","hash":"0x6974475d6d6c72cedf6b0df7ebab2afefd495291f1ee5839a083f5ec3bf9ad58","input":"0x6080604052348015600f57600080fd5b50609e8061001e6000396000f3fe608060405260043610602a5760003560e01c80635c36b18614603557806383197ef014605557600080fd5b36603057005b600080fd5b348015604057600080fd5b50600160405190815260200160405180910390f35b348015606057600080fd5b50606633ff5b00fea2646970667358221220886a6d6d6c88bcfc0063129ca2391a3d98aee75ad7fe3e870ec6679215456a3964736f6c63430008090033","nonce":"0x4","to":"0x6092b61cbb93803cb92250422a90314982430652","transactionIndex":"0x0","value":"0x0","type":"0x0","chainId":"0x12a","v":"0x277","r":"0x617a994b794b634a59c000341b656be0fce142647de35c64d719b9a06b92506a","s":"0x5033c9fe6227db7545e5bdc7133e36df4b49171b9c00cd3cc4e6f984c850d3e1"}}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0xad351bb438d86efe4a763a75c35c6e26c3b3736a6f33f870a17749b5dfc9da09","blockNumber":"0x71","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x3d090","gasPrice":"0x2c68af0bb14000","hash":"0x6974475d6d6c72cedf6b0df7ebab2afefd495291f1ee5839a083f5ec3bf9ad58","input":"0x6080604052348015600f57600080fd5b50609e8061001e6000396000f3fe608060405260043610602a5760003560e01c80635c36b18614603557806383197ef014605557600080fd5b36603057005b600080fd5b348015604057600080fd5b50600160405190815260200160405180910390f35b348015606057600080fd5b50606633ff5b00fea2646970667358221220886a6d6d6c88bcfc0063129ca2391a3d98aee75ad7fe3e870ec6679215456a3964736f6c63430008090033","nonce":"0x4","to":"0x6092b61cbb93803cb92250422a90314982430652","transactionIndex":"0x0","value":"0x0","type":"0x0","chainId":"0x12a","v":"0x277","r":"0x617a994b794b634a59c000341b656be0fce142647de35c64d719b9a06b92506a","s":"0x5033c9fe6227db7545e5bdc7133e36df4b49171b9c00cd3cc4e6f984c850d3e1"}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
## wildcard: result.blockHash, result.blockNumber, result.contractAddress, result.root, result.transactionHash, result.transactionIndex

>> {"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByHash","params":["0x3f38cdc805c02e152bfed34471a3a13a786fed436b3aec0c3eca35d23e2cdd2c"]}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x51715fd9cfe39f121b90971fe0c1ee94e5d68732dafd1f2e9a93abb952104b98","blockNumber":"0x63","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x30d40","gasPrice":"0x2c68af0bb14000","hash":"0xce8bfc3ea57c50a185e2fe61fc8d680a16b5a18dad9d6f05afdbdeb3c3a4516e","input":"0x","nonce":"0x0","to":"0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69","transactionIndex":"0x9","value":"0x2e90edd000","type":"0x0","chainId":"0x12a","v":"0x278","r":"0xa685541e887688a4e3f0dbd00e58313f3a466fc0f012bfd4845497b4b16b575e","s":"0x7b300e3c6b327a9c878f1d4476587f8ed8f5303853500b6594f096c945602"}}
<< {"jsonrpc":"2.0","id":1,"result":{"blockHash":"0x51715fd9cfe39f121b90971fe0c1ee94e5d68732dafd1f2e9a93abb952104b98","blockNumber":"0x63","from":"0xc37f417fa09933335240fca72dd257bfbde9c275","gas":"0x3d090","gasPrice":"0x2c68af0bb14000","hash":"0xce8bfc3ea57c50a185e2fe61fc8d680a16b5a18dad9d6f05afdbdeb3c3a4516e","input":"0x","nonce":"0x0","to":"0x67d8d32e9bf1a9968a5ff53b87d777aa8ebbee69","transactionIndex":"0x9","value":"0x2e90edd000","type":"0x0","chainId":"0x12a","v":"0x278","r":"0xa685541e887688a4e3f0dbd00e58313f3a466fc0f012bfd4845497b4b16b575e","s":"0x7b300e3c6b327a9c878f1d4476587f8ed8f5303853500b6594f096c945602"}}

2 changes: 1 addition & 1 deletion packages/server/tests/helpers/assertions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default class Assertions {
mirrorNodeResponse.from.toLowerCase(),
);
expect(relayResponse.gas, "Assert transaction: 'gas' should equal mirrorNode response").to.eq(
ethers.toQuantity(mirrorNodeResponse.gas_used),
ethers.toQuantity(mirrorNodeResponse.gas_limit),
);
// expect(relayResponse.gasPrice).to.eq(mirrorNodeResponse.gas_price); // FIXME must not be null!
expect(relayResponse.hash, "Assert transaction: 'hash' should equal mirrorNode response").to.eq(
Expand Down
Loading