/
verified_registry_state.go
36 lines (29 loc) · 1 KB
/
verified_registry_state.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package verifreg
import (
addr "github.com/chenjianmei111/go-address"
abi "github.com/chenjianmei111/go-state-types/abi"
big "github.com/chenjianmei111/go-state-types/big"
cid "github.com/ipfs/go-cid"
)
// DataCap is an integer number of bytes.
// We can introduce policy changes and replace this in the future.
type DataCap = abi.StoragePower
type State struct {
// Root key holder multisig.
// Authorize and remove verifiers.
RootKey addr.Address
// Verifiers authorize VerifiedClients.
// Verifiers delegate their DataCap.
Verifiers cid.Cid // HAMT[addr.Address]DataCap
// VerifiedClients can add VerifiedClientData, up to DataCap.
VerifiedClients cid.Cid // HAMT[addr.Address]DataCap
}
var MinVerifiedDealSize abi.StoragePower = big.NewInt(1 << 20) // PARAM_FINISH
// rootKeyAddress comes from genesis.
func ConstructState(emptyMapCid cid.Cid, rootKeyAddress addr.Address) *State {
return &State{
RootKey: rootKeyAddress,
Verifiers: emptyMapCid,
VerifiedClients: emptyMapCid,
}
}