diff --git a/services/horizon/internal/actions/asset_test.go b/services/horizon/internal/actions/asset_test.go index 68b56d94b2..6547a6b853 100644 --- a/services/horizon/internal/actions/asset_test.go +++ b/services/horizon/internal/actions/asset_test.go @@ -139,8 +139,6 @@ func TestAssetStats(t *testing.T) { ClaimableBalances: "10", LiquidityPools: "20", }, - Amount: "1", - NumAccounts: 2, } usdAssetStatResponse := horizon.AssetStat{ Accounts: horizon.AssetStatAccounts{ @@ -185,8 +183,6 @@ func TestAssetStats(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "23", - NumAccounts: 1, } etherAssetStatResponse := horizon.AssetStat{ Accounts: horizon.AssetStatAccounts{ @@ -230,8 +226,6 @@ func TestAssetStats(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "1", - NumAccounts: 2, } otherUSDAssetStatResponse := horizon.AssetStat{ Accounts: horizon.AssetStatAccounts{ @@ -277,8 +271,6 @@ func TestAssetStats(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "111", - NumAccounts: 3, } eurAssetStatResponse := horizon.AssetStat{ Accounts: horizon.AssetStatAccounts{ @@ -445,8 +437,6 @@ func TestAssetStatsIssuerDoesNotExist(t *testing.T) { Unauthorized: "3", ClaimableBalances: "0", }, - Amount: "1", - NumAccounts: 2, } numChanged, err := q.InsertAssetStat(tt.Ctx, usdAssetStat) tt.Assert.NoError(err) diff --git a/services/horizon/internal/db2/history/asset_stats.go b/services/horizon/internal/db2/history/asset_stats.go index 622619680b..12e910d533 100644 --- a/services/horizon/internal/db2/history/asset_stats.go +++ b/services/horizon/internal/db2/history/asset_stats.go @@ -20,8 +20,6 @@ func assetStatToMap(assetStat ExpAssetStat) map[string]interface{} { "asset_issuer": assetStat.AssetIssuer, "accounts": assetStat.Accounts, "balances": assetStat.Balances, - "amount": assetStat.Amount, - "num_accounts": assetStat.NumAccounts, "contract_id": assetStat.ContractID, } } diff --git a/services/horizon/internal/db2/history/asset_stats_test.go b/services/horizon/internal/db2/history/asset_stats_test.go index a8352e4d97..520b480fd6 100644 --- a/services/horizon/internal/db2/history/asset_stats_test.go +++ b/services/horizon/internal/db2/history/asset_stats_test.go @@ -40,8 +40,6 @@ func TestAssetStatContracts(t *testing.T) { LiquidityPools: "0", Unauthorized: "0", }, - Amount: "0", - NumAccounts: 0, }, { AssetType: xdr.AssetTypeAssetTypeCreditAlphanum12, @@ -59,8 +57,6 @@ func TestAssetStatContracts(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "23", - NumAccounts: 1, }, { AssetType: xdr.AssetTypeAssetTypeCreditAlphanum4, @@ -78,8 +74,6 @@ func TestAssetStatContracts(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "1", - NumAccounts: 2, }, } var contractID [32]byte @@ -219,8 +213,6 @@ func TestInsertAssetStats(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "1", - NumAccounts: 2, }, { AssetType: xdr.AssetTypeAssetTypeCreditAlphanum12, @@ -238,8 +230,6 @@ func TestInsertAssetStats(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "23", - NumAccounts: 1, }, } tt.Assert.NoError(q.InsertAssetStats(tt.Ctx, assetStats)) @@ -276,8 +266,6 @@ func TestInsertAssetStat(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "1", - NumAccounts: 2, }, { AssetType: xdr.AssetTypeAssetTypeCreditAlphanum12, @@ -295,8 +283,6 @@ func TestInsertAssetStat(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "23", - NumAccounts: 1, }, } @@ -333,8 +319,6 @@ func TestInsertAssetStatAlreadyExistsError(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "1", - NumAccounts: 2, } numChanged, err := q.InsertAssetStat(tt.Ctx, assetStat) @@ -344,18 +328,6 @@ func TestInsertAssetStatAlreadyExistsError(t *testing.T) { numChanged, err = q.InsertAssetStat(tt.Ctx, assetStat) tt.Assert.Error(err) tt.Assert.Equal(numChanged, int64(0)) - - assetStat.NumAccounts = 4 - assetStat.Amount = "3" - numChanged, err = q.InsertAssetStat(tt.Ctx, assetStat) - tt.Assert.Error(err) - tt.Assert.Equal(numChanged, int64(0)) - - assetStat.NumAccounts = 2 - assetStat.Amount = "1" - got, err := q.GetAssetStat(tt.Ctx, assetStat.AssetType, assetStat.AssetCode, assetStat.AssetIssuer) - tt.Assert.NoError(err) - tt.Assert.Equal(got, assetStat) } func TestUpdateAssetStatDoesNotExistsError(t *testing.T) { @@ -380,8 +352,6 @@ func TestUpdateAssetStatDoesNotExistsError(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "1", - NumAccounts: 2, } numChanged, err := q.UpdateAssetStat(tt.Ctx, assetStat) @@ -415,8 +385,6 @@ func TestUpdateStat(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "1", - NumAccounts: 2, } numChanged, err := q.InsertAssetStat(tt.Ctx, assetStat) @@ -427,8 +395,6 @@ func TestUpdateStat(t *testing.T) { tt.Assert.NoError(err) tt.Assert.Equal(got, assetStat) - assetStat.NumAccounts = 50 - assetStat.Amount = "23" assetStat.SetContractID([32]byte{23}) numChanged, err = q.UpdateAssetStat(tt.Ctx, assetStat) @@ -462,8 +428,6 @@ func TestGetAssetStatDoesNotExist(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "1", - NumAccounts: 2, } _, err := q.GetAssetStat(tt.Ctx, assetStat.AssetType, assetStat.AssetCode, assetStat.AssetIssuer) @@ -493,8 +457,6 @@ func TestRemoveAssetStat(t *testing.T) { ClaimableBalances: "4", LiquidityPools: "5", }, - Amount: "1", - NumAccounts: 2, } numChanged, err := q.RemoveAssetStat(tt.Ctx, @@ -628,8 +590,6 @@ func TestGetAssetStatsFiltersAndCursor(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "1", - NumAccounts: 2, }, Contracts: zero, } @@ -650,8 +610,6 @@ func TestGetAssetStatsFiltersAndCursor(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "23", - NumAccounts: 1, }, Contracts: zero, } @@ -672,8 +630,6 @@ func TestGetAssetStatsFiltersAndCursor(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "1", - NumAccounts: 2, }, Contracts: zero, } @@ -694,8 +650,6 @@ func TestGetAssetStatsFiltersAndCursor(t *testing.T) { ClaimableBalances: "1", LiquidityPools: "2", }, - Amount: "111", - NumAccounts: 3, }, Contracts: ContractStat{ ActiveBalance: "120", diff --git a/services/horizon/internal/db2/history/main.go b/services/horizon/internal/db2/history/main.go index e9d8ffb185..f49d1129c5 100644 --- a/services/horizon/internal/db2/history/main.go +++ b/services/horizon/internal/db2/history/main.go @@ -427,8 +427,6 @@ type ExpAssetStat struct { AssetIssuer string `db:"asset_issuer"` Accounts ExpAssetStatAccounts `db:"accounts"` Balances ExpAssetStatBalances `db:"balances"` - Amount string `db:"amount"` - NumAccounts int32 `db:"num_accounts"` ContractID *[]byte `db:"contract_id"` // make sure to update Equals() when adding new fields to ExpAssetStat } @@ -481,9 +479,7 @@ func (e *ExpAssetStat) Equals(o ExpAssetStat) bool { e.AssetCode == o.AssetCode && e.AssetIssuer == o.AssetIssuer && e.Accounts == o.Accounts && - e.Balances == o.Balances && - e.Amount == o.Amount && - e.NumAccounts == o.NumAccounts + e.Balances == o.Balances } func (e *ExpAssetStat) GetContractID() ([32]byte, bool) { diff --git a/services/horizon/internal/ingest/processors/asset_stats_processor.go b/services/horizon/internal/ingest/processors/asset_stats_processor.go index 6ae83c3a3c..7e76b509c2 100644 --- a/services/horizon/internal/ingest/processors/asset_stats_processor.go +++ b/services/horizon/internal/ingest/processors/asset_stats_processor.go @@ -305,8 +305,6 @@ func IncludeContractIDsInAssetStats( AssetIssuer: assetIssuer, Accounts: history.ExpAssetStatAccounts{}, Balances: newAssetStatBalance().ConvertToHistoryObject(), - Amount: "0", - NumAccounts: 0, } row.SetContractID(contractID) assetStatsDeltas = append(assetStatsDeltas, row) @@ -456,8 +454,6 @@ func (p *AssetStatsProcessor) updateAssetStats( AssetIssuer: delta.AssetIssuer, Accounts: statAccounts, Balances: statBalances.ConvertToHistoryObject(), - Amount: statBalances.Authorized.String(), - NumAccounts: statAccounts.Authorized, ContractID: delta.ContractID, }) if err != nil { @@ -549,8 +545,6 @@ func (p *AssetStatsProcessor) updateContractID( AssetIssuer: assetIssuer, Accounts: history.ExpAssetStatAccounts{}, Balances: newAssetStatBalance().ConvertToHistoryObject(), - Amount: "0", - NumAccounts: 0, } row.SetContractID(contractID) diff --git a/services/horizon/internal/ingest/processors/asset_stats_processor_test.go b/services/horizon/internal/ingest/processors/asset_stats_processor_test.go index e8080773e8..ea267f6d3e 100644 --- a/services/horizon/internal/ingest/processors/asset_stats_processor_test.go +++ b/services/horizon/internal/ingest/processors/asset_stats_processor_test.go @@ -74,8 +74,6 @@ func (s *AssetStatsProcessorTestSuiteState) TestCreateTrustLine() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 1, }, }).Return(nil).Once() } @@ -141,8 +139,6 @@ func (s *AssetStatsProcessorTestSuiteState) TestCreateTrustLineWithClawback() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 1, }, }).Return(nil).Once() } @@ -179,8 +175,6 @@ func (s *AssetStatsProcessorTestSuiteState) TestCreateTrustLineUnauthorized() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }, }).Return(nil).Once() } @@ -320,8 +314,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestInsertClaimableBalance() { ClaimableBalances: "24", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }).Return(int64(1), nil).Once() s.mockQ.On("GetAssetStat", s.ctx, @@ -343,8 +335,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestInsertClaimableBalance() { ClaimableBalances: "46", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }).Return(int64(1), nil).Once() s.mockQ.On("RemoveContractAssetBalances", s.ctx, []xdr.Hash(nil)). @@ -487,8 +477,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestInsertTrustLine() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "10", - NumAccounts: 1, }).Return(int64(1), nil).Once() s.mockQ.On("GetAssetStat", s.ctx, @@ -510,8 +498,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestInsertTrustLine() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }).Return(int64(1), nil).Once() s.mockQ.On("RemoveContractAssetBalances", s.ctx, []xdr.Hash(nil)). @@ -599,8 +585,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestInsertContractID() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 1, } eurAssetStat.SetContractID(eurID) s.mockQ.On("InsertAssetStat", s.ctx, mock.MatchedBy(func(assetStat history.ExpAssetStat) bool { @@ -625,8 +609,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestInsertContractID() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, } usdAssetStat.SetContractID(usdID) s.mockQ.On("InsertAssetStat", s.ctx, mock.MatchedBy(func(assetStat history.ExpAssetStat) bool { @@ -932,8 +914,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestInsertContractIDWithBalance() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 1, } eurAssetStat.SetContractID(eurID) s.mockQ.On("InsertAssetStat", s.ctx, mock.MatchedBy(func(assetStat history.ExpAssetStat) bool { @@ -974,8 +954,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestInsertContractIDWithBalance() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, } usdAssetStat.SetContractID(usdID) s.mockQ.On("InsertAssetStat", s.ctx, mock.MatchedBy(func(assetStat history.ExpAssetStat) bool { @@ -1097,8 +1075,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestInsertClaimableBalanceAndTrustl ClaimableBalances: "12", LiquidityPools: "100", }, - Amount: "9", - NumAccounts: 1, }).Return(int64(1), nil).Once() s.mockQ.On("RemoveContractAssetBalances", s.ctx, []xdr.Hash(nil)). @@ -1148,8 +1124,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateContractID() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, }, nil).Once() eurAssetStat := history.ExpAssetStat{ @@ -1164,8 +1138,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateContractID() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, } eurAssetStat.SetContractID(eurID) s.mockQ.On("UpdateAssetStat", s.ctx, mock.MatchedBy(func(assetStat history.ExpAssetStat) bool { @@ -1309,8 +1281,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateContractIDWithBalance() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, }, nil).Once() eurAssetStat := history.ExpAssetStat{ @@ -1327,8 +1297,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateContractIDWithBalance() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, } eurAssetStat.SetContractID(eurID) s.mockQ.On("UpdateAssetStat", s.ctx, mock.MatchedBy(func(assetStat history.ExpAssetStat) bool { @@ -1406,8 +1374,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateContractIDError() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, } eurAssetStat.SetContractID(usdID) s.mockQ.On("GetAssetStat", s.ctx, @@ -1485,8 +1451,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustlineAndContractIDErr ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, } eurAssetStat.SetContractID(usdID) s.mockQ.On("GetAssetStat", s.ctx, @@ -1588,8 +1552,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustlineAndRemoveContrac ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, } s.mockQ.On("GetAssetStat", s.ctx, xdr.AssetTypeAssetTypeCreditAlphanum4, @@ -1654,8 +1616,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustLine() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, }, nil).Once() s.mockQ.On("UpdateAssetStat", s.ctx, history.ExpAssetStat{ AssetType: xdr.AssetTypeAssetTypeCreditAlphanum4, @@ -1669,8 +1629,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustLine() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "110", - NumAccounts: 1, }).Return(int64(1), nil).Once() s.mockQ.On("RemoveContractAssetBalances", s.ctx, []xdr.Hash(nil)). @@ -1805,8 +1763,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustLineAuthorization() ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }, nil).Once() s.mockQ.On("UpdateAssetStat", s.ctx, history.ExpAssetStat{ AssetType: xdr.AssetTypeAssetTypeCreditAlphanum4, @@ -1822,8 +1778,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustLineAuthorization() ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "10", - NumAccounts: 1, }).Return(int64(1), nil).Once() s.mockQ.On("GetAssetStat", s.ctx, @@ -1844,8 +1798,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustLineAuthorization() ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, }, nil).Once() s.mockQ.On("UpdateAssetStat", s.ctx, history.ExpAssetStat{ AssetType: xdr.AssetTypeAssetTypeCreditAlphanum4, @@ -1861,8 +1813,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustLineAuthorization() ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }).Return(int64(1), nil).Once() s.mockQ.On("GetAssetStat", s.ctx, @@ -1883,8 +1833,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustLineAuthorization() ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, }, nil).Once() s.mockQ.On("UpdateAssetStat", s.ctx, history.ExpAssetStat{ AssetType: xdr.AssetTypeAssetTypeCreditAlphanum4, @@ -1900,8 +1848,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustLineAuthorization() ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }).Return(int64(1), nil).Once() s.mockQ.On("RemoveContractAssetBalances", s.ctx, []xdr.Hash(nil)). @@ -1978,8 +1924,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestRemoveClaimableBalance() { ClaimableBalances: "12", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }, nil).Once() s.mockQ.On("RemoveAssetStat", s.ctx, xdr.AssetTypeAssetTypeCreditAlphanum4, @@ -2006,8 +1950,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestRemoveClaimableBalance() { ClaimableBalances: "21", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }, nil).Once() s.mockQ.On("UpdateAssetStat", s.ctx, history.ExpAssetStat{ AssetType: xdr.AssetTypeAssetTypeCreditAlphanum4, @@ -2021,8 +1963,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestRemoveClaimableBalance() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }).Return(int64(1), nil).Once() s.mockQ.On("RemoveContractAssetBalances", s.ctx, []xdr.Hash(nil)). @@ -2094,8 +2034,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestRemoveTrustLine() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 1, }, nil).Once() s.mockQ.On("RemoveAssetStat", s.ctx, xdr.AssetTypeAssetTypeCreditAlphanum4, @@ -2121,8 +2059,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestRemoveTrustLine() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, }, nil).Once() s.mockQ.On("RemoveAssetStat", s.ctx, xdr.AssetTypeAssetTypeCreditAlphanum4, @@ -2173,8 +2109,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestRemoveContractID() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, } eurAssetStat.SetContractID(eurID) s.mockQ.On("GetAssetStatByContract", s.ctx, xdr.Hash(eurID)). @@ -2260,8 +2194,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustlineAndRemoveContrac ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "100", - NumAccounts: 1, } eurAssetStat.SetContractID(eurID) s.mockQ.On("GetAssetStat", s.ctx, @@ -2282,8 +2214,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestUpdateTrustlineAndRemoveContrac ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "110", - NumAccounts: 1, } s.mockQ.On("UpdateAssetStat", s.ctx, mock.MatchedBy(func(assetStat history.ExpAssetStat) bool { return eurAssetStat.Equals(assetStat) @@ -2332,8 +2262,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestRemoveContractIDFromZeroRow() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, } eurAssetStat.SetContractID(eurID) s.mockQ.On("GetAssetStatByContract", s.ctx, xdr.Hash(eurID)). @@ -2432,8 +2360,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestRemoveContractIDAndBalanceZeroR ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 0, } eurAssetStat.SetContractID(eurID) s.mockQ.On("GetAssetStatByContract", s.ctx, xdr.Hash(eurID)). @@ -2524,8 +2450,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestRemoveContractIDAndRow() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "0", - NumAccounts: 1, } eurAssetStat.SetContractID(eurID) s.mockQ.On("GetAssetStat", s.ctx, @@ -2621,8 +2545,6 @@ func (s *AssetStatsProcessorTestSuiteLedger) TestProcessUpgradeChange() { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "10", - NumAccounts: 1, }).Return(int64(1), nil).Once() s.mockQ.On("RemoveContractAssetBalances", s.ctx, []xdr.Hash(nil)). diff --git a/services/horizon/internal/ingest/processors/asset_stats_set.go b/services/horizon/internal/ingest/processors/asset_stats_set.go index bc27c2a4ef..9b79e49d82 100644 --- a/services/horizon/internal/ingest/processors/asset_stats_set.go +++ b/services/horizon/internal/ingest/processors/asset_stats_set.go @@ -109,8 +109,6 @@ func (value assetStatValue) ConvertToHistoryObject() history.ExpAssetStat { AssetIssuer: value.assetIssuer, Accounts: value.accounts, Balances: balances, - Amount: balances.Authorized, - NumAccounts: value.accounts.Authorized, } } diff --git a/services/horizon/internal/ingest/processors/asset_stats_set_test.go b/services/horizon/internal/ingest/processors/asset_stats_set_test.go index f9989fdc9e..330a2132ec 100644 --- a/services/horizon/internal/ingest/processors/asset_stats_set_test.go +++ b/services/horizon/internal/ingest/processors/asset_stats_set_test.go @@ -109,8 +109,6 @@ func TestAddAssetStats(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "1", - NumAccounts: 1, } assert.NoError( @@ -150,9 +148,7 @@ func TestAddAssetStats(t *testing.T) { ) eurAssetStat.Balances.Authorized = "25" - eurAssetStat.Amount = "25" eurAssetStat.Accounts.Authorized++ - eurAssetStat.NumAccounts++ assertAllEquals(t, set, []history.ExpAssetStat{eurAssetStat}) usd := "USD" @@ -214,8 +210,6 @@ func TestAddAssetStats(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "3", - NumAccounts: 1, }, eurAssetStat, { @@ -232,8 +226,6 @@ func TestAddAssetStats(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "10", - NumAccounts: 1, }, } assertAllEquals(t, set, expected) @@ -270,8 +262,6 @@ func TestOverflowAssetStatSet(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "9223372036854775807", - NumAccounts: 1, } if all[0] != eurAssetStat { t.Fatalf("expected asset stat to be %v but got %v", eurAssetStat, all[0]) @@ -305,8 +295,6 @@ func TestOverflowAssetStatSet(t *testing.T) { ClaimableBalances: "0", LiquidityPools: "0", }, - Amount: "18446744073709551614", - NumAccounts: 2, } if all[0] != eurAssetStat { t.Fatalf("expected asset stat to be %v but got %v", eurAssetStat, all[0]) diff --git a/services/horizon/internal/ingest/verify_range_state_test.go b/services/horizon/internal/ingest/verify_range_state_test.go index a1df30d854..f330ba362a 100644 --- a/services/horizon/internal/ingest/verify_range_state_test.go +++ b/services/horizon/internal/ingest/verify_range_state_test.go @@ -568,7 +568,6 @@ func (s *VerifyRangeStateTestSuite) TestSuccessWithVerify() { LiquidityPools: "450", Unauthorized: "0", }, - Amount: "0", }, }, }, nil).Once() @@ -651,8 +650,6 @@ func (s *VerifyRangeStateTestSuite) TestVerifyFailsWhenAssetStatsMismatch() { AuthorizedToMaintainLiabilities: "0", Unauthorized: "123", }, - Amount: "0", - NumAccounts: 0, }, } diff --git a/services/horizon/internal/integration/sac_test.go b/services/horizon/internal/integration/sac_test.go index a7311d173d..6356ba9ac5 100644 --- a/services/horizon/internal/integration/sac_test.go +++ b/services/horizon/internal/integration/sac_test.go @@ -260,9 +260,7 @@ func TestExpirationAndRestoration(t *testing.T) { LiquidityPools: "0", Unauthorized: "0", }, - Amount: "0", - NumAccounts: 0, - ContractID: nil, + ContractID: nil, } syntheticAssetStat.SetContractID(storeContractID) _, err := itest.HorizonIngest().HistoryQ().InsertAssetStat( diff --git a/services/horizon/internal/resourceadapter/asset_stat_test.go b/services/horizon/internal/resourceadapter/asset_stat_test.go index e36b7bef85..cd3209414d 100644 --- a/services/horizon/internal/resourceadapter/asset_stat_test.go +++ b/services/horizon/internal/resourceadapter/asset_stat_test.go @@ -31,8 +31,6 @@ func TestPopulateExpAssetStat(t *testing.T) { ClaimableBalances: "1200000000000000000", LiquidityPools: "7700000000000000000", }, - Amount: "100000000000000000000", // 10T - NumAccounts: 429, }, Contracts: history.ContractStat{ ActiveBalance: "900000000000000000",