Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #16 from LiskHQ/0.9.10-multisig_dapp_simultaneously
Browse files Browse the repository at this point in the history
Bug resolution for multisignature transaction
  • Loading branch information
Isabella Dell authored Sep 29, 2017
2 parents 1ffd2ae + 72c51c6 commit 053d43c
Show file tree
Hide file tree
Showing 6 changed files with 1,082 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ lock(resource: "Lisk-Core-Nodes", inversePrecedence: true) {
'''
}
},
"Functional Multisignatures - 2" : {
node('node-01'){
sh '''
export TEST=test/api/multisignature.with.other.transactions.js TEST_TYPE='FUNC'
cd "$(echo $WORKSPACE | cut -f 1 -d '@')"
npm run jenkins
'''
}
},
"Functional Signatures" : {
node('node-01'){
sh '''
Expand Down
8 changes: 8 additions & 0 deletions logic/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var ByteBuffer = require('bytebuffer');
var BlockReward = require('../logic/blockReward.js');
var constants = require('../helpers/constants.js');

var transactionTypes = require('../helpers/transactionTypes.js');

// Private fields
var __private = {};

Expand Down Expand Up @@ -75,8 +77,14 @@ __private.getAddressByPublicKey = function (publicKey) {
*/
Block.prototype.create = function (data) {
var transactions = data.transactions.sort(function compare (a, b) {
// Place MULTI transaction after all other transaction types
if (a.type === transactionTypes.MULTI && b.type !== transactionTypes.MULTI) { return 1; }
// Place all other transaction types before MULTI transaction
if (a.type !== transactionTypes.MULTI && b.type === transactionTypes.MULTI) { return -1; }
// Place depending on type (lower first)
if (a.type < b.type) { return -1; }
if (a.type > b.type) { return 1; }
// Place depending on amount (lower first)
if (a.amount < b.amount) { return -1; }
if (a.amount > b.amount) { return 1; }
return 0;
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"z-schema": "=3.18.2"
},
"devDependencies": {
"rewire": "=2.5.2",
"bitcore-mnemonic": "=1.1.1",
"browserify-bignum": "=1.3.0-2",
"chai": "=3.5.0",
Expand Down
Loading

0 comments on commit 053d43c

Please sign in to comment.