Skip to content

Commit

Permalink
Add prefix for RevokedPemits storage keys
Browse files Browse the repository at this point in the history
  • Loading branch information
assafmo committed Oct 4, 2021
1 parent 736a0d9 commit 128e3f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub const PREFIX_ALLOWANCES: &[u8] = b"allowances";
pub const PREFIX_VIEW_KEY: &[u8] = b"viewingkey";
pub const PREFIX_RECEIVERS: &[u8] = b"receivers";

pub const PREFIX_REVOKED_PERMITS: &[u8] = b"revoked_permits";
pub const PREFIX_REVOKED_PERMITS: &str = "revoked_permits";

// Config

Expand Down Expand Up @@ -307,13 +307,13 @@ impl RevokedPemits {
account: &HumanAddr,
permit_name: &str,
) -> bool {
let storage_key = account.to_string() + permit_name;
let storage_key = PREFIX_REVOKED_PERMITS.to_string() + &account.to_string() + permit_name;

storgae.get(storage_key.as_bytes()).is_some()
}

pub fn revoke_permit(storage: &mut dyn Storage, account: &HumanAddr, permit_name: &str) {
let storage_key = account.to_string() + permit_name;
let storage_key = PREFIX_REVOKED_PERMITS.to_string() + &account.to_string() + permit_name;

storage.set(storage_key.as_bytes(), &[])
}
Expand Down

0 comments on commit 128e3f7

Please sign in to comment.