Skip to content

Commit

Permalink
bug fix (#2354)
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyWooo committed Dec 24, 2023
1 parent 4b4991a commit 6182c26
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
8 changes: 1 addition & 7 deletions primitives/core/src/assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,7 @@ impl Assertion {
// EVM Amount Holding
Self::EVMAmountHolding(_) => vec![Web3Network::Ethereum, Web3Network::Bsc],
// BRC20 Holder
Self::BRC20AmountHolder => vec![
Web3Network::BitcoinP2tr,
Web3Network::BitcoinP2pkh,
Web3Network::BitcoinP2sh,
Web3Network::BitcoinP2wpkh,
Web3Network::BitcoinP2wsh,
],
Self::BRC20AmountHolder => vec![Web3Network::BitcoinP2tr],
// we don't care about any specific web3 network
Self::A1 |
Self::A2(..) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const VC_BRC20_AMOUNT_HOLDER_DESCRIPTIONS: &str =
"The amount of a particular token you are holding";
const VC_BRC20_AMOUNT_HOLDER_TYPE: &str = "Token holding amount";

const BRC20_TOKENS: [&str; 7] = ["ordi", "sats", "rats", "Mmss", "long", "cats", "BTCs"];
// Keep all name in lowercase here by purpose
const BRC20_TOKENS: [&str; 7] = ["ordi", "sats", "rats", "mmss", "long", "cats", "btcs"];
const ORDI_TOKEN_BALANCE_RANGE: [f64; 8] = [0.0, 1.0, 5.0, 20.0, 50.0, 100.0, 200.0, 500.0];
const SATS_TOKEN_BALANCE_RANGE: [f64; 8] = [
0.0,
Expand Down Expand Up @@ -72,7 +73,7 @@ pub trait BRC20AmountHolderCredential {
impl BRC20AmountHolderCredential for Credential {
fn update_brc20_amount_holder_credential(&mut self, response_items: &[ResponseItem]) {
for item in response_items {
if BRC20_TOKENS.contains(&item.tick.as_str()) {
if BRC20_TOKENS.contains(&item.tick.to_lowercase().as_str()) {
let token = tick_to_brctoken(&item.tick);
let balance: f64 = item.overall_balance.parse().unwrap_or(0.0);
update_assertion(token, balance, self);
Expand Down
6 changes: 2 additions & 4 deletions tee-worker/litentry/core/data-providers/src/geniidata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::sgx_reexport_prelude::*;
extern crate sgx_tstd as std;

use crate::{build_client, Error as DataProviderError, GLOBAL_DATA_PROVIDER_CONFIG};
use http::header::ACCEPT;
use http::header::{ACCEPT, CONNECTION};
use http_req::response::Headers;
use itc_rest_client::{
error::Error as RestClientError,
Expand All @@ -39,7 +39,6 @@ use std::{
};

#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ResponseItem {
pub tick: String,
pub address: String,
Expand All @@ -49,7 +48,6 @@ pub struct ResponseItem {
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
struct ReponseData {
pub count: u64,
pub limit: String,
Expand All @@ -58,7 +56,6 @@ struct ReponseData {
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
struct GeniidataResponse {
pub code: u64,
pub message: String,
Expand All @@ -78,6 +75,7 @@ pub struct GeniidataClient {
impl GeniidataClient {
pub fn new() -> Self {
let mut headers = Headers::new();
headers.insert(CONNECTION.as_str(), "close");
headers.insert(ACCEPT.as_str(), "application/json");
headers.insert(
"api-key",
Expand Down

0 comments on commit 6182c26

Please sign in to comment.