From 87a863a228ff3a37d9a93d089aece7c93521df5a Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Wed, 10 Jul 2019 16:24:32 +0800 Subject: [PATCH] fix: type error remove file Signed-off-by: MiaoWoo --- src/a.sh => a.sh | 10 +++++++--- package.json | 28 ++++++++++++++++++++++++++++ src/run-node.bat => run-node.bat | 0 src/core/api/api-exchange.ts | 2 +- src/core/library.ts | 22 ++-------------------- src/core/terahashmining.ts | 2 +- src/package.json | 27 --------------------------- tsconfig.json | 2 ++ 8 files changed, 41 insertions(+), 52 deletions(-) rename src/a.sh => a.sh (64%) rename src/run-node.bat => run-node.bat (100%) delete mode 100644 src/package.json diff --git a/src/a.sh b/a.sh similarity index 64% rename from src/a.sh rename to a.sh index 63f6ee1..caa9b50 100755 --- a/src/a.sh +++ b/a.sh @@ -6,8 +6,12 @@ for name in `ls *.${EXT}`; do done : Function; global. +: any + as any BlockNumDB -RelayMode -LoadHistoryMessage -LastLoadedBlockNum \ No newline at end of file +BlockNumDBMin +UseTruncateBlockDB +ContextSendLoadToBegin + + diff --git a/package.json b/package.json index 59d6af3..85fcdd4 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,32 @@ { + "name": "tera", + "version": "1.0.0", + "description": "Tera wallet", + "main": "dist/run-node.js", + "repository": "https://git.yumc.pw/circlecloud/tera.git", + "keywords": [ + "wallet", + "cryptowallet", + "quick", + "messenger", + "cryptocurrency", + "cryptomessenger" + ], + "author": "MiaoWoo", + "license": "MIT", + "scripts": { + "clean": "", + "prebuild": "yarn clean" + }, + "dependencies": { + "bintrees": "^1.0.2", + "greenlock": "^2.6.7", + "ntp-client": "^0.5.3", + "secp256k1": "^3.6.1", + "stun": "^1.1.0", + "uglify-js": "^3.4.9", + "zip": "^1.2.0" + }, "devDependencies": { "@types/node": "^12.6.1", "typescript": "^3.5.3" diff --git a/src/run-node.bat b/run-node.bat similarity index 100% rename from src/run-node.bat rename to run-node.bat diff --git a/src/core/api/api-exchange.ts b/src/core/api/api-exchange.ts index eab54be..1a2adf9 100644 --- a/src/core/api/api-exchange.ts +++ b/src/core/api/api-exchange.ts @@ -23,7 +23,7 @@ global.HTTPCaller.CreateAccount = function(Params, response) { var MaxCountViewRows = global.HTTP_MAX_COUNT_ROWS; global.HTTPCaller.GetBalance = function(Params) { if (typeof Params === "object") { - var arr = global.DApps.Accounts.GetRowsAccounts(ParseNum(Params.AccountID), 1); + var arr = global.DApps.Accounts.GetRowsAccounts(global.ParseNum(Params.AccountID), 1); if (arr.length) { arr[0].result = 1; return arr[0]; diff --git a/src/core/library.ts b/src/core/library.ts index afb97cf..7750ad2 100644 --- a/src/core/library.ts +++ b/src/core/library.ts @@ -14,13 +14,10 @@ import './constant' import './log' let { - ToLog, TO_ERROR_LOG, - SaveToFile, TimeStart, LOAD_CONST, LoadParams, - GetDataPath, CONST_NAME_ARR, SaveParams, SAVE_CONST, @@ -41,26 +38,11 @@ String.prototype.right = function(count) { else return this.substr(0, this.length); }; -if (fs.existsSync("./lib/bintrees")) - global.RBTree = require("../lib/bintrees").RBTree; -else - global.RBTree = require('bintrees').RBTree; -if (fs.existsSync("./lib/ntp-client")) - global.ntpClient = require('../lib/ntp-client'); -else - global.ntpClient = require('ntp-client'); +global.RBTree = require('bintrees').RBTree; +global.ntpClient = require('ntp-client'); global.Stun = require('stun'); global.ZIP = require("zip"); var strOS = os.platform() + "_" + os.arch(); -if (global.NWMODE) - strOS = strOS + "-nw" + global.NWVERSION; -if (fs.existsSync("./lib/secp256k1/" + strOS + "/secp256k1.node")) { - try { - global.secp256k1 = require('../lib/secp256k1/' + strOS + '/secp256k1.node'); - } - catch (e) { - } -} if (!global.secp256k1) { global.secp256k1 = require('secp256k1'); } diff --git a/src/core/terahashmining.ts b/src/core/terahashmining.ts index f6ce5d5..b69978e 100644 --- a/src/core/terahashmining.ts +++ b/src/core/terahashmining.ts @@ -10,7 +10,7 @@ var START_NONCE = 0; const COUNT_FIND_HASH1 = 64; -const DELTA_LONG_MINING = 5000; +var DELTA_LONG_MINING = 5000; var BLOCKNUM_ALGO2 = 6560000; if (global.LOCAL_RUN || global.TEST_NETWORK) { BLOCKNUM_ALGO2 = 0; diff --git a/src/package.json b/src/package.json deleted file mode 100644 index 366eb11..0000000 --- a/src/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "tera", - "version": "1.0.0", - "description": "Tera wallet", - "main": "run-nw.js", - "main2": "run-electron.js", - "repository": "https://git.yumc.pw/circlecloud/tera.git", - "keywords": [ - "wallet", - "cryptowallet", - "quick", - "messenger", - "cryptocurrency", - "cryptomessenger" - ], - "author": "progr76@gmail.com", - "license": "MIT", - "dependencies": { - "bintrees": "^1.0.2", - "greenlock": "^2.6.7", - "ntp-client": "^0.5.3", - "secp256k1": "^3.6.1", - "stun": "^1.1.0", - "uglify-js": "^3.4.9", - "zip": "^1.2.0" - } -} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 43109ed..c7d4d91 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,8 @@ { "compilerOptions": { "outDir": "dist", + "allowJs": true, + "sourceMap": true, "target": "es5" }, "include": [