jcwallet/patches/web3-eth-accounts+1.7.4.patch
2022-07-07 13:01:41 +08:00

24 lines
876 B
Diff

diff --git a/node_modules/web3-eth-accounts/lib/index.js b/node_modules/web3-eth-accounts/lib/index.js
index a176dd9..27064fc 100644
--- a/node_modules/web3-eth-accounts/lib/index.js
+++ b/node_modules/web3-eth-accounts/lib/index.js
@@ -23,7 +23,7 @@
var core = require('web3-core');
var Method = require('web3-core-method');
var Account = require('eth-lib/lib/account');
-var cryp = (typeof global === 'undefined') ? require('crypto-browserify') : require('crypto');
+var cryp = require('crypto-browserify');
var scrypt = require('scrypt-js');
var uuid = require('uuid');
var utils = require('web3-utils');
@@ -621,6 +621,9 @@ if (!storageAvailable('localStorage')) {
*/
function storageAvailable(type) {
var storage;
+ if (typeof cc !== undefined) {
+ return true
+ }
try {
storage = self[type];
var x = '__storage_test__';