Skip to content

Commit 2b1c046

Browse files
committed
feat: deprecate the mbedtls
1 parent 6b12060 commit 2b1c046

4 files changed

Lines changed: 4 additions & 40 deletions

File tree

lib/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
var Web3 = require('./web3');
2-
if (typeof process === 'object' && process.versions.fibjs)
3-
require('./patch_hash');
42

53
var numeric = require('./patch_numeric');
64
var Api = require('./patch_api');
@@ -54,7 +52,6 @@ TPOS.ecc = require('eosjs/dist/eosjs-ecc-migration').ecc;
5452
if (typeof process === 'object' && process.versions.fibjs) {
5553
fetch = require('http').promises.get;
5654
require('./patch_sync')(TPOS);
57-
require('./patch_ec');
5855
}
5956

6057
module.exports = TPOS;

lib/patch_hash.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

lib/web3.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
1-
var crypto = require('crypto');
2-
var base64 = require('base64');
31
var util = require('util');
42

5-
var secp256k1 = require("secp256k1");
6-
secp256k1.ecdsaSign = function ecdsaSign(msg32, seckey) {
7-
var sk = crypto.ECKey.from({
8-
"kty": "EC",
9-
"crv": "secp256k1",
10-
"d": base64.encode(seckey)
11-
});
12-
13-
var sig = sk.sign(msg32, {
14-
recoverable: true
15-
});
16-
17-
var res = {
18-
signature: sig.slice(0, 64),
19-
recid: sig[64]
20-
};
21-
22-
return res;
23-
}
24-
25-
secp256k1.ecdsaRecover = function ecdsaRecover(sig, recid, msg32) {
26-
var pk = crypto.ECKey.recover(msg32, Buffer.concat([sig, Buffer.from([recid])]));
27-
var res = Uint8Array.from(base64.decode(pk.json({ compress: true }).x));
28-
29-
return res;
30-
};
31-
323
function wrap_async_func(mod, cb = false) {
334
for (var k in mod) {
345
var m = mod[k];

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tpblock/client",
3-
"version": "0.23.14",
3+
"version": "0.24.1",
44
"description": "General purpose library for TPOS blockchain",
55
"main": "./lib/index.js",
66
"browser": "./lib/node.js",
@@ -20,7 +20,9 @@
2020
},
2121
"dependencies": {
2222
"eosjs": "22.1",
23-
"web3": "1.8.1"
23+
"web3": "1.8.1",
24+
"web3-core": "^1.8.1",
25+
"web3-eth-abi": "^1.8.1"
2426
},
2527
"directories": {
2628
"lib": "lib",

0 commit comments

Comments
 (0)