()
| 113 | } |
| 114 | |
| 115 | func (m *ElectionsModule) load() { |
| 116 | m.plug.ReadIntoStruct(`elections-state`, &m.state) |
| 117 | if m.state.Winners == nil { |
| 118 | m.state.Winners = make(map[string]Winner) |
| 119 | } |
| 120 | if m.state.Coffers == nil { |
| 121 | m.state.Coffers = make(map[string]int) |
| 122 | } |
| 123 | if m.state.TaxRates == nil { |
| 124 | m.state.TaxRates = make(map[string]int) |
| 125 | } |
| 126 | if m.state.ActiveElection != nil && m.state.ActiveElection.Votes == nil { |
| 127 | m.state.ActiveElection.Votes = make(map[int]int) |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | func (m *ElectionsModule) save() { |
| 132 | m.plug.WriteStruct(`elections-state`, m.state) |
nothing calls this directly
no test coverage detected