Skip to content

Commit

Permalink
Bind to full prop namings in API v2 endpoints
Browse files Browse the repository at this point in the history
Fixes #2374
  • Loading branch information
tom2drum committed Nov 11, 2024
1 parent 05dd4af commit 12e059a
Show file tree
Hide file tree
Showing 99 changed files with 280 additions and 280 deletions.
2 changes: 1 addition & 1 deletion lib/block/getBlockReward.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import BigNumber from 'bignumber.js';
import type { Block } from 'types/api/block';

export default function getBlockReward(block: Block) {
const txFees = BigNumber(block.tx_fees || 0);
const txFees = BigNumber(block.transaction_fees || 0);
const burntFees = BigNumber(block.burnt_fees || 0);
const minerReward = block.rewards?.find(({ type }) => type === 'Miner Reward' || type === 'Validator Reward')?.reward;
const totalReward = BigNumber(minerReward || 0);
Expand Down
8 changes: 4 additions & 4 deletions mocks/address/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const token: Address = {
token: tokenInfo,
block_number_balance_updated_at: 8201413,
coin_balance: '1',
creation_tx_hash: '0xc38cf7377bf72d6436f63c37b01b24d032101f20ec1849286dc703c712f10c98',
creation_transaction_hash: '0xc38cf7377bf72d6436f63c37b01b24d032101f20ec1849286dc703c712f10c98',
creator_address_hash: '0x34A9c688512ebdB575e82C50c9803F6ba2916E72',
exchange_rate: '0.04311',
has_decompiled_code: false,
Expand All @@ -87,7 +87,7 @@ export const token: Address = {
export const eoa: Address = {
block_number_balance_updated_at: 30811263,
coin_balance: '2782650189688719421432220500',
creation_tx_hash: '0xf2aff6501b632604c39978b47d309813d8a1bcca721864bbe86abf59704f195e',
creation_transaction_hash: '0xf2aff6501b632604c39978b47d309813d8a1bcca721864bbe86abf59704f195e',
creator_address_hash: '0x803ad3F50b9e1fF68615e8B053A186e1be288943',
exchange_rate: '0.04311',
has_decompiled_code: false,
Expand All @@ -111,7 +111,7 @@ export const eoa: Address = {
export const contract: Address = {
block_number_balance_updated_at: 30811263,
coin_balance: '27826501896887194214322205',
creation_tx_hash: '0xf2aff6501b632604c39978b47d309813d8a1bcca721864bbe86abf59704f195e',
creation_transaction_hash: '0xf2aff6501b632604c39978b47d309813d8a1bcca721864bbe86abf59704f195e',
creator_address_hash: '0x803ad3F50b9e1fF68615e8B053A186e1be288943',
exchange_rate: '0.04311',
has_decompiled_code: false,
Expand All @@ -137,7 +137,7 @@ export const contract: Address = {
export const validator: Address = {
block_number_balance_updated_at: 30811932,
coin_balance: '22910462800601256910890',
creation_tx_hash: null,
creation_transaction_hash: null,
creator_address_hash: null,
exchange_rate: '0.00432018',
has_decompiled_code: false,
Expand Down
10 changes: 5 additions & 5 deletions mocks/blocks/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export const base: Block = {
state_root: 'TODO',
timestamp: '2022-11-11T11:59:35Z',
total_difficulty: '10258276095980170141167591583995189665817672619',
tx_count: 5,
tx_fees: '26853607500000000',
transaction_count: 5,
transaction_fees: '26853607500000000',
type: 'block',
uncles_hashes: [],
};
Expand Down Expand Up @@ -89,8 +89,8 @@ export const genesis: Block = {
state_root: 'TODO',
timestamp: '2017-12-16T00:13:24.000000Z',
total_difficulty: '131072',
tx_count: 0,
tx_fees: '0',
transaction_count: 0,
transaction_fees: '0',
type: 'block',
uncles_hashes: [],
};
Expand All @@ -111,7 +111,7 @@ export const base2: Block = {
ens_domain_name: null,
},
timestamp: '2022-11-11T11:46:05Z',
tx_count: 253,
transaction_count: 253,
gas_target_percentage: 23.6433,
gas_used: '6333342',
gas_used_percentage: 87.859504,
Expand Down
4 changes: 2 additions & 2 deletions mocks/contracts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const contract1: VerifiedContract = {
language: 'solidity',
market_cap: null,
optimization_enabled: false,
tx_count: 7334224,
transaction_count: 7334224,
verified_at: '2022-09-16T18:49:29.605179Z',
license_type: 'mit',
};
Expand All @@ -42,7 +42,7 @@ export const contract2: VerifiedContract = {
language: 'vyper',
market_cap: null,
optimization_enabled: true,
tx_count: 440,
transaction_count: 440,
verified_at: '2021-09-07T20:01:56.076979Z',
license_type: 'bsd_3_clause',
};
Expand Down
6 changes: 3 additions & 3 deletions mocks/mud/mudWorlds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ export const mudWorlds: MudWorldsResponse = {
{
address: withName,
coin_balance: '300000000000000000',
tx_count: 3938,
transaction_count: 3938,
},
{
address: withoutName,
coin_balance: '0',
tx_count: 0,
transaction_count: 0,
},
{
address: withoutName,
coin_balance: '0',
tx_count: 0,
transaction_count: 0,
},
],
next_page_params: {
Expand Down
26 changes: 13 additions & 13 deletions mocks/optimism/deposits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@ export const data = {
{
l1_block_number: 8382841,
l1_block_timestamp: '2022-05-27T01:13:48.000000Z',
l1_tx_hash: '0xaf3e5f4ef03eac22a622b3434c5dc9f4465aa291900a86bcf0ad9fb14429f05e',
l1_tx_origin: '0x6197d1eef304eb5284a0f6720f79403b4e9bf3a5',
l2_tx_gas_limit: '2156928',
l2_tx_hash: '0xb9212c76069b926917816767e4c5a0ef80e519b1ac1c3d3fb5818078f4984667',
l1_transaction_hash: '0xaf3e5f4ef03eac22a622b3434c5dc9f4465aa291900a86bcf0ad9fb14429f05e',
l1_transaction_origin: '0x6197d1eef304eb5284a0f6720f79403b4e9bf3a5',
l2_transaction_gas_limit: '2156928',
l2_transaction_hash: '0xb9212c76069b926917816767e4c5a0ef80e519b1ac1c3d3fb5818078f4984667',
},
{
l1_block_number: 8382841,
l1_block_timestamp: '2022-05-27T01:13:48.000000Z',
l1_tx_hash: '0xa280f18cc72f9ad904087eb262c236048e935ad184a85bbd042d544c172c10bf',
l1_tx_origin: '0x6197d1eef304eb5284a0f6720f79403b4e9bf3a5',
l2_tx_gas_limit: '1216064',
l2_tx_hash: '0xaaaeb47a78b5c42d870f8d831a683a7cefe1b031a992170b28b43b82bd08318c',
l1_transaction_hash: '0xa280f18cc72f9ad904087eb262c236048e935ad184a85bbd042d544c172c10bf',
l1_transaction_origin: '0x6197d1eef304eb5284a0f6720f79403b4e9bf3a5',
l2_transaction_gas_limit: '1216064',
l2_transaction_hash: '0xaaaeb47a78b5c42d870f8d831a683a7cefe1b031a992170b28b43b82bd08318c',
},
{
l1_block_number: 8382834,
l1_block_timestamp: '2022-06-27T01:11:48.000000Z',
l1_tx_hash: '0xfca8cc5440bffa8b975873c02bba3ff3380dd75fbc3260d10179e282cf72d6d4',
l1_tx_origin: '0x6197d1eef304eb5284a0f6720f79403b4e9bf3a5',
l2_tx_gas_limit: '405824',
l2_tx_hash: '0xa0604ebf2614ad708aeefa83f766fb25928dadb5ffb2f45028f5b4f1fa4d9358',
l1_transaction_hash: '0xfca8cc5440bffa8b975873c02bba3ff3380dd75fbc3260d10179e282cf72d6d4',
l1_transaction_origin: '0x6197d1eef304eb5284a0f6720f79403b4e9bf3a5',
l2_transaction_gas_limit: '405824',
l2_transaction_hash: '0xa0604ebf2614ad708aeefa83f766fb25928dadb5ffb2f45028f5b4f1fa4d9358',
},
],
next_page_params: {
items_count: 50,
l1_block_number: 8382363,
tx_hash: '0x2012f0ce966ce6573e7826e9235f227edf5a2f8382b8d646c979f85a77e15c05',
transaction_hash: '0x2012f0ce966ce6573e7826e9235f227edf5a2f8382b8d646c979f85a77e15c05',
},
};
6 changes: 3 additions & 3 deletions mocks/optimism/outputRoots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ export const outputRootsData = {
{
l1_block_number: 8456113,
l1_timestamp: '2022-02-08T12:08:48.000000Z',
l1_tx_hash: '0x19455a53758d5de89070164ff09c40d93f1b4447e721090f03aa150f6159265a',
l1_transaction_hash: '0x19455a53758d5de89070164ff09c40d93f1b4447e721090f03aa150f6159265a',
l2_block_number: 5214988,
l2_output_index: 9926,
output_root: '0xa7de9bd3986ce5ca8de9f0ab6c7473f4cebe225fb13b57cc5c8472de84a8bab3',
},
{
l1_block_number: 8456099,
l1_timestamp: '2022-02-08T12:05:24.000000Z',
l1_tx_hash: '0x6aa081e8e33a085e4ec7124fcd8a5f7d36aac0828f176e80d4b70e313a11695b',
l1_transaction_hash: '0x6aa081e8e33a085e4ec7124fcd8a5f7d36aac0828f176e80d4b70e313a11695b',
l2_block_number: 5214868,
l2_output_index: 9925,
output_root: '0x4ec2822d2f7b4f834d693d88f8a4cf15899882915980a21756d29cfd9f9f3898',
},
{
l1_block_number: 8456078,
l1_timestamp: '2022-02-08T12:00:48.000000Z',
l1_tx_hash: '0x4238988b0959e41a7b09cef67f58698e05e3bcc29b8d2f60e6c77dc68c91f16e',
l1_transaction_hash: '0x4238988b0959e41a7b09cef67f58698e05e3bcc29b8d2f60e6c77dc68c91f16e',
l2_block_number: 5214748,
l2_output_index: 9924,
output_root: '0x78b2e13c20f4bbfb4a008127edaaf25aa476f933669edd4856305bf4ab64a92b',
Expand Down
24 changes: 12 additions & 12 deletions mocks/optimism/txnBatches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,33 @@ export const txnBatchesData: OptimisticL2TxnBatchesResponse = {
batch_data_container: 'in_blob4844',
internal_id: 260998,
l1_timestamp: '2022-11-10T11:29:11.000000Z',
l1_tx_hashes: [
l1_transaction_hashes: [
'0x9553351f6bd1577f4e782738c087be08697fb11f3b91745138d71ba166d62c3b',
],
l2_block_end: 124882074,
l2_block_start: 124881833,
tx_count: 4011,
transaction_count: 4011,
},
{
batch_data_container: 'in_calldata',
internal_id: 260997,
l1_timestamp: '2022-11-03T11:20:59.000000Z',
l1_tx_hashes: [
l1_transaction_hashes: [
'0x80f5fba70d5685bc2b70df836942e892b24afa7bba289a2fac0ca8f4d554cc72',
],
l2_block_end: 124881832,
l2_block_start: 124881613,
tx_count: 4206,
transaction_count: 4206,
},
{
internal_id: 260996,
l1_timestamp: '2024-09-03T11:14:23.000000Z',
l1_tx_hashes: [
l1_transaction_hashes: [
'0x39f4c46cae57bae936acb9159e367794f41f021ed3788adb80ad93830edb5f22',
],
l2_block_end: 124881612,
l2_block_start: 124881380,
tx_count: 4490,
transaction_count: 4490,
},
],
next_page_params: {
Expand All @@ -50,12 +50,12 @@ export const txnBatchTypeCallData: OptimismL2TxnBatchTypeCallData = {
batch_data_container: 'in_calldata',
internal_id: 309123,
l1_timestamp: '2022-08-10T10:30:24.000000Z',
l1_tx_hashes: [
l1_transaction_hashes: [
'0x478c45f182631ae6f7249d40f31fdac36f41d88caa2e373fba35340a7345ca67',
],
l2_block_end: 10146784,
l2_block_start: 10145379,
tx_count: 1608,
transaction_count: 1608,
};

export const txnBatchTypeCelestia: OptimismL2TxnBatchTypeCelestia = {
Expand All @@ -71,12 +71,12 @@ export const txnBatchTypeCelestia: OptimismL2TxnBatchTypeCelestia = {
],
internal_id: 309667,
l1_timestamp: '2022-08-28T16:51:12.000000Z',
l1_tx_hashes: [
l1_transaction_hashes: [
'0x2bb0b96a8ba0f063a243ac3dee0b2f2d87edb2ba9ef44bfcbc8ed191af1c4c24',
],
l2_block_end: 10935879,
l2_block_start: 10934514,
tx_count: 1574,
transaction_count: 1574,
};

export const txnBatchTypeEip4844: OptimismL2TxnBatchTypeEip4844 = {
Expand All @@ -95,10 +95,10 @@ export const txnBatchTypeEip4844: OptimismL2TxnBatchTypeEip4844 = {
],
internal_id: 2538459,
l1_timestamp: '2022-08-23T03:59:12.000000Z',
l1_tx_hashes: [
l1_transaction_hashes: [
'0x3870f136497e5501dc20d0974daf379c8636c958794d59a9c90d4f8a9f0ed20a',
],
l2_block_end: 16291502,
l2_block_start: 16291373,
tx_count: 704,
transaction_count: 704,
};
12 changes: 6 additions & 6 deletions mocks/optimism/withdrawals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@ export const data: OptimisticL2WithdrawalsResponse = {
watchlist_names: [],
ens_domain_name: null,
},
l1_tx_hash: '0x1a235bee32ac10cb7efdad98415737484ca66386e491cde9e17d42b136dca684',
l1_transaction_hash: '0x1a235bee32ac10cb7efdad98415737484ca66386e491cde9e17d42b136dca684',
l2_timestamp: '2022-02-15T12:50:02.000000Z',
l2_tx_hash: '0x918cd8c5c24c17e06cd02b0379510c4ad56324bf153578fb9caaaa2fe4e7dc35',
l2_transaction_hash: '0x918cd8c5c24c17e06cd02b0379510c4ad56324bf153578fb9caaaa2fe4e7dc35',
msg_nonce: 396,
msg_nonce_version: 1,
status: 'Ready to prove',
},
{
challenge_period_end: null,
from: null,
l1_tx_hash: null,
l1_transaction_hash: null,
l2_timestamp: null,
l2_tx_hash: '0x2f117bee32ac10cb7efdad98415737484ca66386e491cde9e17d42b136def593',
l2_transaction_hash: '0x2f117bee32ac10cb7efdad98415737484ca66386e491cde9e17d42b136def593',
msg_nonce: 391,
msg_nonce_version: 1,
status: 'Ready to prove',
},
{
challenge_period_end: '2022-11-11T12:50:02.000000Z',
from: null,
l1_tx_hash: null,
l1_transaction_hash: null,
l2_timestamp: null,
l2_tx_hash: '0xe14b1f46838176702244a5343629bcecf728ca2d9881d47b4ce46e00c387d7e3',
l2_transaction_hash: '0xe14b1f46838176702244a5343629bcecf728ca2d9881d47b4ce46e00c387d7e3',
msg_nonce: 390,
msg_nonce_version: 1,
status: 'Ready for relay',
Expand Down
2 changes: 1 addition & 1 deletion mocks/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const label1: SearchResultLabel = {
};

export const tx1: SearchResultTx = {
tx_hash: '0x349d4025d03c6faec117ee10ac0bce7c7a805dd2cbff7a9f101304d9a8a525dd',
transaction_hash: '0x349d4025d03c6faec117ee10ac0bce7c7a805dd2cbff7a9f101304d9a8a525dd',
type: 'transaction' as const,
timestamp: '2022-12-11T17:55:20Z',
url: '/tx/0x349d4025d03c6faec117ee10ac0bce7c7a805dd2cbff7a9f101304d9a8a525dd',
Expand Down
Loading

0 comments on commit 12e059a

Please sign in to comment.