Skip to content

fix typo #108

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

Merged
merged 6 commits into from
Sep 19, 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
8 changes: 4 additions & 4 deletions ref-exchange/src/client_echo_limit.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::*;

pub fn read_ce_tw_from_storage() -> UnorderedSet<AccountId> {
if let Some(content) = env::storage_read(CLIENT_ECHO_TOKEN_ID_WHITHELIST.as_bytes()) {
if let Some(content) = env::storage_read(CLIENT_ECHO_TOKEN_ID_WHITELIST.as_bytes()) {
UnorderedSet::try_from_slice(&content).expect("deserialize client echo token id whitelist failed.")
} else {
UnorderedSet::new(StorageKey::ClientEchoTokenIdWhitelistItem)
Expand All @@ -10,13 +10,13 @@ pub fn read_ce_tw_from_storage() -> UnorderedSet<AccountId> {

pub fn write_ce_tw_to_storage(client_echo_token_id_whitelist: UnorderedSet<AccountId>) {
env::storage_write(
CLIENT_ECHO_TOKEN_ID_WHITHELIST.as_bytes(),
CLIENT_ECHO_TOKEN_ID_WHITELIST.as_bytes(),
&client_echo_token_id_whitelist.try_to_vec().unwrap(),
);
}

pub fn read_ce_sw_from_storage() -> UnorderedSet<AccountId> {
if let Some(content) = env::storage_read(CLIENT_ECHO_SENDER_ID_WHITHELIST.as_bytes()) {
if let Some(content) = env::storage_read(CLIENT_ECHO_SENDER_ID_WHITELIST.as_bytes()) {
UnorderedSet::try_from_slice(&content).expect("deserialize client echo sender id whitelist failed.")
} else {
UnorderedSet::new(StorageKey::ClientEchoSenderIdWhitelistItem)
Expand All @@ -25,7 +25,7 @@ pub fn read_ce_sw_from_storage() -> UnorderedSet<AccountId> {

pub fn write_ce_sw_to_storage(client_echo_sender_id_whitelist: UnorderedSet<AccountId>) {
env::storage_write(
CLIENT_ECHO_SENDER_ID_WHITHELIST.as_bytes(),
CLIENT_ECHO_SENDER_ID_WHITELIST.as_bytes(),
&client_echo_sender_id_whitelist.try_to_vec().unwrap(),
);
}
Expand Down
4 changes: 2 additions & 2 deletions ref-exchange/src/custom_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ pub const DEGEN_ORACLE_CONFIG_STORAGE_KEY: &str = "custom_degen_oracle_config_ke
pub const POOL_LIMIT: &str = "pl";

// Key for client echo limit
pub const CLIENT_ECHO_TOKEN_ID_WHITHELIST: &str = "ce_tw";
pub const CLIENT_ECHO_SENDER_ID_WHITHELIST: &str = "ce_sw";
pub const CLIENT_ECHO_TOKEN_ID_WHITELIST: &str = "ce_tw";
pub const CLIENT_ECHO_SENDER_ID_WHITELIST: &str = "ce_sw";
Loading