// Put saves an anchor event. If it already exists it will be overwritten.
Put saves an anchor event. If it already exists it will be overwritten.
// Put saves an anchor event . If it already exists it will be overwritten .
func (s *Store) Put(anchorEvent *vocab.AnchorEventType) error {
	if anchorEvent.Index() == nil {
		return fmt.Errorf("failed to save anchor event: Index is empty")
	}
	anchorEventBytes, err := s.marshal(anchorEvent)
	if err != nil {
		return fmt.Errorf("failed to marshal anchor event: %w", err)
	}
	logger.Debugf("storing anchor event: %s", string(anchorEventBytes))
	if e := s.store.Put(anchorEvent.Index().String(), anchorEventBytes); e != nil {
		return orberrors.NewTransient(fmt.Errorf("failed to put anchor event: %w", e))
	}
	return nil
}
func ( s * Store ) Put ( anchorEvent * vocab . AnchorEventType ) error { if anchorEvent . Index ( ) == nil { return fmt . Errorf ( " " ) } anchorEventBytes , err := s . marshal ( anchorEvent ) if err != nil { return fmt . Errorf ( " " , err ) } logger . Debugf ( " " , string ( anchorEventBytes ) ) if e := s . store . Put ( anchorEvent . Index ( ) . String ( ) , anchorEventBytes ) ; e != nil { return orberrors . NewTransient ( fmt . Errorf ( " " , e ) ) } return nil }
Put saves an anchor event.
Put saves an anchor event .