Adapt zk-token-{sdk,proof-program} for use in the monorepo
This commit is contained in:
parent
e1848ecbcc
commit
69e632a337
|
@ -80,6 +80,8 @@ members = [
|
|||
"test-validator",
|
||||
"rpc-test",
|
||||
"client-test",
|
||||
"zk-token-sdk",
|
||||
"programs/zk-token-proof",
|
||||
]
|
||||
|
||||
exclude = [
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
[package]
|
||||
name = "spl-zk-token-proof-program"
|
||||
description = "Solana Program Library ZkToken Proof Program"
|
||||
name = "solana-zk-token-proof-program"
|
||||
description = "Solana Zk Token Proof Program"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana-program-library"
|
||||
version = "0.1.0"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
version = "1.10.0"
|
||||
license = "Apache-2.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
bytemuck = { version = "1.7.2", features = ["derive"] }
|
||||
getrandom = { version = "0.1", features = ["dummy"] }
|
||||
num-derive = "0.3"
|
||||
num-traits = "0.2"
|
||||
solana-sdk = "=1.9.1"
|
||||
solana-program-runtime = "=1.9.1"
|
||||
spl-zk-token-sdk = { path = "../sdk" }
|
||||
solana-program-runtime = { path = "../../program-runtime", version = "=1.10.0" }
|
||||
solana-sdk = { path = "../../sdk", version = "=1.10.0" }
|
||||
solana-zk-token-sdk = { path = "../../zk-token-sdk", version = "=1.10.0" }
|
||||
|
|
|
@ -4,7 +4,7 @@ use {
|
|||
bytemuck::Pod,
|
||||
solana_program_runtime::{ic_msg, invoke_context::InvokeContext},
|
||||
solana_sdk::instruction::InstructionError,
|
||||
spl_zk_token_sdk::zk_token_proof_instruction::*,
|
||||
solana_zk_token_sdk::zk_token_proof_instruction::*,
|
||||
std::result::Result,
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,8 @@ pub fn process_instruction(
|
|||
// Consume compute units since proof verification is an expensive operation
|
||||
{
|
||||
let compute_meter = invoke_context.get_compute_meter();
|
||||
compute_meter.borrow_mut().consume(25_000)?; // TODO: Tune the number of units consumed?
|
||||
// TODO: Tune the number of units consumed. The current value is just a rough estimate
|
||||
compute_meter.borrow_mut().consume(100_000)?;
|
||||
}
|
||||
|
||||
match ProofInstruction::decode_type(input).ok_or(InstructionError::InvalidInstructionData)? {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[package]
|
||||
name = "spl-zk-token-sdk"
|
||||
description = "Solana Program Library ZkToken SDK"
|
||||
name = "solana-zk-token-sdk"
|
||||
description = "Solana Zk Token SDK"
|
||||
authors = ["Solana Maintainers <maintainers@solana.foundation>"]
|
||||
repository = "https://github.com/solana-labs/solana-program-library"
|
||||
version = "0.1.0"
|
||||
repository = "https://github.com/solana-labs/solana"
|
||||
version = "1.10.0"
|
||||
license = "Apache-2.0"
|
||||
edition = "2021"
|
||||
|
||||
|
@ -12,7 +12,7 @@ base64 = "0.13"
|
|||
bytemuck = { version = "1.7.2", features = ["derive"] }
|
||||
num-derive = "0.3"
|
||||
num-traits = "0.2"
|
||||
solana-program = "=1.9.1"
|
||||
solana-program = { path = "../sdk/program", version = "=1.10.0" }
|
||||
|
||||
[target.'cfg(not(target_arch = "bpf"))'.dependencies]
|
||||
aes-gcm-siv = "0.10.3"
|
||||
|
@ -28,7 +28,7 @@ rand = "0.7"
|
|||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
sha3 = "0.9"
|
||||
solana-sdk = "=1.9.1"
|
||||
solana-sdk = { path = "../sdk", version = "=1.10.0" }
|
||||
subtle = "2"
|
||||
thiserror = "1"
|
||||
zeroize = { version = "1.2.0", default-features = false, features = ["zeroize_derive"] }
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(clippy::integer_arithmetic)]
|
||||
|
||||
#[cfg(not(target_arch = "bpf"))]
|
||||
#[macro_use]
|
||||
pub(crate) mod macros;
|
||||
|
|
Loading…
Reference in New Issue