-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Typo in logic sig visitor and typing of options decorators + inc…
…rease test coverage
- Loading branch information
1 parent
d8c8c9a
commit 56725d2
Showing
4 changed files
with
49 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { logicsig, LogicSig } from '@algorandfoundation/algorand-typescript' | ||
|
||
@logicsig({ name: 'BadLogicSig' }) | ||
// @expect-error Only one decorator is allowed per logic signature. | ||
@logicsig({ name: 'BadLogicSig' }) | ||
class BadLogicSig extends LogicSig { | ||
// @expect-error Property declarations are not supported in logic signature definitions | ||
static staticProp: string | ||
// @expect-error Class static block declarations are not supported in logic signature definitions | ||
static { | ||
this.staticProp = 'oh noes' | ||
} | ||
|
||
program(): boolean { | ||
return true | ||
} | ||
|
||
// @expect-error Constructor declarations are not supported in logic signature definitions | ||
constructor() { | ||
super() | ||
} | ||
|
||
// @expect-error Property declarations are not supported in logic signature definitions | ||
instanceProp: string = '' | ||
|
||
// @expect-error Property declarations are not supported in logic signature definitions | ||
get readAccessor() { | ||
return this.instanceProp | ||
} | ||
|
||
// @expect-error Property declarations are not supported in logic signature definitions | ||
set writeAccessor(val: string) { | ||
this.instanceProp = val | ||
} | ||
|
||
// @expect-error LogicSig classes may only contain a program implementation method named 'program'. Consider making 'someMethod' a free subroutine. | ||
public someMethod() { | ||
return this.instanceProp + BadLogicSig.staticProp | ||
} | ||
} |