Skip to content

Commit

Permalink
Consensus 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JFixby committed Nov 7, 2019
1 parent 848cd9c commit 874b065
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 40 deletions.
26 changes: 13 additions & 13 deletions blockchain/estimatesubsidy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ func TestEstimateSupplyPicFightCoin(t *testing.T) {
expectedValues := map[int64]int64{
0: 0,
1: calc.PreminedCoins().AtomsValue,
2: 400000172962501,
4: 400000518887391,
40: 400006745509838,
400: 400069009068787,
4000: 400691378106416,
40000: 406888413296876,
400000: 466193246619086,
1200000: 580630465698828,
2400000: 707412244109675,
3600000: 780345162270002,
4000000: 792689721601108,
4625285: 799999997687360,
calc.NumberOfGeneratingBlocks() + 5: 799999997687360,
2: 2035109104832,
4: 2035127314475,
40: 2035455083102,
400: 2038732254894,
4000: 2071452524241,
40000: 2393510359606,
400000: 5099602903191,
1200000: 7764076009766,
2400000: 7777699369282,
3600000: 7777699369282,
4000000: 7777699369282,
4625285: 7777699369282,
calc.NumberOfGeneratingBlocks() + 5: 7777699369282,
}

for height, expected := range expectedValues {
Expand Down
2 changes: 1 addition & 1 deletion blockchain/subsidy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestPicfightCoinBlockSubsidy(t *testing.T) {
net := &chaincfg.PicFightCoinNetParams
calc := net.SubsidyCalculator()
expectedTotal := calc.ExpectedTotalNetworkSubsidy()
expectedActual := coin.Amount{799999997687360}
expectedActual := coin.Amount{7777699369282}
expectedTotal = expectedActual
genBlocksNum := calc.NumberOfGeneratingBlocks()
preminedCoins := calc.PreminedCoins()
Expand Down
2 changes: 1 addition & 1 deletion chaincfg/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// TestPicfightGenesisBlock tests the genesis block of the main network for validity by
// checking the encoded bytes and hashes.
func TestPicfightGenesisBlock(t *testing.T) {
genesisHexString := "0100000000000000000000000000000000000000000000000000000000000000000000000dc101dfc3c6a2eb10ca0c5374e10d28feb53f7eabcc850511ceadb99174aa66000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffff001f00c2eb0b000000000000000000000000c13c935d000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff010000000000000000000020801679e98561ada96caec2949a5d41c4cab3851eb740d951c10ecbcf265c1fd9000000000000000001ffffffffffffffff00000000ffffffff02000000"
genesisHexString := "0100000000000000000000000000000000000000000000000000000000000000000000000dc101dfc3c6a2eb10ca0c5374e10d28feb53f7eabcc850511ceadb99174aa66000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffff001f00c2eb0b000000000000000000000000e820c45d000000000000000000000000000000000000000000000000000000000000000000000000000000000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff010000000000000000000020801679e98561ada96caec2949a5d41c4cab3851eb740d951c10ecbcf265c1fd9000000000000000001ffffffffffffffff00000000ffffffff02000000"
genesisBlockBytes, _ := hex.DecodeString(genesisHexString)

// Encode the genesis block to raw bytes.
Expand Down
4 changes: 2 additions & 2 deletions chaincfg/pfcnetparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ var PicFightCoinNetParams = Params{
SLIP0044CoinType: 42, // SLIP0044, Decred
LegacyCoinType: 20, // for backwards compatibility

// Decred PoS parameters
MinimumStakeDiff: 2 * 1e8, // 2 Coin
// PoS parameters
MinimumStakeDiff: picfightcoin.MinStakeDifficulty(),
TicketPoolSize: 8192,
TicketsPerBlock: picfightcoin.PicFightCoinSubsidy().TicketsPerBlock(),
TicketMaturity: 256,
Expand Down
6 changes: 3 additions & 3 deletions chaincfg/premine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func TestLockPremine(t *testing.T) {
{ // LOCK PROJECT SUBSIDY
projectPremine := picfightcoin.Premine()["JsKFRL5ivSH7CnYaTtaBT4M9fZG878g49Fg"]
expected := coin.FromFloat(4000000 - 6000)
expected := coin.FromFloat(20291)
if projectPremine.AtomsValue != expected.AtomsValue {
t.Errorf("Premine mismatch: got %v expected %v ",
projectPremine,
Expand All @@ -21,7 +21,7 @@ func TestLockPremine(t *testing.T) {
}
{ // LOCK PROJECT POS SUBSIDY
projectPosPremine := picfightcoin.Premine()["JsRjbYZ448FxZQ5kQAc15NcwUQ1oqYydVEG"]
expected := coin.FromFloat(6000)
expected := coin.FromFloat(60)
if projectPosPremine.AtomsValue != expected.AtomsValue {
t.Errorf("Premine mismatch: got %v expected %v ",
projectPosPremine,
Expand Down Expand Up @@ -51,7 +51,7 @@ func TestPremine(t *testing.T) {
)
t.Fail()
}
expected = coin.FromFloat(4000000).AtomsValue
expected = coin.FromFloat(20351).AtomsValue
if totalAtoms != expected {
t.Errorf("Premine mismatch: got %v expected %v ",
totalAtoms,
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ require (
github.com/jfixby/pin v0.0.0-20190926185208-4828e1e664f4
github.com/jrick/bitset v1.0.0
github.com/jrick/logrotate v1.0.0
github.com/picfight/picfightcoin v0.0.0-20191002184602-b5e70e4070ea
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad
github.com/picfight/picfightcoin v0.0.0-20191107151210-0ab5c80ba5bc
golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4
)
22 changes: 4 additions & 18 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,11 @@ github.com/jrick/bitset v1.0.0/go.mod h1:ZOYB5Uvkla7wIEY4FEssPVi3IQXa02arznRaYaA
github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/picfight/picfightcoin v0.0.0-20190930150635-03da47866cbd h1:GVdVk8msxZ5RKxcEOBii9Vy/fj1Mlsr4LYJ4giEF7Ik=
github.com/picfight/picfightcoin v0.0.0-20190930150635-03da47866cbd/go.mod h1:ha+rYP3z5+4VMMFtxAen2S0YKzVQeR5+B/gLkwAjx18=
github.com/picfight/picfightcoin v0.0.0-20190930184150-707a9cdf5bf8 h1:7BpJahM9PU0iGbAqRjzoOvdYAamF5hJWstD7nHrhnOQ=
github.com/picfight/picfightcoin v0.0.0-20190930184150-707a9cdf5bf8/go.mod h1:ha+rYP3z5+4VMMFtxAen2S0YKzVQeR5+B/gLkwAjx18=
github.com/picfight/picfightcoin v0.0.0-20190930210555-0c9b14074eac h1:2xODeCNcLFr0axG+EGMVNWMMlPOM54FAizVYNAWeRT8=
github.com/picfight/picfightcoin v0.0.0-20190930210555-0c9b14074eac/go.mod h1:ha+rYP3z5+4VMMFtxAen2S0YKzVQeR5+B/gLkwAjx18=
github.com/picfight/picfightcoin v0.0.0-20191001114557-5face52e5bde h1:GXO8kJfntYJNO7pKlmA6/NzGJgQ/K1eK7bs2jzdGW7g=
github.com/picfight/picfightcoin v0.0.0-20191001114557-5face52e5bde/go.mod h1:ha+rYP3z5+4VMMFtxAen2S0YKzVQeR5+B/gLkwAjx18=
github.com/picfight/picfightcoin v0.0.0-20191001115746-c680a917d1fe h1:q+o3HxSv/u67nKRb5Q1b/egqxJgY9Ck0nZp00AJvzmg=
github.com/picfight/picfightcoin v0.0.0-20191001115746-c680a917d1fe/go.mod h1:ha+rYP3z5+4VMMFtxAen2S0YKzVQeR5+B/gLkwAjx18=
github.com/picfight/picfightcoin v0.0.0-20191001123624-84c8bd500392 h1:VRLJNVZVXZdcK/gzwADaYxQG13JCGvwUZEjJ7k1RQns=
github.com/picfight/picfightcoin v0.0.0-20191001123624-84c8bd500392/go.mod h1:ha+rYP3z5+4VMMFtxAen2S0YKzVQeR5+B/gLkwAjx18=
github.com/picfight/picfightcoin v0.0.0-20191002123151-f8c564eeaeaa h1:jfluI547/yk4sa5DaRY3wL2lxHyFeGz8rIUE4qQHuZQ=
github.com/picfight/picfightcoin v0.0.0-20191002123151-f8c564eeaeaa/go.mod h1:ha+rYP3z5+4VMMFtxAen2S0YKzVQeR5+B/gLkwAjx18=
github.com/picfight/picfightcoin v0.0.0-20191002184602-b5e70e4070ea h1:rPCedxD0FT6mjcEPwvrAzP3LBbKNJaNJMWcmubDvXkg=
github.com/picfight/picfightcoin v0.0.0-20191002184602-b5e70e4070ea/go.mod h1:ha+rYP3z5+4VMMFtxAen2S0YKzVQeR5+B/gLkwAjx18=
github.com/picfight/picfightcoin v0.0.0-20191107151210-0ab5c80ba5bc h1:40Fh7v29VEayd3PmWBQqqiDB0r2oXHjC3DpNkeIr49U=
github.com/picfight/picfightcoin v0.0.0-20191107151210-0ab5c80ba5bc/go.mod h1:ha+rYP3z5+4VMMFtxAen2S0YKzVQeR5+B/gLkwAjx18=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad h1:5E5raQxcv+6CZ11RrBYQe5WRbUIWpScjh0kvHZkZIrQ=
golang.org/x/crypto v0.0.0-20190927123631-a832865fa7ad/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4 h1:PDpCLFAH/YIX0QpHPf2eO7L4rC2OOirBrKtXTLLiNTY=
golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down

0 comments on commit 874b065

Please sign in to comment.