// AddStatus adds verifiable credential proof collecting status.
AddStatus adds verifiable credential proof collecting status.
// AddStatus adds verifiable credential proof collecting status .
func (s *Store) AddStatus(anchorID string, status proof.VCStatus) error {
	anchorIDEncoded := base64.RawURLEncoding.EncodeToString([]byte(anchorID))
	indexTag := storage.Tag{
		Name:  index,
		Value: anchorIDEncoded,
	}
	expiryTag := storage.Tag{
		Name:  expiryTagName,
		Value: fmt.Sprintf("%d", time.Now().Add(s.statusLifespan).Unix()),
	}
	statusBytes, err := s.marshal(status)
	if err != nil {
		return fmt.Errorf("marshal: %w", err)
	}
	err = s.store.Put(uuid.New().String(), statusBytes, indexTag, expiryTag)
	if err != nil {
		return orberrors.NewTransient(fmt.Errorf("failed to store anchorID[%s] status '%s': %w",
			anchorID, status, err))
	}
	logger.Debugf("stored anchorID[%s] status '%s'", anchorID, status)
	return nil
}
func ( s * Store ) AddStatus ( anchorID string , status proof . VCStatus ) error { anchorIDEncoded := base64 . RawURLEncoding . EncodeToString ( [ ] byte ( anchorID ) ) indexTag := storage . Tag { Name : index , Value : anchorIDEncoded , } expiryTag := storage . Tag { Name : expiryTagName , Value : fmt . Sprintf ( " " , time . Now ( ) . Add ( s . statusLifespan ) . Unix ( ) ) , } statusBytes , err := s . marshal ( status ) if err != nil { return fmt . Errorf ( " " , err ) } err = s . store . Put ( uuid . New ( ) . String ( ) , statusBytes , indexTag , expiryTag ) if err != nil { return orberrors . NewTransient ( fmt . Errorf ( " " , anchorID , status , err ) ) } logger . Debugf ( " " , anchorID , status ) return nil }
AddStatus adds verifiable credential proof collecting status.
AddStatus adds verifiable credential proof collecting status .