Skip to content

Commit

Permalink
Merge branch 'testnet' into feat/whitelist-paymaster-users
Browse files Browse the repository at this point in the history
  • Loading branch information
Marchand-Nicolas committed Jul 15, 2024
2 parents cb1ac0e + 7e692e1 commit 4ec723a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ rand = "0.8.5"

# required for solana SDK to work
[patch.crates-io.curve25519-dalek]
git = "https://github.com/solana-labs/curve25519-dalek.git"
rev = "c14774464c4d38de553c6ef2f48a10982c1b4801"
git = "https://github.com/anza-xyz/curve25519-dalek.git"
rev = "b500cdc2a920cd5bff9e2dd974d7b97349d61464"
5 changes: 4 additions & 1 deletion config.template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ port = 8080
name = "starknetid"
connection_string = "xxxxxx"
[databases.sales]
name = "goerli"
name = "sepolia"
connection_string = "xxxxxx"
[databases.free_domains]
name = "sepolia_free_domains"
connection_string = "xxxxxx"

[contracts]
Expand Down
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub_struct!(Clone, Deserialize; Server { port: u16 });
pub_struct!(Clone, Deserialize; Databases {
starknetid: Database,
sales: Database,
free_domains: Database,
});

pub_struct!(Clone, Deserialize; Database {
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/campaigns/get_free_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub async fn handler(
let domain_len = domain_parts[0].len();

let free_domains = state
.starknetid_db
.free_domains_db
.collection::<mongodb::bson::Document>("free_domain_ticket");
match free_domains
.find_one(
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/crosschain/ethereum/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pub async fn get_profile_picture_uri(
match uri {
Some(u) if u.contains("base64") => Some(parse_base64_image(u)),
Some(u) => Some(fetch_image_url(config, u).await),
None if use_default_pfp => Some(format!("https://starknet.id/api/identicons/{}", id)),
None if use_default_pfp => Some(format!("https://identicon.starknet.id/{}", id)),
_ => None,
}
}
4 changes: 2 additions & 2 deletions src/endpoints/uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub async fn handler(
description: "This token represents an identity on StarkNet.".to_string(),
image: match img_url {
Some(url) => url,
None => format!("https://starknet.id/api/identicons/{}", &query.id),
None => format!("https://identicon.starknet.id/{}", &query.id),
},
expiry: Some(expiry),
attributes: Some(vec![
Expand All @@ -171,7 +171,7 @@ pub async fn handler(
let token_uri = TokenURI {
name: format!("Starknet ID: {}", &query.id),
description: "This token represents an identity on StarkNet.".to_string(),
image: format!("https://starknet.id/api/identicons/{}", &query.id),
image: format!("https://identicon.starknet.id/{}", &query.id),
expiry: None,
attributes: None,
};
Expand Down
7 changes: 7 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ async fn main() {
let sales_client_options = ClientOptions::parse(&conf.databases.sales.connection_string)
.await
.unwrap();
let free_domains_client_options =
ClientOptions::parse(&conf.databases.free_domains.connection_string)
.await
.unwrap();

let states = tax::sales_tax::load_sales_tax().await;
if states.states.is_empty() {
Expand All @@ -52,6 +56,9 @@ async fn main() {
sales_db: Client::with_options(sales_client_options)
.unwrap()
.database(&conf.databases.sales.name),
free_domains_db: Client::with_options(free_domains_client_options)
.unwrap()
.database(&conf.databases.free_domains.name),
states,
dynamic_offchain_resolvers: Arc::new(Mutex::new(HashMap::new())),
});
Expand Down
1 change: 1 addition & 0 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub struct AppState {
pub conf: Config,
pub starknetid_db: Database,
pub sales_db: Database,
pub free_domains_db: Database,
pub states: States,
pub dynamic_offchain_resolvers: Arc<Mutex<HashMap<String, OffchainResolver>>>,
}
Expand Down

0 comments on commit 4ec723a

Please sign in to comment.