func (s *Store) CheckBalance(key ed25519.PublicKey, curr Currency, amount DecimalAmount) error {
	wallet, ok := s.Lookup(key)
	if !ok {
		return fmt.Errorf("wallet does not exist")
	}
	if !wallet[curr].Subtract(DecimalAmount(amount)).IsPositive() {
		return fmt.Errorf("not enough cash: need %v, only have %v, would end up with %v", amount, wallet[curr], wallet[curr].Subtract(DecimalAmount(amount)))
	}

	return nil
}
// CheckBalance returns true if the wallet belonging to key
// has more of the given decimalAmount than requestedAmount
CheckBalance returns true if the wallet belonging to key
has more of the given decimalAmount than requestedAmount
// CheckBalance returns true if the wallet belonging to key // has more of the given decimalAmount than requestedAmount
func (s *Store) CheckBalance(key ed25519.PublicKey, curr Currency, amount DecimalAmount) error {
	wallet, ok := s.Lookup(key)
	if !ok {
		return fmt.Errorf("wallet does not exist")
	}
	if !wallet[curr].Subtract(DecimalAmount(amount)).IsPositive() {
		return fmt.Errorf("not enough cash: need %v, only have %v, would end up with %v", amount, wallet[curr], wallet[curr].Subtract(DecimalAmount(amount)))
	}
	return nil
}
func ( s * Store ) CheckBalance ( key ed25519 . PublicKey , curr Currency , amount DecimalAmount ) error { wallet , ok := s . Lookup ( key ) if ! ok { return fmt . Errorf ( " " ) } if ! wallet [ curr ] . Subtract ( DecimalAmount ( amount ) ) . IsPositive ( ) { return fmt . Errorf ( " " , amount , wallet [ curr ] , wallet [ curr ] . Subtract ( DecimalAmount ( amount ) ) ) } return nil }
CheckBalance returns true if the wallet belonging to key
has more of the given decimalAmount than requestedAmount
CheckBalance returns true if the wallet belonging to key has more of the given decimalAmount than requestedAmount