Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .test-env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configs for testing repo download:
SDK_TESTING_URL="https://github.com/algorand/algorand-sdk-testing"
SDK_TESTING_BRANCH="master"
SDK_TESTING_BRANCH="zero-length"
Comment thread
ahangsu marked this conversation as resolved.
Outdated
SDK_TESTING_HARNESS="test-harness"

INSTALL_ONLY=0
Expand Down
6 changes: 3 additions & 3 deletions src/abi/abi_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Segment {
right: number;
}

const staticArrayRegexp = /^([a-z\d[\](),]+)\[([1-9][\d]*)]$/;
const staticArrayRegexp = /^([a-z\d[\](),]+)\[(0|[1-9][\d]*)]$/;
const ufixedRegexp = /^ufixed([1-9][\d]*)x([1-9][\d]*)$/;

export type ABIValue =
Expand Down Expand Up @@ -414,9 +414,9 @@ export class ABIArrayStaticType extends ABIType {

constructor(argType: ABIType, arrayLength: number) {
super();
if (arrayLength < 1) {
if (arrayLength < 0) {
throw new Error(
`static array must have a length greater than 0: ${arrayLength}`
`static array must have a non negative length: ${arrayLength}`
);
}
this.childType = argType;
Expand Down
1 change: 0 additions & 1 deletion tests/10.ABI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ describe('ABI type checking', () => {
'[][][]',
'stuff[]',
// static array
'ufixed32x10[0]',
Comment thread
ahangsu marked this conversation as resolved.
'byte[10 ]',
'uint64[0x21]',
// tuple
Expand Down