diff --git a/ocp/currency/usd_market_value.go b/ocp/currency/usd_market_value.go index 4fb5be0..3b699b7 100644 --- a/ocp/currency/usd_market_value.go +++ b/ocp/currency/usd_market_value.go @@ -13,9 +13,11 @@ import ( // CalculateUsdMarketValue calculates the current USD market value of a crypto // amount in quarks. func CalculateUsdMarketValue(ctx context.Context, data ocp_data.Provider, mint *common.Account, quarks uint64, at time.Time) (float64, float64, error) { - _, err := common.GetVmConfigForMint(ctx, data, mint) + isSupportedMint, err := common.IsSupportedMint(ctx, data, mint) if err != nil { return 0, 0, err + } else if !isSupportedMint { + return 0, 0, common.ErrUnsupportedMint } usdExchangeRecord, err := data.GetExchangeRate(ctx, currency_lib.USD, at) diff --git a/ocp/rpc/transaction/intent.go b/ocp/rpc/transaction/intent.go index 72a7d91..27f1cf2 100644 --- a/ocp/rpc/transaction/intent.go +++ b/ocp/rpc/transaction/intent.go @@ -246,12 +246,12 @@ func (s *transactionServer) SubmitIntent(streamer transactionpb.Transaction_Subm } log = log.With(zap.String("mint", mintAccount.PublicKey().ToBase58())) - _, err = common.GetVmConfigForMint(ctx, s.data, mintAccount) - if err == common.ErrUnsupportedMint { - return handleSubmitIntentError(ctx, streamer, intentRecord, NewIntentValidationError("mint account must be the core mint or a launchpad currency")) - } else if err != nil { - log.With(zap.Error(err)).Warn("failure getting vm config for mint") + isSupportedMint, err := common.IsSupportedMint(ctx, s.data, mintAccount) + if err != nil { + log.With(zap.Error(err)).Warn("failure checking for mint support") return handleSubmitIntentError(ctx, streamer, intentRecord, err) + } else if !isSupportedMint { + return handleSubmitIntentError(ctx, streamer, intentRecord, NewIntentValidationError("mint account must be the core mint or a launchpad currency")) } // Populate metadata into the new DB record