Skip to content

Commit

Permalink
fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Manahip committed Jul 29, 2023
1 parent 65dd969 commit 277ad2c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 206 deletions.
4 changes: 2 additions & 2 deletions typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@manahippo/move-to-ts",
"version": "3.0.0",
"version": "3.0.2",
"license": "MIT",
"scripts": {
"build": "rm -rf dist && rollup -c",
Expand Down Expand Up @@ -41,7 +41,7 @@
"typescript": "^4.6.4"
},
"dependencies": {
"aptos": "1.15.0",
"aptos": "1.10.0",
"big-integer": "^1.6.51",
"elliptic": "^6.5.4",
"json-stable-stringify": "^1.0.1",
Expand Down
9 changes: 9 additions & 0 deletions typescript/src/builtinTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import bigInt from "big-integer";
import { isAnyUnsignedInt, isUnsignedInt } from "./typeTest";

export interface IntInterface<T> {
kind: string;
value: bigInt.BigInteger;
make(value: bigInt.BigInteger): T;
}
Expand All @@ -21,10 +22,18 @@ export function takeBigInt(
}

export class UnsignedInt<T extends IntInterface<T>> {
public kind: string;
public value: bigInt.BigInteger;
constructor(value: bigInt.BigInteger | UnsignedInt<any> | string | number) {
this.value = takeBigInt(value);
this.checkBounds();
const subKind = (this as any).kind;
if (subKind) {
this.kind = subKind;
}
else {
this.kind = 'nokind';
}
}

checkBounds() {}
Expand Down
Loading

0 comments on commit 277ad2c

Please sign in to comment.