Skip to content

Commit

Permalink
counter examples fixed, init deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
volovyks committed Aug 31, 2022
1 parent 07f29e2 commit 5d60320
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 0 additions & 2 deletions examples/__tests__/test-counter.ava.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ test.beforeEach(async t => {
(process.env['COUNTER_TS'] ? './build/counter-ts.wasm' : './build/counter.wasm')
);

// Init the contract
await counter.call(counter, 'init', {});

// Test users
const ali = await root.createSubAccount('ali');
Expand Down
5 changes: 2 additions & 3 deletions examples/src/counter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import { isUndefined } from 'lodash-es'

@NearBindgen({})
class Counter {
@initialize
init({ initial = 0 }) {
this.count = initial
constructor() {
this.count = 0
}

@call
Expand Down
7 changes: 1 addition & 6 deletions examples/src/counter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import { log } from './log'

@NearBindgen({})
class Counter {
count: number;

@initialize
init({ initial = 0 }: { initial: number }) {
this.count = initial
}
count: number = 0;

@call
increase({ n = 1 }: { n: number }) {
Expand Down

0 comments on commit 5d60320

Please sign in to comment.