Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyProgrammist committed Jan 14, 2024
1 parent 5106ea0 commit 6d29960
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 126 deletions.
1 change: 1 addition & 0 deletions src/astbuilder/fill_constructors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,7 @@ function checkAndRemovePrimitives(
typesToDelete.set("MsgAddress", ["606aa05e", "21d0382b"])
typesToDelete.set("VarUInteger", ["11d56c2e"])
typesToDelete.set("VarInteger", ["d466ed5"])
typesToDelete.set("HashmapE", ["32bae5cb", "28fa3979"])

typesToDelete.forEach((opCodesExpected: string[], typeName: string) => {
let typeItems = typeDeclarations.get(typeName);
Expand Down
63 changes: 0 additions & 63 deletions test/generated_files/generated_block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,23 +155,6 @@ export interface Unary_unary_succ {
readonly x: Unary;
}

// hme_empty$0 {n:#} {X:Type} = HashmapE n X;

// hme_root$1 {n:#} {X:Type} root:^(Hashmap n X) = HashmapE n X;

export type HashmapE<X> = HashmapE_hme_empty<X> | HashmapE_hme_root<X>;

export interface HashmapE_hme_empty<X> {
readonly kind: 'HashmapE_hme_empty';
readonly n: number;
}

export interface HashmapE_hme_root<X> {
readonly kind: 'HashmapE_hme_root';
readonly n: number;
readonly root: Hashmap<X>;
}

// _ {n:#} _:(Hashmap n True) = BitstringSet n;

export interface BitstringSet {
Expand Down Expand Up @@ -4226,52 +4209,6 @@ export function storeUnary(unary: Unary): (builder: Builder) => void {
throw new Error('Expected one of "Unary_unary_zero", "Unary_unary_succ" in loading "Unary", but data does not satisfy any constructor');
}

// hme_empty$0 {n:#} {X:Type} = HashmapE n X;

// hme_root$1 {n:#} {X:Type} root:^(Hashmap n X) = HashmapE n X;

export function loadHashmapE<X>(slice: Slice, n: number, loadX: (slice: Slice) => X): HashmapE<X> {
if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) {
slice.loadUint(1);
return {
kind: 'HashmapE_hme_empty',
n: n,
}

}
if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) {
slice.loadUint(1);
let slice1 = slice.loadRef().beginParse();
let root: Hashmap<X> = loadHashmap<X>(slice1, n, loadX);
return {
kind: 'HashmapE_hme_root',
n: n,
root: root,
}

}
throw new Error('Expected one of "HashmapE_hme_empty", "HashmapE_hme_root" in loading "HashmapE", but data does not satisfy any constructor');
}

export function storeHashmapE<X>(hashmapE: HashmapE<X>, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void {
if ((hashmapE.kind == 'HashmapE_hme_empty')) {
return ((builder: Builder) => {
builder.storeUint(0b0, 1);
})

}
if ((hashmapE.kind == 'HashmapE_hme_root')) {
return ((builder: Builder) => {
builder.storeUint(0b1, 1);
let cell1 = beginCell();
storeHashmap<X>(hashmapE.root, storeX)(cell1);
builder.storeRef(cell1);
})

}
throw new Error('Expected one of "HashmapE_hme_empty", "HashmapE_hme_root" in loading "HashmapE", but data does not satisfy any constructor');
}

// _ {n:#} _:(Hashmap n True) = BitstringSet n;

export function loadBitstringSet(slice: Slice, n: number): BitstringSet {
Expand Down
63 changes: 0 additions & 63 deletions test/generated_files/generated_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,23 +462,6 @@ export interface HmLabel_hml_same {
readonly n: number;
}

// hme_empty$0 {n:#} {X:Type} = HashmapE n X;

// hme_root$1 {n:#} {X:Type} root:^(Hashmap n X) = HashmapE n X;

export type HashmapE<X> = HashmapE_hme_empty<X> | HashmapE_hme_root<X>;

export interface HashmapE_hme_empty<X> {
readonly kind: 'HashmapE_hme_empty';
readonly n: number;
}

export interface HashmapE_hme_root<X> {
readonly kind: 'HashmapE_hme_root';
readonly n: number;
readonly root: Hashmap<X>;
}

// a$_ x:(HashmapE 8 uint16) = HashmapEUser;

export interface HashmapEUser {
Expand Down Expand Up @@ -2200,52 +2183,6 @@ export function storeHmLabel(hmLabel: HmLabel): (builder: Builder) => void {
throw new Error('Expected one of "HmLabel_hml_short", "HmLabel_hml_long", "HmLabel_hml_same" in loading "HmLabel", but data does not satisfy any constructor');
}

// hme_empty$0 {n:#} {X:Type} = HashmapE n X;

// hme_root$1 {n:#} {X:Type} root:^(Hashmap n X) = HashmapE n X;

export function loadHashmapE<X>(slice: Slice, n: number, loadX: (slice: Slice) => X): HashmapE<X> {
if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b0))) {
slice.loadUint(1);
return {
kind: 'HashmapE_hme_empty',
n: n,
}

}
if (((slice.remainingBits >= 1) && (slice.preloadUint(1) == 0b1))) {
slice.loadUint(1);
let slice1 = slice.loadRef().beginParse();
let root: Hashmap<X> = loadHashmap<X>(slice1, n, loadX);
return {
kind: 'HashmapE_hme_root',
n: n,
root: root,
}

}
throw new Error('Expected one of "HashmapE_hme_empty", "HashmapE_hme_root" in loading "HashmapE", but data does not satisfy any constructor');
}

export function storeHashmapE<X>(hashmapE: HashmapE<X>, storeX: (x: X) => (builder: Builder) => void): (builder: Builder) => void {
if ((hashmapE.kind == 'HashmapE_hme_empty')) {
return ((builder: Builder) => {
builder.storeUint(0b0, 1);
})

}
if ((hashmapE.kind == 'HashmapE_hme_root')) {
return ((builder: Builder) => {
builder.storeUint(0b1, 1);
let cell1 = beginCell();
storeHashmap<X>(hashmapE.root, storeX)(cell1);
builder.storeRef(cell1);
})

}
throw new Error('Expected one of "HashmapE_hme_empty", "HashmapE_hme_root" in loading "HashmapE", but data does not satisfy any constructor');
}

// a$_ x:(HashmapE 8 uint16) = HashmapEUser;

export function loadHashmapEUser(slice: Slice): HashmapEUser {
Expand Down

0 comments on commit 6d29960

Please sign in to comment.