Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: JSON RPC deserialization in circulating supply #380

Merged
merged 6 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
545 changes: 422 additions & 123 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ members = [
"database",
"circulating-supply"
]

[workspace.dependencies]
near-jsonrpc-client = "0.6.0"
near-primitives = "0.17.0"
near-crypto = "0.17.0"
near-chain-configs = "0.17.0"
near-indexer-primitives = "0.17.0"
near-jsonrpc-primitives = "0.17.0"
6 changes: 3 additions & 3 deletions circulating-supply/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ tracing-stackdriver = "0.7.2" # GCP logs
tracing-subscriber = "0.3.15"
uint = { version = "0.8.3", default-features = false }

near-indexer-primitives = "0.16.0"
near-jsonrpc-client = "0.5.0"
near-jsonrpc-primitives = "0.16.0"
near-indexer-primitives = { workspace = true }
near-jsonrpc-client = { workspace = true }
near-jsonrpc-primitives = { workspace = true }

explorer-database = { path = '../database' }
2 changes: 1 addition & 1 deletion circulating-supply/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.67.1 AS builder
FROM rust:1.70.0 AS builder
WORKDIR /tmp/
COPY Cargo.toml Cargo.lock ./
COPY database database
Expand Down
10 changes: 5 additions & 5 deletions circulating-supply/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ async fn wait_for_loading_needed_blocks(rpc_client: &JsonRpcClient, day_to_compu
return;
}
warn!(
target: crate::CIRCULATING_SUPPLY,
"Blocks are not loaded to calculate circulating supply for {}. Wait for {} hours",
NaiveDateTime::from_timestamp(day_to_compute.as_secs() as i64, 0).date(),
crate::RETRY_DURATION.as_secs() / 60 / 60,
);
target: crate::CIRCULATING_SUPPLY,
"Blocks are not loaded to calculate circulating supply for {}. Wait for {} hours",
NaiveDateTime::from_timestamp(day_to_compute.as_secs() as i64, 0).date(),
crate::RETRY_DURATION.as_secs() / 60 / 60,
);
}
Err(err) => {
error!(
Expand Down
8 changes: 4 additions & 4 deletions database/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ tracing = "0.1.13"
tokio = { version = "1.1", features = ["sync", "time"] }

actix-diesel = { git = "https://github.com/frol/actix-diesel", rev = "3a001986c89dfabfc3c448d8bae28525101b4992" }
near-indexer-primitives = "0.16.0"
near-primitives = "0.16.0"
near-crypto = "0.16.0"
near-chain-configs = "0.16.0"
near-indexer-primitives = { workspace = true }
near-primitives = { workspace = true }
near-crypto = { workspace = true }
near-chain-configs = { workspace = true }

[features]
default = []
Expand Down
2 changes: 1 addition & 1 deletion database/src/adapters/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub async fn store_genesis_records(
let genesis = Genesis::new_with_path(
GenesisConfig::from_file(genesis_file_path.clone())?,
genesis_file_path,
);
)?;
let genesis_height = genesis.config.genesis_height;

// Remember the current actix runtime thread in order to be able to
Expand Down
2 changes: 1 addition & 1 deletion database/src/models/serializers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub(crate) fn extract_action_type_and_value_from_action_view(
} => {
let mut arguments = json!({
"method_name": method_name.escape_default().to_string(),
"args_base64": base64::encode(&args),
"args_base64": &args,
"gas": gas,
"deposit": deposit.to_string(),
});
Expand Down
2 changes: 1 addition & 1 deletion indexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tracing-stackdriver = "0.7.2" # GCP logs
tracing-subscriber = "0.3.15"
uint = { version = "0.8.3", default-features = false }

near-jsonrpc-client = "0.5.0"
near-jsonrpc-client = { workspace = true }
near-lake-framework = "0.7.1"

explorer-database = { path = "../database" }
Expand Down
2 changes: 1 addition & 1 deletion indexer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.67.1 AS builder
FROM rust:1.70.0 AS builder
WORKDIR /tmp/
COPY Cargo.toml Cargo.lock ./
COPY database database
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.67.1
1.70.0
Loading