Skip to content

Commit

Permalink
Refactor Faucet (iotaledger#1152)
Browse files Browse the repository at this point in the history
* Refactor Faucet plugin

 - added state manager
 - refactored init flow
 - remainder funds are kept on 0 index faucet address
 - adjust faucet integration tests
 - faucet to pledge consensus mana to emptyNodeID when preparing outputs

* Fix value integration test

* Fix mana and faucet tests

* Fix linter warnings

* Fix merge issue

* Fix mana integration tests

Co-authored-by: capossele <[email protected]>
  • Loading branch information
lzpap and capossele authored Mar 29, 2021
1 parent 48f8f0a commit d1d929c
Show file tree
Hide file tree
Showing 14 changed files with 748 additions and 492 deletions.
7 changes: 0 additions & 7 deletions packages/mana/consensusbasevector.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func (c *ConsensusBaseManaVector) Has(nodeID identity.ID) bool {
// BuildPastBaseVector builds a consensus base mana vector from past events upto time `t`.
// `eventLogs` is expected to be sorted chronologically.
func (c *ConsensusBaseManaVector) BuildPastBaseVector(eventsLog []Event, t time.Time) error {
emptyID := identity.ID{}
if c.vector == nil {
c.vector = make(map[identity.ID]*ConsensusBaseMana)
}
Expand All @@ -52,9 +51,6 @@ func (c *ConsensusBaseManaVector) BuildPastBaseVector(eventsLog []Event, t time.
if ev.Time.After(t) {
return nil
}
if ev.NodeID == emptyID {
continue
}
if _, exist := c.vector[ev.NodeID]; !exist {
c.vector[ev.NodeID] = &ConsensusBaseMana{}
}
Expand All @@ -64,9 +60,6 @@ func (c *ConsensusBaseManaVector) BuildPastBaseVector(eventsLog []Event, t time.
if ev.Time.After(t) {
return nil
}
if ev.NodeID == emptyID {
continue
}
if _, exist := c.vector[ev.NodeID]; !exist {
c.vector[ev.NodeID] = &ConsensusBaseMana{}
}
Expand Down
367 changes: 0 additions & 367 deletions plugins/faucet/component.go

This file was deleted.

Loading

0 comments on commit d1d929c

Please sign in to comment.