Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nomicfoundation/ethereumjs-statemanager

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nomicfoundation/ethereumjs-statemanager - npm Package Compare versions

Comparing version 1.0.0-rc.1 to 1.0.0-rc.2

2

dist/baseStateManager.d.ts

@@ -6,3 +6,2 @@ /// <reference types="node" />

import type { Account, Address } from '@nomicfoundation/ethereumjs-util';
import type { Debugger } from 'debug';
/**

@@ -21,3 +20,2 @@ * Abstract BaseStateManager class for the non-storage-backend

export declare abstract class BaseStateManager {
_debug: Debugger;
_cache: Cache;

@@ -24,0 +22,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseStateManager = void 0;
const debug_1 = require("debug");
/**

@@ -35,3 +34,2 @@ * Abstract BaseStateManager class for the non-storage-backend

}
this._debug = (0, debug_1.debug)('statemanager:statemanager');
}

@@ -52,5 +50,2 @@ /**

async putAccount(address, account) {
if (this.DEBUG) {
this._debug(`Save account address=${address} nonce=${account.nonce} balance=${account.balance} contract=${account.isContract() ? 'yes' : 'no'} empty=${account.isEmpty() ? 'yes' : 'no'}`);
}
this._cache.put(address, account);

@@ -78,5 +73,2 @@ }

async deleteAccount(address) {
if (this.DEBUG) {
this._debug(`Delete account ${address}`);
}
this._cache.del(address);

@@ -83,0 +75,0 @@ }

@@ -82,5 +82,2 @@ "use strict";

await this._trie._db.put(key, value);
if (this.DEBUG) {
this._debug(`Update codeHash (-> ${(0, ethereumjs_util_1.short)(codeHash)}) for account ${address}`);
}
await this.modifyAccountFields(address, { codeHash });

@@ -193,5 +190,2 @@ }

const encodedValue = Buffer.from(ethereumjs_rlp_1.RLP.encode(Uint8Array.from(value)));
if (this.DEBUG) {
this._debug(`Update contract storage for account ${address} to ${(0, ethereumjs_util_1.short)(value)}`);
}
await storageTrie.put(key, encodedValue);

@@ -201,5 +195,2 @@ }

// deleting a value
if (this.DEBUG) {
this._debug(`Delete contract storage for account`);
}
await storageTrie.del(key);

@@ -206,0 +197,0 @@ }

12

package.json
{
"name": "@nomicfoundation/ethereumjs-statemanager",
"version": "1.0.0-rc.1",
"version": "1.0.0-rc.2",
"description": "An Ethereum statemanager implementation",

@@ -43,10 +43,10 @@ "keywords": [

"dependencies": {
"@nomicfoundation/ethereumjs-common": "3.0.0-rc.1",
"@nomicfoundation/ethereumjs-rlp": "4.0.0-rc.1",
"@nomicfoundation/ethereumjs-trie": "5.0.0-rc.1",
"@nomicfoundation/ethereumjs-util": "8.0.0-rc.1",
"@nomicfoundation/ethereumjs-common": "3.0.0-rc.2",
"@nomicfoundation/ethereumjs-rlp": "4.0.0-rc.2",
"@nomicfoundation/ethereumjs-trie": "5.0.0-rc.2",
"@nomicfoundation/ethereumjs-util": "8.0.0-rc.2",
"debug": "^4.3.3",
"ethereum-cryptography": "^1.1.2",
"ethereum-cryptography": "0.1.3",
"functional-red-black-tree": "^1.0.1"
}
}

@@ -1,3 +0,1 @@

import { debug as createDebugLogger } from 'debug'
import type { Cache } from './cache'

@@ -7,3 +5,2 @@ import type { AccountFields } from './interface'

import type { Account, Address } from '@nomicfoundation/ethereumjs-util'
import type { Debugger } from 'debug'

@@ -23,3 +20,2 @@ /**

export abstract class BaseStateManager {
_debug: Debugger
_cache!: Cache

@@ -45,3 +41,2 @@

}
this._debug = createDebugLogger('statemanager:statemanager')
}

@@ -64,9 +59,2 @@

async putAccount(address: Address, account: Account): Promise<void> {
if (this.DEBUG) {
this._debug(
`Save account address=${address} nonce=${account.nonce} balance=${
account.balance
} contract=${account.isContract() ? 'yes' : 'no'} empty=${account.isEmpty() ? 'yes' : 'no'}`
)
}
this._cache.put(address, account)

@@ -96,5 +84,2 @@ }

async deleteAccount(address: Address) {
if (this.DEBUG) {
this._debug(`Delete account ${address}`)
}
this._cache.del(address)

@@ -101,0 +86,0 @@ }

@@ -144,5 +144,2 @@ import { RLP } from '@nomicfoundation/ethereumjs-rlp'

if (this.DEBUG) {
this._debug(`Update codeHash (-> ${short(codeHash)}) for account ${address}`)
}
await this.modifyAccountFields(address, { codeHash })

@@ -271,11 +268,5 @@ }

const encodedValue = Buffer.from(RLP.encode(Uint8Array.from(value)))
if (this.DEBUG) {
this._debug(`Update contract storage for account ${address} to ${short(value)}`)
}
await storageTrie.put(key, encodedValue)
} else {
// deleting a value
if (this.DEBUG) {
this._debug(`Delete contract storage for account`)
}
await storageTrie.del(key)

@@ -282,0 +273,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc