Skip to content

Commit

Permalink
fix oracle fee
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar committed Feb 11, 2025
1 parent 0203124 commit 9a41626
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/onchain_ai_chat/sources/ai_service.move
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ module onchain_ai_chat::ai_service {
let from_addr = signer::address_of(from);
let oracle_balance = oracles::get_user_balance(from_addr);
if(oracle_balance < oracle_fee) {
let pay_mee = oracle_fee - oracle_balance;
let gas_balance = account_coin_store::balance<RGas>(from_addr);
assert!(gas_balance >= oracle_fee, ErrorInsufficientBalance);
oracles::deposit_to_escrow(from, oracle_fee);
assert!(gas_balance >= pay_mee, ErrorInsufficientBalance);
oracles::deposit_to_escrow(from, pay_mee);
};

let request_id = oracles::new_request(
Expand Down

0 comments on commit 9a41626

Please sign in to comment.