Skip to content

Commit 0cded44

Browse files
committed
CR updates
1 parent 6335bed commit 0cded44

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

agreement/fuzzer/ledger_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ func makeTestLedger(state map[basics.Address]basics.AccountData, sync testLedger
153153
l.certs = make(map[basics.Round]agreement.Certificate)
154154
l.nextRound = 1
155155

156-
// deep copy of state
157156
l.state = make(map[basics.Address]basics.AccountData)
158157
maps.Copy(l.state, state)
159158

ledger/acctupdates_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,12 @@ func (ml *mockLedgerForTracker) fork(t testing.TB) *mockLedgerForTracker {
168168
log: dblogger,
169169
blocks: make([]blockEntry, len(ml.blocks)),
170170
deltas: make([]ledgercore.StateDelta, len(ml.deltas)),
171-
accts: make(map[basics.Address]basics.AccountData),
171+
accts: maps.Clone(ml.accts),
172172
filename: fn,
173173
consensusParams: ml.consensusParams,
174174
consensusVersion: ml.consensusVersion,
175175
trackers: trackerRegistry{log: dblogger},
176176
}
177-
maps.Copy(newLedgerTracker.accts, ml.accts)
178177
copy(newLedgerTracker.blocks, ml.blocks)
179178
copy(newLedgerTracker.deltas, ml.deltas)
180179

network/multiplexer.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ func (m *Multiplexer) ValidateHandle(msg IncomingMessage) OutgoingMessage {
8484

8585
func registerMultiplexer[T any](target *atomic.Value, dispatch []taggedMessageDispatcher[T]) {
8686
mp := make(map[Tag]T)
87-
if existingMap := getMap[T](target); existingMap != nil {
88-
maps.Copy(mp, existingMap)
89-
}
87+
existingMap := getMap[T](target)
88+
maps.Copy(mp, existingMap)
9089
for _, v := range dispatch {
9190
if _, has := mp[v.Tag]; has {
9291
panic(fmt.Sprintf("Already registered a handler for tag %v", v.Tag))

0 commit comments

Comments
 (0)