fix residual v9 references in templates

This commit is contained in:
vyzo 2022-11-08 06:55:26 +02:00
parent 50b971091f
commit 7ffd1635f5
3 changed files with 5 additions and 3 deletions

View File

@ -41,9 +41,8 @@ func MakeState(store adt.Store, av actorstypes.Version, governor address.Address
{{range .versions}}
case actorstypes.Version{{.}}:
return make{{.}}(store, governor, bitwidth)
default: return nil, xerrors.Errorf("datacap actor only valid for actors v9 and above, got %d", av)
{{end}}
default: return nil, xerrors.Errorf("datacap actor only valid for actors v9 and above, got %d", av)
}
}

View File

@ -370,7 +370,7 @@ func (s *state{{.v}}) GetAllocationIdForPendingDeal(dealId abi.DealID) (verifreg
{{if (le .v 8)}}
return verifregtypes.NoAllocationID, xerrors.Errorf("unsupported before actors v9")
{{else}}
allocations, err := adt9.AsMap(s.store, s.PendingDealAllocationIds, builtin.DefaultHamtBitwidth)
allocations, err := adt{{.v}}.AsMap(s.store, s.PendingDealAllocationIds, builtin.DefaultHamtBitwidth)
if err != nil {
return verifregtypes.NoAllocationID, xerrors.Errorf("failed to load allocation id for %d: %w", dealId, err)
}

View File

@ -22,6 +22,9 @@ import (
{{end}}
{{if (ge .v 9)}}
"github.com/filecoin-project/go-state-types/big"
{{if (gt .v 9)}}
verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
{{end}}
{{else}}
verifreg9 "github.com/filecoin-project/go-state-types/builtin/v9/verifreg"
{{end}}