Skip to content

Commit

Permalink
Change table style
Browse files Browse the repository at this point in the history
  • Loading branch information
alnoki committed Jan 3, 2025
1 parent 0f76169 commit dcd1e56
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/move/emojicoin_arena/sources/emojicoin_arena.move
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module arena::emojicoin_arena {
use aptos_framework::randomness::Self;
use aptos_framework::timestamp;
use aptos_std::math64::min;
use aptos_std::smart_table::{Self, SmartTable};
use aptos_std::table::{Self, Table};
use aptos_std::table_with_length::{Self, TableWithLength};
use aptos_std::type_info;
use arena::pseudo_randomness;
use emojicoin_dot_fun::emojicoin_dot_fun;
Expand Down Expand Up @@ -78,10 +79,12 @@ module arena::emojicoin_arena {
}

struct Registry has key {
/// A map of each `Melee`'s `melee_id` to the `Melee` itself.
melees_by_id: SmartTable<u64, Melee>,
/// Map from a sorted combination of market IDs (lower ID first) to the `Melee` serial ID.
melee_ids_by_market_ids: SmartTable<vector<u64>, u64>,
/// A map of each `Melee`'s `melee_id` to the `Melee` itself. 1-indexed for conformity with
/// emojicoin market ID indexing.
melees_by_id: TableWithLength<u64, Melee>,
/// Map from a sorted combination of market IDs (lower ID first) to the `Melee` serial ID,
/// used to prevent duplicate melees by reverse lookup during crank time.
melee_ids_by_market_ids: Table<vector<u64>, u64>,
/// Approves transfers from the vault.
signer_capability: SignerCapability,
/// `Melee.duration` for next melee.
Expand Down Expand Up @@ -452,8 +455,8 @@ module arena::emojicoin_arena {
move_to(
arena,
Registry {
melees_by_id: smart_table::new(),
melee_ids_by_market_ids: smart_table::new(),
melees_by_id: table_with_length::new(),
melee_ids_by_market_ids: table::new(),
signer_capability,
next_melee_duration: DEFAULT_DURATION,
next_melee_available_rewards: DEFAULT_AVAILABLE_REWARDS,
Expand Down

0 comments on commit dcd1e56

Please sign in to comment.