Skip to content

Commit

Permalink
use entry_function_ prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmaayan committed Jan 8, 2025
1 parent f940046 commit 842b453
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"timestamp": "2022-10-18T23:10:04.331016",
"entry_function_id_str": "0xa3f6a53c57395401ce64f09a188e2259dc9b156387e76c88a7a80a8fe5254476::momentum_safe::register",
"epoch": 75,
"contract_address": "0xa3f6a53c57395401ce64f09a188e2259dc9b156387e76c88a7a80a8fe5254476",
"module_name": "momentum_safe",
"function_name": "register"
"entry_function_contract_address": "0xa3f6a53c57395401ce64f09a188e2259dc9b156387e76c88a7a80a8fe5254476",
"entry_function_module_name": "momentum_safe",
"entry_function_function_name": "register"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"timestamp": "2024-10-16T17:07:21.987832",
"entry_function_id_str": "0x1::aptos_account::transfer",
"epoch": 8870,
"contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"module_name": "aptos_account",
"function_name": "transfer"
"entry_function_contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"entry_function_module_name": "aptos_account",
"entry_function_function_name": "transfer"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"timestamp": "2022-10-12T21:26:20.299882",
"entry_function_id_str": "0x1::stake::update_network_and_fullnode_addresses",
"epoch": 2,
"contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"module_name": "stake",
"function_name": "update_network_and_fullnode_addresses"
"entry_function_contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"entry_function_module_name": "stake",
"entry_function_function_name": "update_network_and_fullnode_addresses"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"timestamp": "2024-02-23T22:21:53.482262",
"entry_function_id_str": "0x1::coin::transfer",
"epoch": 6013,
"contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"module_name": "coin",
"function_name": "transfer"
"entry_function_contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"entry_function_module_name": "coin",
"entry_function_function_name": "transfer"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"timestamp": "2024-01-16T09:35:08.981259",
"entry_function_id_str": "0x1::coin::transfer",
"epoch": 5547,
"contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"module_name": "coin",
"function_name": "transfer"
"entry_function_contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"entry_function_module_name": "coin",
"entry_function_function_name": "transfer"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"timestamp": "2024-05-09T01:18:59.975711",
"entry_function_id_str": "0x1::aptos_account::transfer_coins",
"epoch": 6924,
"contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"module_name": "aptos_account",
"function_name": "transfer_coins"
"entry_function_contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"entry_function_module_name": "aptos_account",
"entry_function_function_name": "transfer_coins"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"timestamp": "2024-06-10T15:51:10.170250",
"entry_function_id_str": "0x1::aptos_account::transfer_coins",
"epoch": 7324,
"contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"module_name": "aptos_account",
"function_name": "transfer_coins"
"entry_function_contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"entry_function_module_name": "aptos_account",
"entry_function_function_name": "transfer_coins"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"timestamp": "2024-03-29T13:51:13.448212",
"entry_function_id_str": "0x190d44266241744264b964a37b8f09863167a12d3e70cda39376cfb4e3561e12::scripts_v2::swap",
"epoch": 6429,
"contract_address": "0x190d44266241744264b964a37b8f09863167a12d3e70cda39376cfb4e3561e12",
"module_name": "scripts_v2",
"function_name": "swap"
"entry_function_contract_address": "0x190d44266241744264b964a37b8f09863167a12d3e70cda39376cfb4e3561e12",
"entry_function_module_name": "scripts_v2",
"entry_function_function_name": "swap"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"timestamp": "2024-04-13T17:59:30.751467",
"entry_function_id_str": "0x1::aptos_account::transfer_coins",
"epoch": 6620,
"contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"module_name": "aptos_account",
"function_name": "transfer_coins"
"entry_function_contract_address": "0x0000000000000000000000000000000000000000000000000000000000000001",
"entry_function_module_name": "aptos_account",
"entry_function_function_name": "transfer_coins"
}
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- This file should undo anything in `up.sql`
ALTER TABLE user_transactions
DROP COLUMN IF EXISTS contract_address,
DROP COLUMN IF EXISTS module_name,
DROP COLUMN IF EXISTS function_name;
DROP COLUMN IF EXISTS entry_function_contract_address,
DROP COLUMN IF EXISTS entry_function_module_name,
DROP COLUMN IF EXISTS entry_function_function_name;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- Your SQL goes here
ALTER TABLE user_transactions
ADD COLUMN contract_address VARCHAR(66) NOT NULL,
ADD COLUMN module_name VARCHAR(255) NOT NULL,
ADD COLUMN function_name VARCHAR(255) NOT NULL;
CREATE INDEX IF NOT EXISTS user_transactions_contract_info_index ON user_transactions (contract_address, module_name, function_name);
ADD COLUMN entry_function_contract_address VARCHAR(66) NOT NULL,
ADD COLUMN entry_function_ module_name VARCHAR(255) NOT NULL,
ADD COLUMN entry_function_function_name VARCHAR(255) NOT NULL;
CREATE INDEX IF NOT EXISTS user_transactions_contract_info_index ON user_transactions (entry_function_contract_address, entry_function_module_name, entry_function_function_name);
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ pub struct UserTransaction {
pub timestamp: chrono::NaiveDateTime,
pub entry_function_id_str: String,
pub epoch: i64,
pub contract_address: String,
pub module_name: String,
pub function_name: String,
pub entry_function_contract_address: String,
pub entry_function_module_name: String,
pub entry_function_function_name: String,
}

impl UserTransaction {
Expand Down Expand Up @@ -84,13 +84,13 @@ impl UserTransaction {
entry_function_id_str: get_entry_function_from_user_request(user_request)
.unwrap_or_default(),
epoch,
contract_address: get_entry_function_contract_address_from_user_request(
entry_function_contract_address: get_entry_function_contract_address_from_user_request(
user_request,
)
.unwrap_or_default(),
module_name: get_entry_function_module_name_from_user_request(user_request)
entry_function_module_name: get_entry_function_module_name_from_user_request(user_request)
.unwrap_or_default(),
function_name: get_entry_function_function_name_from_user_request(user_request)
entry_function_function_name: get_entry_function_function_name_from_user_request(user_request)
.unwrap_or_default(),
},
Self::get_signatures(user_request, version, block_height),
Expand Down
6 changes: 3 additions & 3 deletions rust/processor/src/db/postgres/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1266,11 +1266,11 @@ diesel::table! {
inserted_at -> Timestamp,
epoch -> Int8,
#[max_length = 66]
contract_address -> Varchar,
entry_function_contract_address -> Varchar,
#[max_length = 255]
module_name -> Varchar,
entry_function_module_name -> Varchar,
#[max_length = 255]
function_name -> Varchar,
entry_function_function_name -> Varchar,
}
}

Expand Down

0 comments on commit 842b453

Please sign in to comment.