diff --git a/services/horizon/internal/integration/protocol14_state_verifier_test.go b/services/horizon/internal/integration/state_verifier_test.go similarity index 88% rename from services/horizon/internal/integration/protocol14_state_verifier_test.go rename to services/horizon/internal/integration/state_verifier_test.go index bae0b71621..6ff62cfb1b 100644 --- a/services/horizon/internal/integration/protocol14_state_verifier_test.go +++ b/services/horizon/internal/integration/state_verifier_test.go @@ -11,13 +11,16 @@ import ( "github.com/stellar/go/keypair" "github.com/stellar/go/services/horizon/internal/db2/history" + "github.com/stellar/go/services/horizon/internal/ingest" "github.com/stellar/go/services/horizon/internal/test/integration" "github.com/stellar/go/txnbuild" "github.com/stretchr/testify/assert" ) -func TestProtocol14StateVerifier(t *testing.T) { - itest := integration.NewTest(t, protocol15Config) +func TestStateVerifier(t *testing.T) { + itest := integration.NewTest(t, integration.Config{ + ProtocolVersion: ingest.MaxSupportedProtocolVersion, + }) sponsored := keypair.MustRandom() sponsoredSource := &txnbuild.SimpleAccount{ @@ -45,6 +48,19 @@ func TestProtocol14StateVerifier(t *testing.T) { Line: txnbuild.CreditAsset{"ABCD", master.Address()}.MustToChangeTrustAsset(), Limit: txnbuild.MaxTrustlineLimit, }, + &txnbuild.ChangeTrust{ + Line: txnbuild.LiquidityPoolShareChangeTrustAsset{ + LiquidityPoolParameters: txnbuild.LiquidityPoolParameters{ + AssetA: txnbuild.NativeAsset{}, + AssetB: txnbuild.CreditAsset{ + Code: "ABCD", + Issuer: master.Address(), + }, + Fee: 30, + }, + }, + Limit: txnbuild.MaxTrustlineLimit, + }, &txnbuild.ManageSellOffer{ SourceAccount: sponsoredSource.AccountID, Selling: txnbuild.NativeAsset{}, diff --git a/services/horizon/internal/integration/trade_aggregations_test.go b/services/horizon/internal/integration/trade_aggregations_test.go index 60e1fd4bb5..5fd8f27465 100644 --- a/services/horizon/internal/integration/trade_aggregations_test.go +++ b/services/horizon/internal/integration/trade_aggregations_test.go @@ -7,6 +7,7 @@ import ( "github.com/stellar/go/services/horizon/internal/db2" "github.com/stellar/go/services/horizon/internal/db2/history" + "github.com/stellar/go/services/horizon/internal/ingest" "github.com/stellar/go/services/horizon/internal/test/integration" strtime "github.com/stellar/go/support/time" "github.com/stellar/go/xdr" @@ -14,7 +15,7 @@ import ( ) func TestTradeAggregations(t *testing.T) { - itest := integration.NewTest(t, protocol15Config) + itest := integration.NewTest(t, integration.Config{ProtocolVersion: ingest.MaxSupportedProtocolVersion}) ctx := context.Background() historyQ := itest.Horizon().HistoryQ() diff --git a/services/horizon/internal/integration/txsub_test.go b/services/horizon/internal/integration/txsub_test.go index c0b1abe694..7b269fffa9 100644 --- a/services/horizon/internal/integration/txsub_test.go +++ b/services/horizon/internal/integration/txsub_test.go @@ -5,6 +5,7 @@ import ( "sync" "testing" + "github.com/stellar/go/services/horizon/internal/ingest" "github.com/stellar/go/services/horizon/internal/test/integration" "github.com/stellar/go/txnbuild" "github.com/stretchr/testify/assert" @@ -12,7 +13,7 @@ import ( func TestTxsub(t *testing.T) { tt := assert.New(t) - itest := integration.NewTest(t, integration.Config{ProtocolVersion: 17}) + itest := integration.NewTest(t, integration.Config{ProtocolVersion: ingest.MaxSupportedProtocolVersion}) master := itest.Master() // Sanity check: create 20 accounts and submit 2 txs from each of them as diff --git a/services/horizon/internal/test/integration/integration.go b/services/horizon/internal/test/integration/integration.go index 15eb52b923..46f76aed2f 100644 --- a/services/horizon/internal/test/integration/integration.go +++ b/services/horizon/internal/test/integration/integration.go @@ -45,7 +45,7 @@ var ( type Config struct { PostgresURL string - ProtocolVersion int32 + ProtocolVersion uint32 SkipContainerCreation bool CoreDockerImage string @@ -421,7 +421,7 @@ func (i *Test) WaitForHorizon() { continue } - if root.CurrentProtocolVersion == i.config.ProtocolVersion { + if uint32(root.CurrentProtocolVersion) == i.config.ProtocolVersion { i.t.Logf("Horizon protocol version matches... %v", root) return } diff --git a/xdr/ledger_key.go b/xdr/ledger_key.go index 39c6278c32..fd16d66643 100644 --- a/xdr/ledger_key.go +++ b/xdr/ledger_key.go @@ -173,6 +173,12 @@ func (key LedgerKey) MarshalBinaryCompress() ([]byte, error) { return nil, err } m = append(m, cBalance...) + case LedgerEntryTypeLiquidityPool: + cBalance, err := key.LiquidityPool.LiquidityPoolId.MarshalBinary() + if err != nil { + return nil, err + } + m = append(m, cBalance...) default: panic("Unknown type") }