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

proof generation #16

Merged
merged 6 commits into from
Dec 11, 2024
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
176 changes: 172 additions & 4 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"aarch",
"clippy",
"foundryup",
"merkle",
"ruint",
"Uniffi",
"WalletKit",
Expand Down
4 changes: 4 additions & 0 deletions walletkit-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ name = "walletkit_core"
[dependencies]
alloy-core = { version = "0.8.12", default-features = false, features = ["sol-types"] }
hex = "0.4.3"
reqwest = { version = "0.12.9", features = ["json", "brotli"] }
ruint = { version = "1.12.3", default-features = false, features = ["alloc"] }
semaphore = { git = "https://github.com/worldcoin/semaphore-rs", rev = "f266248", features = ["depth_30"] }
serde = "1.0.215"
serde_json = "1.0.133"
strum = { version = "0.26", features = ["derive"] }
thiserror = "2.0.3"
uniffi = { workspace = true, features = ["build"] }

[dev-dependencies]
alloy = { version = "0.6.4", default-features = false, features = ["json", "contract", "node-bindings"] }
mockito = "1.6.1"
regex = "1.11.1"
tokio = "1.41.1"
32 changes: 32 additions & 0 deletions walletkit-core/src/credential_type.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use strum::EnumString;

use crate::Environment;

#[derive(Debug, Clone, Copy, PartialEq, Eq, uniffi::Object, EnumString, Hash)]
#[strum(serialize_all = "snake_case")]
pub enum CredentialType {
Expand Down Expand Up @@ -28,4 +30,34 @@ impl CredentialType {
Self::SecurePassport => b"secure_passport",
}
}

/// Returns the host name for the relevant sign up sequencer to use. The sign up sequencer is used to fetch Merkle inclusion proofs.
///
/// [Reference](https://github.com/worldcoin/signup-sequencer)
///
/// # Future
/// - Support custom sign up sequencer hosts
#[must_use]
pub const fn get_sign_up_sequencer_host(&self, environment: &Environment) -> &str {
match environment {
Environment::Production => match self {
Self::Orb => "https://signup-orb-ethereum.stage-crypto.worldcoin.org",
Self::Device => {
"https://signup-phone-ethereum.stage-crypto.worldcoin.org"
}
Self::Passport => "https://signup-document.stage-crypto.worldcoin.org",
Self::SecurePassport => {
"https://signup-document-secure.stage-crypto.worldcoin.org"
}
},
Environment::Staging => match self {
Self::Orb => "https://signup-orb-ethereum.crypto.worldcoin.org",
Self::Device => "https://signup-phone-ethereum.crypto.worldcoin.org",
Self::Passport => "https://signup-document.crypto.worldcoin.org",
Self::SecurePassport => {
"https://signup-document-secure.crypto.worldcoin.org"
}
},
}
}
}
Loading
Loading