Skip to content

Commit

Permalink
Create Indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
CapCap authored and aptos-bot committed Apr 15, 2022
1 parent 600907e commit 1650f3b
Show file tree
Hide file tree
Showing 33 changed files with 1,633 additions and 7 deletions.
185 changes: 181 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ members = [
"devtools/x",
"devtools/x-core",
"devtools/x-lint",
"ecosystem/indexer",
"execution/db-bootstrapper",
"execution/executor",
"execution/executor-benchmark",
Expand Down Expand Up @@ -141,6 +142,7 @@ default-members = [
"storage/backup/backup-cli",
"storage/aptossum",
"storage/inspector",
"ecosystem/indexer",
]

[profile.release]
Expand Down
20 changes: 20 additions & 0 deletions api/types/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ impl Transaction {
}
}

pub fn version(&self) -> Option<u64> {
match self {
Transaction::UserTransaction(txn) => Some(txn.info.version.into()),
Transaction::BlockMetadataTransaction(txn) => Some(txn.info.version.into()),
Transaction::PendingTransaction(_) => None,
Transaction::GenesisTransaction(txn) => Some(txn.info.version.into()),
Transaction::StateCheckpointTransaction(txn) => Some(txn.info.version.into()),
}
}

pub fn success(&self) -> bool {
match self {
Transaction::UserTransaction(txn) => txn.info.success,
Expand All @@ -142,6 +152,16 @@ impl Transaction {
}
}

pub fn type_str(&self) -> &'static str {
match self {
Transaction::PendingTransaction(_) => "pending_transaction",
Transaction::UserTransaction(_) => "user_transaction",
Transaction::GenesisTransaction(_) => "genesis_transaction",
Transaction::BlockMetadataTransaction(_) => "block_metadata_transaction",
Transaction::StateCheckpointTransaction(_) => "state_checkpoint_transaction",
}
}

pub fn transaction_info(&self) -> anyhow::Result<&TransactionInfo> {
Ok(match self {
Transaction::UserTransaction(txn) => &txn.info,
Expand Down
2 changes: 1 addition & 1 deletion crates/aptos-faucet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hex = "0.4.3"
rand = "0.8.3"
reqwest = { version = "0.11.2", features = ["blocking"], default-features = false }
serde = { version = "1.0.124", features = ["derive"] }
serde_json = "1.0.61"
serde_json = "1.0.64"
structopt = "0.3.21"
tokio = { version = "1.8.1", features = ["full"] }
url = "2.2.2"
Expand Down
6 changes: 4 additions & 2 deletions crates/aptos-workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ crossbeam-channel = { version = "0.5.2", features = ["crossbeam-utils", "std"] }
crossbeam-deque = { version = "0.8.1", features = ["crossbeam-epoch", "crossbeam-utils", "std"] }
crossbeam-queue = { version = "0.3.4", features = ["alloc", "std"] }
crossbeam-utils = { version = "0.8.7", features = ["lazy_static", "std"] }
diesel = { version = "1.4.8", features = ["32-column-tables", "bigdecimal", "bitflags", "chrono", "num-bigint", "num-integer", "num-traits", "numeric", "postgres", "pq-sys", "r2d2", "serde_json", "with-deprecated"] }
either = { version = "1.6.1", features = ["use_std"] }
futures-channel = { version = "0.3.21", features = ["alloc", "futures-sink", "sink", "std"] }
futures-core = { version = "0.3.21", features = ["alloc", "std"] }
Expand All @@ -36,7 +37,7 @@ itertools = { version = "0.10.3", features = ["use_alloc", "use_std"] }
libc = { version = "0.2.119", features = ["std"] }
log = { version = "0.4.14", default-features = false, features = ["serde", "std"] }
memchr = { version = "2.4.1", features = ["std", "use_std"] }
num-integer = { version = "0.1.44", default-features = false, features = ["i128", "std"] }
num-integer = { version = "0.1.44", features = ["i128", "std"] }
num-traits = { version = "0.2.14", features = ["i128", "std"] }
parking_lot = { version = "0.12.0", features = ["send_guard"] }
phf_shared = { version = "0.10.0", features = ["std", "uncased"] }
Expand Down Expand Up @@ -70,6 +71,7 @@ crossbeam-channel = { version = "0.5.2", features = ["crossbeam-utils", "std"] }
crossbeam-deque = { version = "0.8.1", features = ["crossbeam-epoch", "crossbeam-utils", "std"] }
crossbeam-queue = { version = "0.3.4", features = ["alloc", "std"] }
crossbeam-utils = { version = "0.8.7", features = ["lazy_static", "std"] }
diesel = { version = "1.4.8", features = ["32-column-tables", "bigdecimal", "bitflags", "chrono", "num-bigint", "num-integer", "num-traits", "numeric", "postgres", "pq-sys", "r2d2", "serde_json", "with-deprecated"] }
either = { version = "1.6.1", features = ["use_std"] }
futures-channel = { version = "0.3.21", features = ["alloc", "futures-sink", "sink", "std"] }
futures-core = { version = "0.3.21", features = ["alloc", "std"] }
Expand All @@ -84,7 +86,7 @@ itertools = { version = "0.10.3", features = ["use_alloc", "use_std"] }
libc = { version = "0.2.119", features = ["std"] }
log = { version = "0.4.14", default-features = false, features = ["serde", "std"] }
memchr = { version = "2.4.1", features = ["std", "use_std"] }
num-integer = { version = "0.1.44", default-features = false, features = ["i128", "std"] }
num-integer = { version = "0.1.44", features = ["i128", "std"] }
num-traits = { version = "0.2.14", features = ["i128", "std"] }
parking_lot = { version = "0.12.0", features = ["send_guard"] }
phf_shared = { version = "0.10.0", features = ["std", "uncased"] }
Expand Down
Loading

0 comments on commit 1650f3b

Please sign in to comment.