Skip to content

Commit

Permalink
Merge pull request #319 from yusufidimaina9989/demo
Browse files Browse the repository at this point in the history
Change add() to static
  • Loading branch information
yusufidimaina9989 authored Jan 27, 2024
2 parents aa54866 + c78b1e7 commit 15ed74f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/contracts/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ export class Demo extends SmartContract {
// for the two equations `x + y = summ` and `x - y = diff`.
@method()
public unlock(x: bigint, y: bigint) {
assert(this.add(x, y) == this.sum, 'incorrect sum')
assert(Demo.add(x, y) == this.sum, 'incorrect sum')
assert(x - y == this.diff, 'incorrect diff')
}

// Non-public methods cannot be directly called and are intended for internal use within the contract.
@method()
add(x: bigint, y: bigint): bigint {
static add(x: bigint, y: bigint): bigint {
return x + y
}
}

0 comments on commit 15ed74f

Please sign in to comment.