From 5f0c99530ce8135163d6a83fc6980ed8c046a550 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 29 May 2023 23:41:15 +0200 Subject: [PATCH] referral code does not have llamanodes- prefix any longer (#90) --- web3_proxy/src/referral_code.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web3_proxy/src/referral_code.rs b/web3_proxy/src/referral_code.rs index 49b8b08c..f27850e7 100644 --- a/web3_proxy/src/referral_code.rs +++ b/web3_proxy/src/referral_code.rs @@ -8,7 +8,7 @@ pub struct ReferralCode(String); impl Default for ReferralCode { fn default() -> Self { let out = Ulid::new(); - Self(format!("llamanodes-{}", out)) + Self(format!("{}", out)) } } @@ -22,11 +22,13 @@ impl TryFrom for ReferralCode { type Error = anyhow::Error; fn try_from(x: String) -> Result { - if !x.starts_with("llamanodes-") { - return Err(anyhow::anyhow!( - "Referral Code does not have the right format" - )); - } + // TODO: Check if string is a valid ULID Ok(Self(x)) + // match Ulid::try_from(x.clone()) { + // Ok(_) => , + // Err(_) => Err(anyhow::anyhow!( + // "Referral Code does not have the right format" + // )), + // } } }