Skip to content

Commit

Permalink
refactor: rename storage
Browse files Browse the repository at this point in the history
Refs: #45
  • Loading branch information
bucurdavid committed Apr 22, 2024
1 parent cc9c615 commit 27ead9c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ pub trait DataMarket:

let mut offer = self.try_get_offer(offer_id);

let mut address_limit = self.max_quantity_per_address(&caller, offer_id).get();
let mut address_limit = self.bought_per_address(&caller, offer_id).get();

if offer.max_quantity > BigUint::zero() {
require!(
Expand All @@ -393,7 +393,7 @@ pub trait DataMarket:

address_limit += &quantity;

self.max_quantity_per_address(&caller, offer_id)
self.bought_per_address(&caller, offer_id)
.set(&address_limit);
}

Expand Down
6 changes: 3 additions & 3 deletions src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ pub trait StorageModule {
#[storage_mapper("max_default_quantity")]
fn max_default_quantity(&self) -> SingleValueMapper<BigUint>;

#[view(getMaxQuantityPerAddress)]
#[storage_mapper("max_quantity_per_address")]
fn max_quantity_per_address(
#[view(getBoughtPerAddress)]
#[storage_mapper("bought_per_address")]
fn bought_per_address(
&self,
address: &ManagedAddress,
offer_id: u64,
Expand Down
2 changes: 1 addition & 1 deletion wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ multiversx_sc_wasm_adapter::endpoints! {
getTreasuryAddress => treasury_address
getClaimsAddress => claims_address
getMaxDefaultQuantity => max_default_quantity
getMaxQuantityPerAddress => max_quantity_per_address
getBoughtPerAddress => bought_per_address
getRoyaltiesClaimToken => royalties_claim_token
getAdministrator => administrator
getClaimIsEnabled => claim_is_enabled
Expand Down

0 comments on commit 27ead9c

Please sign in to comment.