Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,55 @@ This monorepo contains a number of sdk's:
Official project releases may be found here: https://github.com/stellar/go-stellar-sdk/releases
## Pending

## [0.6.1] - 2026-08-10

Backport release for Horizon 27.0.1, cut from `v0.6.0`.

### Bug Fixes
* xdr: `Asset.LessThan` now orders assets the way the protocol does — by the raw 32-byte issuer key — instead of by base32 strkey text, and `xdr.NewPoolId` requires strictly `a < b`, rejecting reversed and identical pairs ([#5974](https://github.com/stellar/go-stellar-sdk/pull/5974))
* txnbuild: liquidity pool operations reject asset pairs that are not strictly ordered — previously these built transactions that stellar-core rejects; see the [txnbuild changelog](./txnbuild/CHANGELOG.md) ([#5974](https://github.com/stellar/go-stellar-sdk/pull/5974))
* processors/token_transfer: trustline revocation now compares liquidity pool assets by value instead of pointer identity, fixing wrong-leg selection when burning pool shares ([#5974](https://github.com/stellar/go-stellar-sdk/pull/5974))
* clients/stellartoml: `GetStellarToml` now validates the domain before issuing the request, matching `GetStellarTomlByAddress` ([#5970](https://github.com/stellar/go-stellar-sdk/pull/5970))

### Updates
* ingest/ledgerbackend: Updated the embedded `captive-core-pubnet.cfg`, replacing SatoshiPay's validators with Obsrvr's ([#5963](https://github.com/stellar/go-stellar-sdk/pull/5963))
* go.mod: Bumped github.com/stellar/go-xdr to dc590f1 ([#5974](https://github.com/stellar/go-stellar-sdk/pull/5974))

## [0.6.0] - 2026-06-09

Adds support for Protocol 27 (CAP-0071).

### New Features
* xdr: Protocol 27 (CAP-0071) XDR ([#5945](https://github.com/stellar/go-stellar-sdk/pull/5945), [#5947](https://github.com/stellar/go-stellar-sdk/pull/5947))
* xdr: Added zero-copy XDR view types and code generator ([#5937](https://github.com/stellar/go-stellar-sdk/pull/5937))
* ingest/ledgerbackend: Integrated XDR views into the buffered storage backend and added `GetLedgerRaw` ([#5941](https://github.com/stellar/go-stellar-sdk/pull/5941))
* ingest/ledgerbackend: Added `LedgerStream` streaming ingestion API ([#5944](https://github.com/stellar/go-stellar-sdk/pull/5944))
* ingest/loadtest: Added stellar-core apply-load tooling ([#5940](https://github.com/stellar/go-stellar-sdk/pull/5940))
* apiclient: Support non-JSON responses via `ResponseType` ([#5939](https://github.com/stellar/go-stellar-sdk/pull/5939))

### Bug Fixes
* services/stellar-archivist: Fixed nil pointer panics in `S3Storage.ListFiles` ([#5934](https://github.com/stellar/go-stellar-sdk/pull/5934))
* strkey: Bounded decode input length to avoid unnecessary allocation ([#5935](https://github.com/stellar/go-stellar-sdk/pull/5935))
* txnbuild: Validate payload length in contract address decoding ([#5943](https://github.com/stellar/go-stellar-sdk/pull/5943))

### Updates
* go.mod: Bumped github.com/stellar/go-xdr to a87d4d0 ([#5938](https://github.com/stellar/go-stellar-sdk/pull/5938))

## [0.5.0] - 2026-04-07

### Bug Fixes
* ingest: Fixed `VerifyEvents` to handle amounts exceeding the int64 range ([#5932](https://github.com/stellar/go-stellar-sdk/pull/5932))

## [0.4.0] - 2026-04-01

Adds support for Protocol 26.

### New Features
* xdr: Protocol 26 support, merged from protocol-next ([#5930](https://github.com/stellar/go-stellar-sdk/pull/5930))

### Bug Fixes
* support/datastore: Fixed `ListFilePath` for a datastore bucket with no prefix ([#5923](https://github.com/stellar/go-stellar-sdk/pull/5923))

## [0.3.0]

### Security Fixes
Expand Down
9 changes: 9 additions & 0 deletions clients/stellartoml/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ import (
"net/http"

"github.com/BurntSushi/toml"
"github.com/asaskevich/govalidator"
"github.com/stellar/go-stellar-sdk/address"
"github.com/stellar/go-stellar-sdk/support/errors"
)

// GetStellarToml returns stellar.toml file for a given domain
func (c *Client) GetStellarToml(domain string) (resp *Response, err error) {
// GetStellarTomlByAddress already rejects a non-DNS domain (via address.Split),
// but this entry point historically did not. Apply the same check here so both
// entry points behave the same way and neither will build a request URL out of
// an IP literal, a "user@host" string, or anything else that isn't a hostname.
if !govalidator.IsDNSName(domain) {
return nil, errors.Errorf("invalid domain: %q is not a valid DNS name", domain)
}

var hresp *http.Response
hresp, err = c.HTTP.Get(c.url(domain))
if err != nil {
Expand Down
18 changes: 18 additions & 0 deletions clients/stellartoml/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ func TestClientURL(t *testing.T) {
assert.Equal(t, "http://stellar.org/.well-known/stellar.toml", c.url("stellar.org"))
}

func TestClientRejectsNonDNSDomain(t *testing.T) {
h := httptest.NewClient()
c := &Client{HTTP: h}

for _, domain := range []string{
"127.0.0.1",
"127.0.0.1:8080",
"user@stellar.org",
"169.254.169.254",
"stellar.org/../../evil",
} {
_, err := c.GetStellarToml(domain)
if assert.Error(t, err, "domain %q should be rejected", domain) {
assert.Contains(t, err.Error(), "not a valid DNS name")
}
}
}

func TestClient(t *testing.T) {
h := httptest.NewClient()
c := &Client{HTTP: h}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.17.0
github.com/stellar/go-xdr v0.0.0-20260529210834-0bf8f4956364
github.com/stellar/go-xdr v0.0.0-20260806060815-dc590f17552a
github.com/stretchr/testify v1.10.0
github.com/tyler-smith/go-bip39 v0.0.0-20180618194314-52158e4697b8
github.com/xdrpp/goxdr v0.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI=
github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI=
github.com/stellar/go-xdr v0.0.0-20260529210834-0bf8f4956364 h1:gOKrfuWdZ92LFlv0TAwgZ7OsWKeBsOMDlGLyFgduI1w=
github.com/stellar/go-xdr v0.0.0-20260529210834-0bf8f4956364/go.mod h1:If+U9Z1W5xU97VrOgJandQT+2dN7/iOpkCrxBJEyF80=
github.com/stellar/go-xdr v0.0.0-20260806060815-dc590f17552a h1:40YIhQusSioBKDW5Tr+YdjoXphcVeu7eXUS2ibMQBTs=
github.com/stellar/go-xdr v0.0.0-20260806060815-dc590f17552a/go.mod h1:If+U9Z1W5xU97VrOgJandQT+2dN7/iOpkCrxBJEyF80=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
Expand Down
32 changes: 16 additions & 16 deletions ingest/ledgerbackend/configs/captive-core-pubnet.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ HOME_DOMAIN="www.franklintempleton.com"
QUALITY="HIGH"

[[HOME_DOMAINS]]
HOME_DOMAIN="satoshipay"
HOME_DOMAIN="stellar.withobsrvr.com"
QUALITY="HIGH"

[[HOME_DOMAINS]]
Expand Down Expand Up @@ -97,25 +97,25 @@ HISTORY="curl -sf https://stellar-history-usw.franklintempleton.com/azuswshf401/
HOME_DOMAIN="www.franklintempleton.com"

[[VALIDATORS]]
NAME="satoshipay_de"
PUBLIC_KEY="GC5SXLNAM3C4NMGK2PXK4R34B5GNZ47FYQ24ZIBFDFOCU6D4KBN4POAE"
ADDRESS="stellar-de-fra.satoshipay.io:11625"
HISTORY="curl -sf https://stellar-history-de-fra.satoshipay.io/{0} -o {1}"
HOME_DOMAIN="satoshipay"
NAME="OBSRVR Validator 1"
PUBLIC_KEY="GDRCZ4IPJR7V3HK4GR45CRTE72SDAOZUF2TDBQ5E5IGWC4KM5TSKU2LS"
ADDRESS="core-live-1.nodeswithobsrvr.co:11625"
HISTORY="curl -sf https://history-1.nodeswithobsrvr.co/obsrvr-core-1/{0} -o {1}"
HOME_DOMAIN="stellar.withobsrvr.com"

[[VALIDATORS]]
NAME="satoshipay_sg"
PUBLIC_KEY="GBJQUIXUO4XSNPAUT6ODLZUJRV2NPXYASKUBY4G5MYP3M47PCVI55MNT"
ADDRESS="stellar-sg-sin.satoshipay.io:11625"
HISTORY="curl -sf https://stellar-history-sg-sin.satoshipay.io/{0} -o {1}"
HOME_DOMAIN="satoshipay"
NAME="OBSRVR Validator 2"
PUBLIC_KEY="GA2PU4UGMLSFUXGZATHPTDXXX7FOHBAQC57RSJCQUN72WFKTD6CEPQSF"
ADDRESS="core-live-2.nodeswithobsrvr.co:11625"
HISTORY="curl -sf https://history-2.nodeswithobsrvr.co/obsrvr-core-2/{0} -o {1}"
HOME_DOMAIN="stellar.withobsrvr.com"

[[VALIDATORS]]
NAME="satoshipay_us"
PUBLIC_KEY="GAK6Z5UVGUVSEK6PEOCAYJISTT5EJBB34PN3NOLEQG2SUKXRVV2F6HZY"
ADDRESS="stellar-us-iowa.satoshipay.io:11625"
HISTORY="curl -sf https://stellar-history-us-iowa.satoshipay.io/{0} -o {1}"
HOME_DOMAIN="satoshipay"
NAME="OBSRVR Validator 3"
PUBLIC_KEY="GACM6GIRMLXBBZIYJXBDTAEYZ2GJP3JJP5G5K4WDPBS6QFHPJNK6S2FB"
ADDRESS="core-live-3.nodeswithobsrvr.co:11625"
HISTORY="curl -sf https://history-3.nodeswithobsrvr.co/obsrvr-core-3/{0} -o {1}"
HOME_DOMAIN="stellar.withobsrvr.com"

[[VALIDATORS]]
NAME = "Gamma Node Validator"
Expand Down
7 changes: 6 additions & 1 deletion ingest/producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func ApplyLedgerMetadata(ledgerRange ledgerbackend.Range,
if err != nil {
return fmt.Errorf("failed to create datastore: %w", err)
}
defer dataStore.Close()

schema, err := datastore.LoadSchema(context.Background(), dataStore, publisherConfig.DataStoreConfig)
if err != nil {
Expand All @@ -116,6 +117,8 @@ func ApplyLedgerMetadata(ledgerRange ledgerbackend.Range,
ledgerBackend = ledgerbackend.WithMetrics(ledgerBackend, publisherConfig.Registry, publisherConfig.RegistryNamespace)
}

defer ledgerBackend.Close()

if ledgerRange.Bounded() && ledgerRange.To() <= ledgerRange.From() {
return fmt.Errorf("invalid end value for bounded range, must be greater than start")
}
Expand All @@ -125,7 +128,9 @@ func ApplyLedgerMetadata(ledgerRange ledgerbackend.Range,
}

from := max(2, ledgerRange.From())
ledgerBackend.PrepareRange(ctx, ledgerRange)
if err = ledgerBackend.PrepareRange(ctx, ledgerRange); err != nil {
return fmt.Errorf("failed to prepare range: %w", err)
}

for ledgerSeq := from; ledgerSeq <= ledgerRange.To() || !ledgerRange.Bounded(); ledgerSeq++ {
var ledgerCloseMeta xdr.LedgerCloseMeta
Expand Down
14 changes: 12 additions & 2 deletions ingest/producer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func TestBSBProducerFnConfigError(t *testing.T) {
mockDataStore.On("GetFile", mock.Anything, ".config.json").
Return(io.NopCloser(bytes.NewReader(configManifestJSON(t))), int64(-1), nil).Once()
mockDataStore.On("ListFilePaths", mock.Anything, datastore.ListFileOptions{}).Return(nil, nil)
mockDataStore.On("Close").Return(nil).Once()

datastoreFactory = func(_ context.Context, _ datastore.DataStoreConfig) (datastore.DataStore, error) {
return mockDataStore, nil
Expand All @@ -137,6 +138,7 @@ func TestBSBProducerFnInvalidRange(t *testing.T) {
mockDataStore.On("GetFile", mock.Anything, ".config.json").
Return(io.NopCloser(bytes.NewReader(configManifestJSON(t))), int64(-1), nil).Once()
mockDataStore.On("ListFilePaths", mock.Anything, datastore.ListFileOptions{}).Return(nil, nil)
mockDataStore.On("Close").Return(nil).Once()

appCallback := func(lcm xdr.LedgerCloseMeta) error {
return nil
Expand Down Expand Up @@ -169,6 +171,7 @@ func TestBSBProducerFnGetLedgerError(t *testing.T) {
// don't assert on it
mockDataStore.On("GetFile", mock.Anything, "FFFFFFFC--3.xdr.zst").Return(makeSingleLCMBatch(3), int64(-1), nil).Maybe()
mockDataStore.On("ListFilePaths", mock.Anything, datastore.ListFileOptions{}).Return(nil, nil)
mockDataStore.On("Close").Return(nil).Once()

appCallback := func(lcm xdr.LedgerCloseMeta) error {
return nil
Expand Down Expand Up @@ -203,7 +206,11 @@ func TestBSBProducerFnCallbackError(t *testing.T) {
DataStoreConfig: datastore.DataStoreConfig{},
BufferedStorageConfig: DefaultBufferedStorageBackendConfig(1),
}
mockDataStore := createMockdataStore(t, 2, 3, 64000)
mockDataStore := createMockdataStore(t, 2, 2, 64000)
// The callback fails on ledger 2, so the multi-worker buffer may or may not
// get far enough to prefetch ledger 3 — allow the fetch without requiring it.
mockDataStore.On("GetFile", mock.Anything, fmt.Sprintf("FFFFFFFF--0-63999/%08X--3.xdr.zst", math.MaxUint32-3)).
Return(makeSingleLCMBatch(3), int64(-1), nil).Maybe()

appCallback := func(lcm xdr.LedgerCloseMeta) error {
return errors.New("uhoh")
Expand All @@ -217,6 +224,7 @@ func TestBSBProducerFnCallbackError(t *testing.T) {
"received an error from callback invocation")
}

// Serves ledgers start..end, requiring exactly one fetch of each.
func createMockdataStore(t *testing.T, start, end, partitionSize uint32) *datastore.MockDataStore {
mockDataStore := new(datastore.MockDataStore)

Expand All @@ -233,11 +241,13 @@ func createMockdataStore(t *testing.T, start, end, partitionSize uint32) *datast
mockDataStore.On("GetFile", mock.Anything, ".config.json").
Return(io.NopCloser(bytes.NewReader(configJSON)), int64(-1), nil).Once()
mockDataStore.On("ListFilePaths", mock.Anything, datastore.ListFileOptions{}).Return(nil, nil)
mockDataStore.On("Close").Return(nil).Once()

partition := partitionSize - 1
for i := start; i <= end; i++ {
objectName := fmt.Sprintf("FFFFFFFF--0-%d/%08X--%d.xdr.zst", partition, math.MaxUint32-i, i)
mockDataStore.On("GetFile", mock.Anything, objectName).Return(makeSingleLCMBatch(i), int64(-1), nil).Once()
mockDataStore.On("GetFile", mock.Anything, objectName).
Return(makeSingleLCMBatch(i), int64(-1), nil).Once()
}

t.Cleanup(func() {
Expand Down
3 changes: 2 additions & 1 deletion processors/token_transfer/token_transfer_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,10 @@ func (p *EventsProcessor) generateEventsForRevokedTrustlines(tx ingest.LedgerTra
assetInCb := cbsCreatedByThisLp[0].Asset

// The asset that needs to be burned is the one that is the OPPOSITE of the asset in the CB, so find that in the LP
// Equals, not ==: xdr.Asset's alphanum arms are pointers, so == compares identity.
var burnedAsset xdr.Asset
var burnedAmount xdr.Int64
if assetInCb == lp.assetA {
if assetInCb.Equals(lp.assetA) {
burnedAsset = lp.assetB
burnedAmount = lp.amountChangeForAssetB
} else {
Expand Down
15 changes: 14 additions & 1 deletion processors/token_transfer/token_transfer_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ var (
return xdr.LedgerEntryChange{
Type: xdr.LedgerEntryChangeTypeLedgerEntryRemoved,
Removed: &xdr.LedgerKey{
Type: xdr.LedgerEntryTypeClaimableBalance,
ClaimableBalance: &xdr.LedgerKeyClaimableBalance{
BalanceId: cbId,
},
Expand Down Expand Up @@ -392,6 +393,7 @@ var (
return xdr.LedgerEntryChange{
Type: xdr.LedgerEntryChangeTypeLedgerEntryRemoved,
Removed: &xdr.LedgerKey{
Type: xdr.LedgerEntryTypeLiquidityPool,
LiquidityPool: &xdr.LedgerKeyLiquidityPool{
LiquidityPoolId: lpId,
},
Expand Down Expand Up @@ -602,13 +604,24 @@ type testFixture struct {
wantErr bool
}

// Re-decodes the meta so each xdr.Asset gets its own allocation, as in
// production. Fixtures share package-level assets, which aliases their pointers.
func reEncodeMeta(t *testing.T, tx ingest.LedgerTransaction) ingest.LedgerTransaction {
t.Helper()
raw, err := tx.UnsafeMeta.MarshalBinary()
require.NoError(t, err)
out := tx
require.NoError(t, out.UnsafeMeta.UnmarshalBinary(raw))
return out
}

// RunTokenTransferEventTests runs a standard set of tests for token transfer event processing
func runTokenTransferEventTests(t *testing.T, tests []testFixture) {
for _, fixture := range tests {
ttp := NewEventsProcessor(someNetworkPassphrase)
t.Run(fixture.name, func(t *testing.T) {
events, err := ttp.EventsFromOperation(
fixture.tx,
reEncodeMeta(t, fixture.tx),
fixture.opIndex,
fixture.op,
fixture.opResult,
Expand Down
4 changes: 4 additions & 0 deletions txnbuild/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ file. This project adheres to [Semantic Versioning](http://semver.org/).
### Breaking changes

* `SetOpSourceAccount` now returns an `error` instead of silently ignoring invalid source account addresses. All `BuildXDR()` methods propagate this error. ([#5912](https://github.com/stellar/go-stellar-sdk/pull/5912))
* Liquidity pool asset pairs are validated strictly ([#5974](https://github.com/stellar/go-stellar-sdk/pull/5974)):
* `LiquidityPoolParameters.ToXDR`, `NewLiquidityPoolId`, `NewLiquidityPoolDeposit`, and `NewLiquidityPoolWithdraw` now require `AssetA < AssetB` in the protocol's order (raw issuer key, not strkey text). Reversed or identical pairs — which previously could build operations that stellar-core rejects with `CHANGE_TRUST_MALFORMED` — now error at build time, with the message changed from `AssetA must be <= AssetB` to `AssetA must be < AssetB`.
* Asset sort order via `Assets`/`LessThan` changes accordingly, and `NativeAsset.LessThan` no longer reports a native asset as less than another native asset.
* `NewLiquidityPoolId`, `NewLiquidityPoolDeposit`, and `NewLiquidityPoolWithdraw` validate ordering after XDR conversion, so a malformed asset now returns the conversion error rather than an ordering error ([#5978](https://github.com/stellar/go-stellar-sdk/pull/5978)).

## [11.0.0](https://github.com/stellar/go-stellar-sdk/releases/tag/horizonclient-v11.0.0) - 2023-03-29

Expand Down
5 changes: 3 additions & 2 deletions txnbuild/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ func (na NativeAsset) GetCode() string { return "" }
// GetIssuer for NativeAsset returns an empty string (XLM doesn't have an issuer).
func (na NativeAsset) GetIssuer() string { return "" }

// LessThan returns true if this asset sorts before some other asset.
func (na NativeAsset) LessThan(other Asset) bool { return true }
// LessThan returns true if this asset sorts strictly before the other. Native
// sorts before every credit asset, but not before another native asset.
func (na NativeAsset) LessThan(other Asset) bool { return !other.IsNative() }

// ToXDR for NativeAsset produces a corresponding XDR asset.
func (na NativeAsset) ToXDR() (xdr.Asset, error) {
Expand Down
9 changes: 7 additions & 2 deletions txnbuild/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,13 @@ func validateChangeTrustAsset(asset ChangeTrustAsset) error {
if err != nil {
return err
} else if assetType == AssetTypePoolShare {
// No issuer for these to validate.
return nil
// No issuer to validate, but ToXDR checks the asset pair is ordered.
params, ok := asset.GetLiquidityPoolParameters()
if !ok {
return errors.New("liquidity pool share asset has no pool parameters")
}
_, err = params.ToXDR()
return err
}

err = validateStellarPublicKey(asset.GetIssuer())
Expand Down
4 changes: 0 additions & 4 deletions txnbuild/liquidity_pool_deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ func NewLiquidityPoolDeposit(
minPrice,
maxPrice xdr.Price,
) (LiquidityPoolDeposit, error) {
if b.Asset.LessThan(a.Asset) {
return LiquidityPoolDeposit{}, errors.New("AssetA must be <= AssetB")
}

poolId, err := NewLiquidityPoolId(a.Asset, b.Asset)
if err != nil {
return LiquidityPoolDeposit{}, err
Expand Down
13 changes: 12 additions & 1 deletion txnbuild/liquidity_pool_deposit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,18 @@ func TestNewLiquidityPoolDeposit(t *testing.T) {
price.MustParse("0.3"),
price.MustParse("0.4"),
)
require.EqualError(t, err, "AssetA must be <= AssetB")
require.EqualError(t, err, "AssetA must be < AssetB")
})

t.Run("malformed asset", func(t *testing.T) {
_, err := NewLiquidityPoolDeposit(
"GB7BDSZU2Y27LYNLALKKALB52WS2IZWYBDGY6EQBLEED3TJOCVMZRH7H",
AssetAmount{CreditAsset{Code: "EUR", Issuer: "malformed"}, "0.1000000"},
AssetAmount{assetB, "0.2000000"},
price.MustParse("0.3"),
price.MustParse("0.4"),
)
require.ErrorContains(t, err, "failed to build XDR AssetA ID")
})
}

Expand Down
Loading
Loading