Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fields.forEach(function(field) {
if (keys.indexOf(field.name) !== -1)
self[field.name] = data[field.name];
if (keys.indexOf(field.alias) !== -1)
self[field.alias] = data[field.alias];
});
} else {
throw new Error("invalid data");
}
}
};
const async = require("async");
let Cache = require("ethereumjs-vm/dist/cache");
Cache.prototype.warm = function(addresses, cb) {
var self = this;
// shim till async supports iterators
var accountArr = [];
addresses.forEach(function(val) {
if (val) accountArr.push(val);
});
async.eachSeries(
accountArr,
function(addressHex, done) {
var address = Buffer.from(addressHex.replace("0x", ""), "hex");
self._lookupAccount(address, function(err, account) {
if (err) return done(err);
self._update(address, account, false, account.exists);
done();
});