Skip to content

Commit

Permalink
counter low level fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
volovyks committed Aug 31, 2022
1 parent 714f783 commit b449518
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/src/counter-lowlevel.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// This contract implements exact same functionality as counter.js, but only use low level APIs
import {near} from 'near-sdk-js'
import { near } from 'near-sdk-js'

export function init() {
let argsRaw = near.input()
let args = JSON.parse(argsRaw || "{}")
let initial = args.initial || 0
let count = initial
let state = JSON.stringify({count})
let state = JSON.stringify({ count })
near.storageWrite('STATE', state)
}

Expand All @@ -15,7 +15,7 @@ function deserialize() {
if (state) {
return JSON.parse(state)
} else {
throw new Error("Contract state is empty")
return { count: 0 }
}
}

Expand Down

0 comments on commit b449518

Please sign in to comment.