Skip to content

Instantly share code, notes, and snippets.

@dansteren
Created February 23, 2023 20:31
Show Gist options
  • Save dansteren/9eb3244101a2bd799a5a79669123249a to your computer and use it in GitHub Desktop.
Save dansteren/9eb3244101a2bd799a5a79669123249a to your computer and use it in GitHub Desktop.
Azle Type Alias Traversal Test Case
import {nat32, Record} from 'azle'
// export type nat32 = number;
type One = string;
type Two = nat32;
type Three = One;
type Four = BigBoyClass
type Five = MyRecord
type Six = Four
type MyRecord = Record<{}>
class BigBoyClass {}
type SomeRecord = Record<{}> // As an inline type instead of a record
// What to pass to Framework
types = {
type_alias: [
One => Primitive(string),
Two => Primitive(nat32),
Three => TypeRef(One),
// Four => TypeRef(BigBoyClass)
Six => TypeRef(Four)
Five => TypeRef(MyRecord),
SomeRecord => Record(...)
]
records: [
MyRecord => Record
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment