Skip to content

Commit

Permalink
Merge pull request #1518 from dusk-network/1517-dusk-value-is-wrong
Browse files Browse the repository at this point in the history
Use config.DUSK in sortition

Resolves #1517
  • Loading branch information
fed-franz authored Apr 5, 2023
2 parents d9cc966 + c1409be commit 2db9a3c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/core/consensus/user/sortition.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ import (
"math"
"math/big"

"github.com/dusk-network/dusk-blockchain/pkg/config"
"github.com/dusk-network/dusk-blockchain/pkg/util"
"github.com/dusk-network/dusk-blockchain/pkg/util/nativeutils/sortedset"
"github.com/dusk-network/dusk-crypto/hash"
log "github.com/sirupsen/logrus"
)

// DUSK is one whole unit of DUSK. This is duplicated from wallet since
// otherwise we get into an import cycle including the transactions and users
// packages.
const DUSK = uint64(100000000)

// VotingCommittee represents a set of provisioners with voting rights at a certain
// point in the consensus. The set is sorted by the int value of the public key in
// increasing order (higher last).
Expand Down Expand Up @@ -154,7 +150,7 @@ func (p Provisioners) CreateVotingCommittee(seed []byte, round uint64, step uint

// Deduct up to 1 DUSK from the extracted member's stake.
m := p.GetMember(blsPk)
subtracted := m.SubtractFromStake(1 * DUSK)
subtracted := m.SubtractFromStake(1 * config.DUSK)

// Subtract the deducted amount from the total weight, to ensure consistency.
subtractFromTotalWeight(W, subtracted)
Expand Down

0 comments on commit 2db9a3c

Please sign in to comment.