Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
xhliu committed Apr 3, 2024
1 parent d2d6058 commit 3823e21
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions docs/how-to-write-a-contract/how-to-write-a-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,25 +555,22 @@ export class Enum extends SmartContract {
@method(SigHash.ANYONECANPAY_SINGLE)
public unlock() {
let s = this.get()
assert(s == Status.Pending, 'invalid stauts')
assert(s == Status.Pending, 'invalid status')

this.set(Status.Accepted)

s = this.get()

assert(s == Status.Accepted, 'invalid stauts')
assert(s == Status.Accepted, 'invalid status')

assert(
this.ctx.hashOutputs ==
hash256(this.buildStateOutput(this.ctx.utxo.value)),
'hashOutputs check failed'
)
assert(this.ctx.hashOutputs == hash256(this.buildStateOutput(this.ctx.utxo.value)),
'hashOutputs check failed')
}
}
```
:::note
`Enum` members can only be initialized with number literal.
`Enum` members can only be initialized with literal numbers, not strings.
:::
Expand Down

0 comments on commit 3823e21

Please sign in to comment.