Skip to content

Commit

Permalink
fix: update coin info function
Browse files Browse the repository at this point in the history
  • Loading branch information
mx819812523 committed Jan 20, 2025
1 parent 6b0d31f commit 1a07941
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/rooch_dex/sources/swap.move
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module rooch_dex::swap {
use moveos_std::tx_context::sender;
use moveos_std::object;
use moveos_std::account;
use rooch_framework::coin::{CoinInfo, coin_info};
use rooch_framework::coin::{CoinInfo, coin_info, symbol_by_type, supply_by_type};
use moveos_std::object::{Object, ObjectID};
use rooch_framework::coin_store::{CoinStore, balance, deposit, withdraw};
use rooch_framework::coin_store;
Expand Down Expand Up @@ -123,8 +123,8 @@ module rooch_dex::swap {
let resource_signer = module_signer<RoochDexCap>();

let lp_name: string::String = string::utf8(b"RoochDex-");
let name_x = coin::symbol<X>(coin_info<X>());
let name_y = coin::symbol<Y>(coin_info<Y>());
let name_x = symbol_by_type<X>();
let name_y = symbol_by_type<Y>();
string::append(&mut lp_name, name_x);
string::append_utf8(&mut lp_name, b"-");
string::append(&mut lp_name, name_y);
Expand Down Expand Up @@ -189,7 +189,7 @@ module rooch_dex::swap {

/// Get the total supply of LP Tokens
public fun total_lp_supply<X:key+store, Y:key+store>(): u128 {
(coin::supply(coin_info<LPToken<X, Y>>()) as u128)
(supply_by_type<LPToken<X, Y>>() as u128)
}

/// Get the current reserves of T0 and T1 with the latest updated timestamp
Expand Down

0 comments on commit 1a07941

Please sign in to comment.