-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from Chia-Mine/v0.0.14
V0.0.14
- Loading branch information
Showing
42 changed files
with
2,566 additions
and
2,521 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import { None, Optional } from "./__python_types__"; | ||
import { Bytes, Tuple } from "./__type_compatibility__"; | ||
export declare type CLVMType = { | ||
atom: Optional<Bytes>; | ||
pair: Optional<Tuple<any, any>>; | ||
}; | ||
export declare type Atom = { | ||
atom: Bytes; | ||
pair: None; | ||
}; | ||
export declare type Cons = { | ||
atom: None; | ||
pair: Tuple<any, any>; | ||
}; | ||
export declare class CLVMObject implements CLVMType { | ||
atom: Optional<Bytes>; | ||
pair: Optional<Tuple<any, any>>; | ||
constructor(v: any); | ||
} | ||
export declare function isAtom(obj: CLVMType): obj is Atom; | ||
export declare function isCons(obj: CLVMType): obj is Cons; | ||
import { None, Optional } from "./__python_types__"; | ||
import { Bytes, Tuple } from "./__type_compatibility__"; | ||
export declare type CLVMType = { | ||
atom: Optional<Bytes>; | ||
pair: Optional<Tuple<any, any>>; | ||
}; | ||
export declare type Atom = { | ||
atom: Bytes; | ||
pair: None; | ||
}; | ||
export declare type Cons = { | ||
atom: None; | ||
pair: Tuple<any, any>; | ||
}; | ||
export declare class CLVMObject implements CLVMType { | ||
atom: Optional<Bytes>; | ||
pair: Optional<Tuple<any, any>>; | ||
constructor(v: any); | ||
} | ||
export declare function isAtom(obj: CLVMType): obj is Atom; | ||
export declare function isCons(obj: CLVMType): obj is Cons; |
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 |
---|---|---|
@@ -1,44 +1,44 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isCons = exports.isAtom = exports.CLVMObject = void 0; | ||
const __python_types__1 = require("./__python_types__"); | ||
const __type_compatibility__1 = require("./__type_compatibility__"); | ||
const EvalError_1 = require("./EvalError"); | ||
/* | ||
This class implements the CLVM Object protocol in the simplest possible way, | ||
by just having an "atom" and a "pair" field | ||
*/ | ||
class CLVMObject { | ||
constructor(v) { | ||
this.atom = __python_types__1.None; | ||
// this is always a 2-tuple of an object implementing the CLVM object protocol. | ||
this.pair = __python_types__1.None; | ||
if (v instanceof CLVMObject) { | ||
this.atom = v.atom; | ||
this.pair = v.pair; | ||
} | ||
else if (v instanceof __type_compatibility__1.Tuple) { | ||
this.pair = v; | ||
this.atom = __python_types__1.None; | ||
} | ||
else { | ||
this.atom = v; | ||
this.pair = __python_types__1.None; | ||
} | ||
} | ||
} | ||
exports.CLVMObject = CLVMObject; | ||
function isAtom(obj) { | ||
if ((obj.atom && obj.pair) || (!obj.atom && !obj.pair)) { | ||
throw new EvalError_1.EvalError("Invalid clvm", obj); | ||
} | ||
return Boolean(obj.atom && !obj.pair); | ||
} | ||
exports.isAtom = isAtom; | ||
function isCons(obj) { | ||
if ((obj.atom && obj.pair) || (!obj.atom && !obj.pair)) { | ||
throw new EvalError_1.EvalError("Invalid clvm", obj); | ||
} | ||
return Boolean((!obj.atom && obj.pair)); | ||
} | ||
exports.isCons = isCons; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isCons = exports.isAtom = exports.CLVMObject = void 0; | ||
const __python_types__1 = require("./__python_types__"); | ||
const __type_compatibility__1 = require("./__type_compatibility__"); | ||
const EvalError_1 = require("./EvalError"); | ||
/* | ||
This class implements the CLVM Object protocol in the simplest possible way, | ||
by just having an "atom" and a "pair" field | ||
*/ | ||
class CLVMObject { | ||
constructor(v) { | ||
this.atom = __python_types__1.None; | ||
// this is always a 2-tuple of an object implementing the CLVM object protocol. | ||
this.pair = __python_types__1.None; | ||
if (v instanceof CLVMObject) { | ||
this.atom = v.atom; | ||
this.pair = v.pair; | ||
} | ||
else if (v instanceof __type_compatibility__1.Tuple) { | ||
this.pair = v; | ||
this.atom = __python_types__1.None; | ||
} | ||
else { | ||
this.atom = v; | ||
this.pair = __python_types__1.None; | ||
} | ||
} | ||
} | ||
exports.CLVMObject = CLVMObject; | ||
function isAtom(obj) { | ||
if ((obj.atom && obj.pair) || (!obj.atom && !obj.pair)) { | ||
throw new EvalError_1.EvalError("Invalid clvm", obj); | ||
} | ||
return Boolean(obj.atom && !obj.pair); | ||
} | ||
exports.isAtom = isAtom; | ||
function isCons(obj) { | ||
if ((obj.atom && obj.pair) || (!obj.atom && !obj.pair)) { | ||
throw new EvalError_1.EvalError("Invalid clvm", obj); | ||
} | ||
return Boolean((!obj.atom && obj.pair)); | ||
} | ||
exports.isCons = isCons; |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import type { str } from "./__python_types__"; | ||
import type { CLVMObject } from "./CLVMObject"; | ||
export declare class EvalError extends Error { | ||
_sexp?: CLVMObject; | ||
name: string; | ||
constructor(message: str, sexp: CLVMObject); | ||
} | ||
import type { str } from "./__python_types__"; | ||
import type { CLVMObject } from "./CLVMObject"; | ||
export declare class EvalError extends Error { | ||
_sexp?: CLVMObject; | ||
name: string; | ||
constructor(message: str, sexp: CLVMObject); | ||
} |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EvalError = void 0; | ||
class EvalError extends Error { | ||
constructor(message, sexp) { | ||
super(message); | ||
this.name = "EvalError"; | ||
this._sexp = sexp; | ||
} | ||
} | ||
exports.EvalError = EvalError; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EvalError = void 0; | ||
class EvalError extends Error { | ||
constructor(message, sexp) { | ||
super(message); | ||
this.name = "EvalError"; | ||
this._sexp = sexp; | ||
} | ||
} | ||
exports.EvalError = EvalError; |
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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
import { G1Element } from "@chiamine/bls-signatures"; | ||
import { int, None, str } from "./__python_types__"; | ||
import { CLVMObject } from "./CLVMObject"; | ||
import { Bytes, Tuple } from "./__type_compatibility__"; | ||
export declare type CastableType = SExp | CLVMObject | Bytes | str | int | None | G1Element | CastableType[] | Tuple<CastableType, CastableType>; | ||
export declare function looks_like_clvm_object(o: any): o is CLVMObject; | ||
export declare function convert_atom_to_bytes(v: any): Bytes; | ||
export declare function to_sexp_type(value: CastableType): CLVMObject; | ||
export declare class SExp extends CLVMObject { | ||
static readonly TRUE: SExp; | ||
static readonly FALSE: SExp; | ||
static readonly __NULL__: SExp; | ||
static to(v: CastableType): SExp; | ||
static null(): SExp; | ||
constructor(v: CLVMObject); | ||
as_pair(): Tuple<SExp, SExp> | None; | ||
listp(): boolean; | ||
nullp(): boolean; | ||
as_int(): number; | ||
as_bin(): Bytes; | ||
cons(right: any): SExp; | ||
first(): SExp; | ||
rest(): SExp; | ||
as_iter(): Generator<SExp, void, unknown>; | ||
equal_to(other: CastableType): boolean; | ||
list_len(): number; | ||
as_javascript(): import("./as_javascript").TToJavascript; | ||
toString(): string; | ||
__repr__(): string; | ||
} | ||
import { G1Element } from "@chiamine/bls-signatures"; | ||
import { int, None, str } from "./__python_types__"; | ||
import { CLVMObject } from "./CLVMObject"; | ||
import { Bytes, Tuple } from "./__type_compatibility__"; | ||
export declare type CastableType = SExp | CLVMObject | Bytes | str | int | None | G1Element | CastableType[] | Tuple<CastableType, CastableType>; | ||
export declare function looks_like_clvm_object(o: any): o is CLVMObject; | ||
export declare function convert_atom_to_bytes(v: any): Bytes; | ||
export declare function to_sexp_type(value: CastableType): CLVMObject; | ||
export declare class SExp extends CLVMObject { | ||
static readonly TRUE: SExp; | ||
static readonly FALSE: SExp; | ||
static readonly __NULL__: SExp; | ||
static to(v: CastableType): SExp; | ||
static null(): SExp; | ||
constructor(v: CLVMObject); | ||
as_pair(): Tuple<SExp, SExp> | None; | ||
listp(): boolean; | ||
nullp(): boolean; | ||
as_int(): number; | ||
as_bin(): Bytes; | ||
cons(right: any): SExp; | ||
first(): SExp; | ||
rest(): SExp; | ||
as_iter(): Generator<SExp, void, unknown>; | ||
equal_to(other: CastableType): boolean; | ||
list_len(): number; | ||
as_javascript(): import("./as_javascript").TToJavascript; | ||
toString(): string; | ||
__repr__(): string; | ||
} |
Oops, something went wrong.