Skip to content

Commit

Permalink
Small changeState fix
Browse files Browse the repository at this point in the history
Small changeState fix: Removed unwanted `BigInt()`.
  • Loading branch information
nguyenphuminh authored Jan 27, 2024
1 parent b7487e3 commit 0977e30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jechain",
"version": "0.30.0",
"version": "0.30.1",
"description": "Node for JeChain - an experimental smart contract blockchain network",
"main": "./index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/core/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function changeState(newBlock, stateDB, codeDB, enableLogging = false) { /

let gas = 0n;

for (const tx of newBlock.transactions) { gas += BigInt(tx.gas) + BigInt() + BigInt(tx.additionalData.contractGas || 0) }
for (const tx of newBlock.transactions) { gas += BigInt(tx.gas) + BigInt(tx.additionalData.contractGas || 0) }

if (!existedAddresses.includes(newBlock.coinbase)) {
await stateDB.put(newBlock.coinbase, Buffer.from(serializeState({ balance: (BigInt(BLOCK_REWARD) + gas).toString(), codeHash: EMPTY_HASH, nonce: 0, storageRoot: EMPTY_HASH })));
Expand Down

0 comments on commit 0977e30

Please sign in to comment.