Skip to content

Commit

Permalink
nba(jump ball): cadence
Browse files Browse the repository at this point in the history
* Update access.
  • Loading branch information
chumeston committed Dec 16, 2024
1 parent 44b09b5 commit 5835bf1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/JumpBall.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ access(all) contract JumpBall {
}

// Admin resource for game management
access(all) resource Admin {
access(all) fun determineWinner(gameID: UInt64, stats: {UInt64: UInt64}) {
access(self) resource Admin {
access(contract) fun determineWinner(gameID: UInt64, stats: {UInt64: UInt64}) {
let game = JumpBall.games[gameID] ?? panic("Game does not exist.")

let creatorTotal = self.calculateTotal(game: game, address: game.creator, stats: stats)
Expand All @@ -187,7 +187,7 @@ access(all) contract JumpBall {
}
}

access(self) fun calculateTotal(game: &Game, address: Address?, stats: {UInt64: UInt64}): UInt64 {
access(contract) fun calculateTotal(game: &Game, address: Address?, stats: {UInt64: UInt64}): UInt64 {
if address == nil {
return 0
}
Expand All @@ -201,7 +201,7 @@ access(all) contract JumpBall {
})
}

access(self) fun awardWinner(game: &Game, winner: Address, winnerCap: Capability<&{NonFungibleToken.Collection}>) {
access(contract) fun awardWinner(game: &Game, winner: Address, winnerCap: Capability<&{NonFungibleToken.Collection}>) {
emit WinnerDetermined(gameID: game.id, winner: winner)
game.transferAllToWinner(winner: winner, winnerCap: winnerCap)
}
Expand Down

0 comments on commit 5835bf1

Please sign in to comment.