diff --git a/rust/Cargo.lock b/rust/Cargo.lock
index 4efcce8e9..35ff93505 100644
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -848,6 +848,26 @@ dependencies = [
"tiny-keccak",
]
+[[package]]
+name = "const_format"
+version = "0.2.33"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b"
+dependencies = [
+ "const_format_proc_macros",
+]
+
+[[package]]
+name = "const_format_proc_macros"
+version = "0.2.33"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-xid",
+]
+
[[package]]
name = "cookie"
version = "0.17.0"
@@ -3331,6 +3351,7 @@ dependencies = [
"canonical_json",
"chrono",
"clap",
+ "const_format",
"diesel",
"diesel-async",
"diesel_migrations",
@@ -5200,6 +5221,12 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52ea75f83c0137a9b98608359a5f1af8144876eb67bcb1ce837368e906a9f524"
+[[package]]
+name = "unicode-xid"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a"
+
[[package]]
name = "untrusted"
version = "0.7.1"
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 9ba106d11..b9a2588e7 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -42,6 +42,7 @@ bigdecimal = { version = "0.4.0", features = ["serde"] }
bitflags = "2.5.0"
chrono = { version = "0.4.19", features = ["clock", "serde"] }
clap = { version = "4.3.5", features = ["derive", "unstable-styles"] }
+const_format = "0.2.33"
# Do NOT enable the postgres feature here, it is conditionally enabled in a feature
# block in the Cargo.toml file for the processor crate.
# https://github.com/aptos-labs/aptos-indexer-processors/pull/325
diff --git a/rust/processor/Cargo.toml b/rust/processor/Cargo.toml
index 32c87ad6a..964e6fb63 100644
--- a/rust/processor/Cargo.toml
+++ b/rust/processor/Cargo.toml
@@ -27,6 +27,7 @@ bitflags = { workspace = true }
canonical_json = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true }
+const_format = { workspace = true }
diesel = { workspace = true }
diesel-async = { workspace = true }
diesel_migrations = { workspace = true }
diff --git a/rust/processor/src/db/common/models/account_transaction_models/account_transactions.rs b/rust/processor/src/db/common/models/account_transaction_models/account_transactions.rs
index 385d1e010..611e16652 100644
--- a/rust/processor/src/db/common/models/account_transaction_models/account_transactions.rs
+++ b/rust/processor/src/db/common/models/account_transaction_models/account_transactions.rs
@@ -7,7 +7,7 @@
use crate::{
db::common::models::{
- object_models::v2_object_utils::ObjectWithMetadata,
+ object_models::v2_object_utils::ObjectWithMetadata, resources::FromWriteResource,
user_transactions_models::user_transactions::UserTransaction,
},
schema::account_transactions,
@@ -98,9 +98,7 @@ impl AccountTransaction {
// owner as well.
// This handles partial deletes as well.
accounts.insert(standardize_address(res.address.as_str()));
- if let Some(inner) =
- &ObjectWithMetadata::from_write_resource(res, txn_version).unwrap()
- {
+ if let Some(inner) = &ObjectWithMetadata::from_write_resource(res).unwrap() {
accounts.insert(inner.object_core.get_owner_address());
}
},
diff --git a/rust/processor/src/db/common/models/coin_models/coin_utils.rs b/rust/processor/src/db/common/models/coin_models/coin_utils.rs
index ec46f532c..b8a378156 100644
--- a/rust/processor/src/db/common/models/coin_models/coin_utils.rs
+++ b/rust/processor/src/db/common/models/coin_models/coin_utils.rs
@@ -5,7 +5,7 @@
#![allow(clippy::extra_unused_lifetimes)]
use crate::{
- db::common::models::default_models::move_resources::MoveResource,
+ db::common::models::{default_models::move_resources::MoveResource, resources::COIN_ADDR},
utils::util::{deserialize_from_string, hash_str, standardize_address, truncate_str},
};
use anyhow::{bail, Context, Result};
@@ -16,7 +16,6 @@ use regex::Regex;
use serde::{Deserialize, Serialize};
use tracing::error;
-pub const COIN_ADDR: &str = "0x0000000000000000000000000000000000000000000000000000000000000001";
const COIN_TYPE_HASH_LENGTH: usize = 5000;
const COIN_TYPE_MAX: usize = 1000;
diff --git a/rust/processor/src/db/common/models/fungible_asset_models/parquet_v2_fungible_asset_balances.rs b/rust/processor/src/db/common/models/fungible_asset_models/parquet_v2_fungible_asset_balances.rs
index d5140e92f..3418e663a 100644
--- a/rust/processor/src/db/common/models/fungible_asset_models/parquet_v2_fungible_asset_balances.rs
+++ b/rust/processor/src/db/common/models/fungible_asset_models/parquet_v2_fungible_asset_balances.rs
@@ -17,6 +17,7 @@ use crate::{
v2_fungible_asset_utils::FungibleAssetStore,
},
object_models::v2_object_utils::ObjectAggregatedDataMapping,
+ resources::FromWriteResource,
token_v2_models::v2_token_utils::TokenStandard,
},
utils::util::standardize_address,
@@ -76,8 +77,7 @@ impl FungibleAssetBalance {
txn_timestamp: chrono::NaiveDateTime,
object_metadatas: &ObjectAggregatedDataMapping,
) -> anyhow::Result