prod v1
This commit is contained in:
parent
13eb912a99
commit
65fdc4cf44
|
|
@ -3,10 +3,10 @@ use std::str::FromStr;
|
|||
use anchor_lang::prelude::*;
|
||||
use crate::{error::BettingError, *};
|
||||
|
||||
pub fn close(ctx: Context<CloseBet>, winner:Pubkey)->Result<()>{
|
||||
pub fn close(ctx: Context<CloseBet>, winner:Pubkey, userid:String)->Result<()>{
|
||||
let bet_vault = &mut ctx.accounts.bet_vault;
|
||||
require!(
|
||||
bet_vault.owner == winner || bet_vault.joiner == winner,
|
||||
bet_vault.owner == winner || bet_vault.joiner == winner || bet_vault.owner_id == userid || bet_vault.joiner_id == userid,
|
||||
BettingError::InvalidWinner
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ pub mod bets {
|
|||
join_bet::join(ctx,user_id, game_id)
|
||||
}
|
||||
|
||||
pub fn close_bet(ctx:Context<CloseBet>, winner:Pubkey)->Result<()> {
|
||||
close_bet::close(ctx, winner)
|
||||
pub fn close_bet(ctx:Context<CloseBet>, winner:Pubkey, userid:String)->Result<()> {
|
||||
close_bet::close(ctx, winner, userid)
|
||||
}
|
||||
|
||||
pub fn refund_bet(ctx:Context<RefundBet>, owner:Pubkey)->Result<()>{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user