Review Response

This commit is contained in:
zenground0 2023-07-20 16:37:03 -06:00
parent 38b21a713a
commit 4d8f8d2600
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,6 @@
// Copied from go-amt-ipld https://github.com/filecoin-project/go-amt-ipld/tree/master/internal
// which for some reason is a go internal package and therefore cannot be imported
package main package main
import ( import (
@ -59,7 +62,7 @@ func (t *AMTRoot) MarshalCBOR(w io.Writer) error {
// t.Count (uint64) (uint64) // t.Count (uint64) (uint64)
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Count)); err != nil { if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, t.Count); err != nil {
return err return err
} }
@ -104,7 +107,7 @@ func (t *AMTRoot) UnmarshalCBOR(r io.Reader) (err error) {
if maj != cbg.MajUnsignedInt { if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field") return fmt.Errorf("wrong type for uint64 field")
} }
t.BitWidth = uint64(extra) t.BitWidth = extra
} }
// t.Height (uint64) (uint64) // t.Height (uint64) (uint64)
@ -118,7 +121,7 @@ func (t *AMTRoot) UnmarshalCBOR(r io.Reader) (err error) {
if maj != cbg.MajUnsignedInt { if maj != cbg.MajUnsignedInt {
return fmt.Errorf("wrong type for uint64 field") return fmt.Errorf("wrong type for uint64 field")
} }
t.Height = uint64(extra) t.Height = extra
} }
// t.Count (uint64) (uint64) // t.Count (uint64) (uint64)

View File

@ -298,12 +298,14 @@ var amtBenchCmd = &cli.Command{
} }
for i := j; i < 40000000; i += interval { for i := j; i < 40000000; i += interval {
if i%interval == j { if i%interval == j {
array.Set(uint64(i), &market.DealState{ if err := array.Set(uint64(i), &market.DealState{
SectorStartEpoch: abi.ChainEpoch(2000000 + i), SectorStartEpoch: abi.ChainEpoch(2000000 + i),
LastUpdatedEpoch: abi.ChainEpoch(1), LastUpdatedEpoch: abi.ChainEpoch(1),
SlashEpoch: -1, SlashEpoch: -1,
VerifiedClaim: verifreg.AllocationId(i), VerifiedClaim: verifreg.AllocationId(i),
}) }); err != nil {
return err
}
} }
} }
roots[j], err = array.Root() roots[j], err = array.Root()