Closed bap2pecs closed 3 months ago
Indeed, we should consider refactoring if it will never have two keys on the map. b/c it is inconvenient to use, the codes would be like this:
// query pub rand
committedPubRandMap, err := ctm.OpL2ConsumerCtrl.QueryLastCommittedPublicRand(fpInstance.GetBtcPk(), 1)
require.NoError(t, err)
var lastCommittedHeight uint64
for key := range committedPubRandMap {
lastCommittedHeight = key
break
}
Sounds good to me :+1:
it will always pass in count
1
and the return value shouldn't be a map because it will never have two keys in the map
for now it will always return a single-value map like this:
so I'd suggest we remove the
count
and simplify the return type