// New creates new vc status store.
New creates new vc status store.
// New creates new vc status store .
func New(provider storage.Provider, expiryService *expiry.Service, maxWitnessDelay time.Duration) (*Store, error) {
	store, err := provider.OpenStore(namespace)
	if err != nil {
		return nil, fmt.Errorf("failed to open vc-status store: %w", err)
	}
	err = provider.SetStoreConfig(namespace, storage.StoreConfiguration{TagNames: []string{index, expiryTagName}})
	if err != nil {
		return nil, fmt.Errorf("failed to set store configuration: %w", err)
	}
	expiryService.Register(store, expiryTagName, namespace)
	return &Store{
		store:          store,
		statusLifespan: maxWitnessDelay + delta,
		marshal:   json.Marshal,
		unmarshal: json.Unmarshal,
	}, nil
}
func New ( provider storage . Provider , expiryService * expiry . Service , maxWitnessDelay time . Duration ) ( * Store , error ) { store , err := provider . OpenStore ( namespace ) if err != nil { return nil , fmt . Errorf ( " " , err ) } err = provider . SetStoreConfig ( namespace , storage . StoreConfiguration { TagNames : [ ] string { index , expiryTagName } } ) if err != nil { return nil , fmt . Errorf ( " " , err ) } expiryService . Register ( store , expiryTagName , namespace ) return & Store { store : store , statusLifespan : maxWitnessDelay + delta , marshal : json . Marshal , unmarshal : json . Unmarshal , } , nil }
New creates new vc status store.
New creates new vc status store .