func (a Accumulator) Accumulate(coin *PublicCoin) error {
	if a.value.Cmp(big.NewInt(0)) == 0 {
		return errors.New("accumulator is not initialized")
	}

	if a.denomination != coin.denomination {
		return errors.New("accumulator does not match the coin being accumulated")
	}

	if coin.Validate() {
		a.Increment(coin.value)
	} else {
		return errors.New("coin is not valid")
	}
	return nil
}
// Accumulate a given coin if it is valid and the denomination matches.
Accumulate a given coin if it is valid and the denomination matches.
// Accumulate a given coin if it is valid and the denomination matches .
func (a Accumulator) Accumulate(coin *PublicCoin) error {
	if a.value.Cmp(big.NewInt(0)) == 0 {
		return errors.New("accumulator is not initialized")
	}
	if a.denomination != coin.denomination {
		return errors.New("accumulator does not match the coin being accumulated")
	}
	if coin.Validate() {
		a.Increment(coin.value)
	} else {
		return errors.New("coin is not valid")
	}
	return nil
}
func ( a Accumulator ) Accumulate ( coin * PublicCoin ) error { if a . value . Cmp ( big . NewInt ( 0 ) ) == 0 { return errors . New ( " " ) } if a . denomination != coin . denomination { return errors . New ( " " ) } if coin . Validate ( ) { a . Increment ( coin . value ) } else { return errors . New ( " " ) } return nil }
Accumulate a given coin if it is valid and the denomination matches.
Accumulate a given coin if it is valid and the denomination matches .