Skip to content
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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ jobs:
matrix:
include:
- command: cargo test test_complete_bridge_flow --locked -- --ignored
- command: cargo test test_api --locked -- --ignored
- command: cargo test test_api_mem --locked -- --ignored
- command: cargo test test_api_db --locked -- --ignored
steps:
- uses: actions/create-github-app-token@v1
id: app-token
Expand Down
92 changes: 84 additions & 8 deletions Cargo.lock

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

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[workspace]
members = ["apps/*"]
members = ["apps/*", "node"]
resolver = "2"

[workspace.package]
edition = "2024"
authors = ["Essential Contributions <contact@essentialcontributions.com>"]
edition = "2024"
homepage = "https://essential.builders/"
license = "Apache-2.0"
repository = "https://github.com/essential-contributions/transfers"

[workspace.dependencies]
alloy = { version = "1.0.23", features = ["rlp", "signers", "signer-mnemonic"] }
alloy = { version = "1.0.23", features = ["rlp", "signer-mnemonic", "signers"] }
anyhow = "1.0.98"
axum = "0.8.4"
clap = { version = "4.5.38", features = ["derive"] }
Expand All @@ -29,4 +29,7 @@ tokio = { version = "1.45.1", features = ["full"] }
tokio-util = "0.7.15"
tower-http = { version = "0.6.6", features = ["cors"] }
tracing = { version = "0.1.41" }
tracing-subscriber = "0.3.20"
void-toolkit = { git = "ssh://git@github.com/essential-contributions/void-toolkit.git" }

void-app-node = { path = "node" }
16 changes: 6 additions & 10 deletions apps/increment/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,16 @@ anyhow.workspace = true
axum.workspace = true
clap.workspace = true
futures.workspace = true
http.workspace = true
pin-project-lite.workspace = true
reqwest.workspace = true
rusqlite.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_yaml_ng.workspace = true
sha2.workspace = true
tempfile.workspace = true
tokio.workspace = true
tokio-util.workspace = true
tower-http.workspace = true
void-toolkit = { workspace = true, features = ["merkle", "app", "network-channel", "oracle-sqlite", "oracle" ] }
tracing.workspace = true
tracing-subscriber.workspace = true
void-app-node.workspace = true
void-toolkit = { workspace = true, features = ["merkle", "app", "network-channel", "oracle-sqlite", "oracle", "hash", "oracle-decoder"] }

[dev-dependencies]
alloy = { workspace = true, features = [ "node-bindings", "rlp", "signer-mnemonic" ] }
reqwest.workspace = true
tempfile.workspace = true
tokio-util.workspace = true
4 changes: 0 additions & 4 deletions apps/increment/sql/insert/current_proof.sql

This file was deleted.

36 changes: 36 additions & 0 deletions apps/increment/src/api.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
use std::collections::HashMap;

use alloy::primitives::Address;
use void_toolkit::types::Block;

use crate::FullDataStore;

#[derive(Default)]
pub struct Api {
pub counts_per_owner_index: HashMap<Address, Vec<u64>>,
}

pub trait ApiState {
fn update_owners_index(&mut self) -> anyhow::Result<()>;
}

impl ApiState for FullDataStore<'_, '_> {
fn update_owners_index(&mut self) -> anyhow::Result<()> {
match self {
void_app_node::storage::DataStorage::Db(tx) => tx.update_owners_index(),
void_app_node::storage::DataStorage::Memory(mem) => {
mem.api
.counts_per_owner_index
.entry(mem.app.owners.get(mem.app.count)?.into())
.or_default()
.push(mem.app.count);
Ok(())
}
}
}
}

pub fn api_update(_block: &Block, mut state: impl ApiState) -> anyhow::Result<()> {
state.update_owners_index()?;
Ok(())
}
Loading