feat(ata): integrate token-ids package and update dependencies

This commit is contained in:
Ricardo Guilherme Schmidt 2026-05-06 13:09:48 -03:00
parent 3bf91d42ef
commit f3aa7b51c8
No known key found for this signature in database
GPG Key ID: 1396EA17DE132FFE
9 changed files with 30 additions and 11 deletions

5
Cargo.lock generated
View File

@ -3200,12 +3200,17 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "token-ids"
version = "0.1.0"
[[package]] [[package]]
name = "token-methods" name = "token-methods"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"risc0-build", "risc0-build",
"risc0-zkvm", "risc0-zkvm",
"token-ids",
"token_core", "token_core",
] ]

View File

@ -1,5 +1,6 @@
[workspace] [workspace]
members = [ members = [
"token/ids",
"token/core", "token/core",
"token", "token",
"token/methods", "token/methods",

View File

@ -281,7 +281,7 @@ dependencies = [
"risc0-zkvm", "risc0-zkvm",
"serde", "serde",
"spel-framework", "spel-framework",
"token-methods", "token-ids",
"token_core", "token_core",
] ]
@ -3147,13 +3147,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]] [[package]]
name = "token-methods" name = "token-ids"
version = "0.1.0" version = "0.1.0"
dependencies = [
"risc0-build",
"risc0-zkvm",
"token_core",
]
[[package]] [[package]]
name = "token_core" name = "token_core"

View File

@ -15,7 +15,7 @@ nssa_core = { git = "https://github.com/logos-blockchain/logos-execution-zone.gi
risc0-zkvm = { version = "=3.0.5", default-features = false } risc0-zkvm = { version = "=3.0.5", default-features = false }
ata_core = { path = "../../core" } ata_core = { path = "../../core" }
ata_program = { path = "../..", package = "ata_program" } ata_program = { path = "../..", package = "ata_program" }
token-methods = { path = "../../../token/methods" } token-ids = { path = "../../../token/ids" }
token_core = { path = "../../../token/core" } token_core = { path = "../../../token/core" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
borsh = "1.5" borsh = "1.5"

View File

@ -24,7 +24,7 @@ mod ata {
token_definition, token_definition,
ata_account, ata_account,
ata_program_id, ata_program_id,
token_methods::TOKEN_ID, token_ids::TOKEN_ID,
); );
Ok(SpelOutput::with_chained_calls(post_states, chained_calls)) Ok(SpelOutput::with_chained_calls(post_states, chained_calls))
} }
@ -45,7 +45,7 @@ mod ata {
sender_ata, sender_ata,
recipient, recipient,
ata_program_id, ata_program_id,
token_methods::TOKEN_ID, token_ids::TOKEN_ID,
amount, amount,
); );
Ok(SpelOutput::with_chained_calls(post_states, chained_calls)) Ok(SpelOutput::with_chained_calls(post_states, chained_calls))
@ -66,7 +66,7 @@ mod ata {
holder_ata, holder_ata,
token_definition, token_definition,
ata_program_id, ata_program_id,
token_methods::TOKEN_ID, token_ids::TOKEN_ID,
amount, amount,
); );
Ok(SpelOutput::with_chained_calls(post_states, chained_calls)) Ok(SpelOutput::with_chained_calls(post_states, chained_calls))

4
token/ids/Cargo.toml Normal file
View File

@ -0,0 +1,4 @@
[package]
name = "token-ids"
version = "0.1.0"
edition = "2021"

3
token/ids/src/lib.rs Normal file
View File

@ -0,0 +1,3 @@
pub const TOKEN_ID: [u32; 8] = [
437848389, 692033004, 1799570421, 2462683779, 3620810328, 646372816, 1484372518, 2025744330,
];

View File

@ -10,5 +10,8 @@ risc0-build = "=3.0.5"
risc0-zkvm = { version = "=3.0.5", features = ["std"] } risc0-zkvm = { version = "=3.0.5", features = ["std"] }
token_core = { path = "../core" } token_core = { path = "../core" }
[dev-dependencies]
token-ids = { path = "../ids" }
[package.metadata.risc0] [package.metadata.risc0]
methods = ["guest"] methods = ["guest"]

View File

@ -1 +1,9 @@
include!(concat!(env!("OUT_DIR"), "/methods.rs")); include!(concat!(env!("OUT_DIR"), "/methods.rs"));
#[cfg(test)]
mod tests {
#[test]
fn token_ids_match_generated_method_id() {
assert_eq!(token_ids::TOKEN_ID, super::TOKEN_ID);
}
}