Permalink
Browse files

GovTx based validator set changes implemented and tested

Signed-off-by: Silas Davis <silas@monax.io>
  • Loading branch information...
silasdavis committed Jul 22, 2018
1 parent 467548d commit eb0c993d24867089a7cd6a682afb5f38f9e96d16
Showing with 3,711 additions and 1,740 deletions.
  1. +2 −1 Gopkg.lock
  2. +118 −0 acm/balance/balance.go
  3. +337 −0 acm/balance/balance.pb.go
  4. +22 −0 acm/balance/balance_test.go
  5. +51 −0 acm/balance/type.go
  6. +0 −92 acm/validator.go
  7. +265 −0 acm/validator/ring.go
  8. +15 −11 blockchain/validators_ring_test.go → acm/validator/ring_test.go
  9. +57 −69 blockchain/validators.go → acm/validator/set.go
  10. +4 −4 blockchain/validators_test.go → acm/validator/set_test.go
  11. +27 −0 acm/validator/validator.go
  12. +405 −0 acm/validator/validator.pb.go
  13. +111 −0 acm/validator/validators.go
  14. +0 −1 acm/validator_test.go
  15. +108 −87 {blockchain → bcm}/blockchain.go
  16. +15 −8 {blockchain → bcm}/blockchain_test.go
  17. +0 −198 blockchain/validators_ring.go
  18. +2 −2 cmd/burrow/commands/configure.go
  19. +1 −1 cmd/burrow/commands/helpers.go
  20. +1 −0 cmd/burrow/commands/tx.go
  21. +5 −7 config/config.go
  22. +52 −38 consensus/tendermint/abci/app.go
  23. +5 −2 consensus/tendermint/config.go
  24. +5 −7 consensus/tendermint/{query → }/node_view.go
  25. +1 −1 consensus/tendermint/{validator → }/priv_validator_memory.go
  26. +1 −1 consensus/tendermint/{validator → }/sign_info.go
  27. +1 −7 consensus/tendermint/tendermint.go
  28. +1 −1 consensus/tendermint/{validator → }/wire.go
  29. +49 −49 core/kernel.go
  30. +12 −0 crypto/public_key.go
  31. +3 −3 execution/contexts/call_context.go
  32. +17 −19 execution/contexts/governance_context.go
  33. +2 −2 execution/contexts/name_context.go
  34. +8 −8 execution/contexts/permissions_context.go
  35. +5 −4 execution/contexts/send_context.go
  36. +36 −27 execution/contexts/shared.go
  37. +9 −2 execution/errors/errors.go
  38. +0 −2 execution/errors/errors_test.go
  39. +3 −2 execution/errors/vm.go
  40. +16 −4 execution/evm/vm.go
  41. +63 −65 execution/exec/exec.pb.go
  42. +35 −20 execution/execution.go
  43. +15 −13 execution/execution_test.go
  44. +4 −4 execution/simulated_call.go
  45. +7 −6 execution/transactor.go
  46. +3 −4 execution/transactor_test.go
  47. +4 −4 genesis/deterministic_genesis.go
  48. +20 −10 genesis/genesis.go
  49. +5 −3 genesis/genesis_test.go
  50. +4 −4 genesis/spec/genesis_spec.go
  51. +3 −2 genesis/spec/genesis_spec_test.go
  52. +9 −11 genesis/spec/presets.go
  53. +6 −5 genesis/spec/presets_test.go
  54. +78 −88 genesis/spec/spec.pb.go
  55. +7 −10 genesis/spec/template_account.go
  56. +38 −0 governance/governance.go
  57. +23 −0 governance/governance_test.go
  58. +36 −29 integration/core/kernel_test.go
  59. +172 −0 integration/governance/governance_test.go
  60. +43 −12 integration/governance/main_test.go
  61. +0 −7 integration/governance/validators_test.go
  62. +35 −36 integration/integration.go
  63. +28 −0 integration/integration_test.go
  64. +3 −1 integration/rpcevents/main_test.go
  65. +3 −1 integration/rpcquery/main_test.go
  66. +3 −1 integration/rpctransact/main_test.go
  67. +1 −1 integration/rpctransact/transact_server_test.go
  68. +3 −1 integration/tm/main_test.go
  69. +0 −51 logging/config/presets/instructions_test.go
  70. +0 −1 logging/config/sort.go
  71. +4 −4 logging/lifecycle/lifecycle.go
  72. +15 −1 logging/{config → logconfig}/config.go
  73. +1 −1 logging/{config → logconfig}/config_test.go
  74. +1 −1 logging/{config → logconfig}/filter.go
  75. +1 −1 logging/{config → logconfig}/filter_test.go
  76. +32 −32 logging/{config → logconfig}/presets/instructions.go
  77. +51 −0 logging/logconfig/presets/instructions_test.go
  78. +8 −5 logging/{config → logconfig}/sinks.go
  79. +1 −1 logging/{config → logconfig}/sinks_test.go
  80. +1 −0 logging/logconfig/sort.go
  81. +2 −1 logging/loggers/burrow_format_logger.go
  82. +13 −0 permission/account_permissions.go
  83. +5 −18 permission/util.go
  84. +4 −6 permission/util_test.go
  85. +1 −6 protobuf/acm.proto
  86. +20 −0 protobuf/balance.proto
  87. +1 −1 protobuf/exec.proto
  88. +7 −5 protobuf/payload.proto
  89. +15 −0 protobuf/rpcquery.proto
  90. +2 −8 protobuf/rpctransact.proto
  91. +9 −16 protobuf/spec.proto
  92. +22 −0 protobuf/validator.proto
  93. +5 −3 rpc/result.go
  94. +3 −3 rpc/rpcevents/execution_events_server.go
  95. +34 −5 rpc/rpcquery/query_server.go
  96. +580 −23 rpc/rpcquery/rpcquery.pb.go
  97. +49 −306 rpc/rpctransact/rpctransact.pb.go
  98. +21 −39 rpc/rpctransact/transact_server.go
  99. +17 −22 rpc/service.go
  100. +2 −2 txs/amino_codec.go
  101. +6 −0 txs/payload/bond_tx.go
  102. +6 −0 txs/payload/call_tx.go
  103. +23 −0 txs/payload/gov_tx.go
  104. +0 −17 txs/payload/governance_tx.go
  105. +6 −0 txs/payload/name_tx.go
  106. +39 −11 txs/payload/payload.go
  107. +251 −140 txs/payload/payload.pb.go
  108. +14 −8 txs/payload/{permission_tx.go → perms_tx.go}
  109. +6 −0 txs/payload/send_tx.go
  110. +6 −0 txs/payload/unbond_tx.go
  111. +1 −1 txs/tx.go
  112. +2 −2 txs/tx_test.go
  113. +1 −1 util/logging/cmd/main.go
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -0,0 +1,118 @@
package balance
import "fmt"
type Balances []Balance
func (b Balance) String() string {
return fmt.Sprintf("{%v: %d}", b.Type, b.Amount)
}
func New() Balances {
return []Balance{}
}
func (bs Balances) Len() int {
return len(bs)
}
func (bs Balances) Less(i, j int) bool {
if bs[i].Type < bs[j].Type {
return true
}
return bs[i].Type == bs[j].Type && bs[i].Amount < bs[j].Amount
}
func (bs Balances) Swap(i, j int) {
bs[i], bs[j] = bs[j], bs[i]
}
func (bs Balances) Add(ty Type, amount uint64) Balances {
return append(bs, Balance{
Type: ty,
Amount: amount,
})
}
func (bs Balances) Native(amount uint64) Balances {
return bs.Add(TypeNative, amount)
}
func (bs Balances) Power(amount uint64) Balances {
return bs.Add(TypePower, amount)
}
func (bs Balances) Sum(bss ...Balances) Balances {
return Sum(append(bss, bs)...)
}
func Sum(bss ...Balances) Balances {
sum := New()
sumMap := make(map[Type]uint64)
for _, bs := range bss {
for _, b := range bs {
sumMap[b.Type] += b.Amount
}
}
for k, v := range sumMap {
sum = sum.Add(k, v)
}
return sum
}
func Native(native uint64) Balance {
return Balance{
Type: TypeNative,
Amount: native,
}
}
func Power(power uint64) Balance {
return Balance{
Type: TypePower,
Amount: power,
}
}
func (bs Balances) Has(ty Type) bool {
for _, b := range bs {
if b.Type == ty {
return true
}
}
return false
}
func (bs Balances) Get(ty Type) *uint64 {
for _, b := range bs {
if b.Type == ty {
return &b.Amount
}
}
return nil
}
func (bs Balances) GetFallback(ty Type, fallback uint64) uint64 {
for _, b := range bs {
if b.Type == ty {
return b.Amount
}
}
return fallback
}
func (bs Balances) GetNative(fallback uint64) uint64 {
return bs.GetFallback(TypeNative, fallback)
}
func (bs Balances) GetPower(fallback uint64) uint64 {
return bs.GetFallback(TypePower, fallback)
}
func (bs Balances) HasNative() bool {
return bs.Has(TypeNative)
}
func (bs Balances) HasPower() bool {
return bs.Has(TypePower)
}
Oops, something went wrong.

0 comments on commit eb0c993

Please sign in to comment.