Skip to content

Commit

Permalink
Merge pull request #113 from hive-engine/unfreeze_revertComments
Browse files Browse the repository at this point in the history
Force revert problematic comments contract
  • Loading branch information
bt-cryptomancer authored Oct 27, 2021
2 parents 990dee7 + 6055acc commit d37cefe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions contracts/revert/comments_minify_20211027.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions libs/Block.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const { CONSTANTS } = require('../libs/Constants');

const { SmartContracts } = require('./SmartContracts');
const { Transaction } = require('../libs/Transaction');
const { setupContractPayload } = require('../libs/util/contractUtil');

const revertCommentsContractPayload = setupContractPayload('comments', './contracts/revert/comments_minify_20211027.js');

class Block {
constructor(timestamp, refHiveBlockNumber, refHiveBlockId, prevRefHiveBlockId, transactions, previousBlockNumber, previousHash = '', previousDatabaseHash = '') {
Expand Down Expand Up @@ -93,6 +96,11 @@ class Block {
const tokenBalances = database.database.collection('tokens_balances');
await tokenBalances.updateOne({ _id: 21725 }, { $set: { account: 'nightowl1', balance: '500000.00000000' } });
}

// Comments contract causing issues and needs to be reverted. put at beginning
if (this.refHiveBlockNumber === 58637536) {
this.transactions.unshift(new Transaction(this.blockNumber, 'FIXTX_COMMENTS_REVERT', CONSTANTS.HIVE_ENGINE_ACCOUNT, 'contract', 'update', JSON.stringify(revertCommentsContractPayload)));
}
}

// produce the block (deploy a smart contract or execute a smart contract)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "steemsmartcontracts",
"version": "1.5.2",
"version": "1.6",
"description": "",
"main": "app.js",
"scripts": {
Expand Down

0 comments on commit d37cefe

Please sign in to comment.