Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
fb9f26f
5434/p23 xdr update (#5581)
urvisavla Jan 29, 2025
f18e42e
historyarchive: Update bucket list hash validation for protocol 23 (#…
tamirms Feb 11, 2025
9ad4cdc
ingest: Add support for ledger entry change type "restore" for Protoc…
urvisavla Feb 18, 2025
fe9b5ec
Merge branch 'master' into protocol-23
Shaptic Feb 19, 2025
c975765
services/horizon: Update asset stats processor to ingest new restorat…
tamirms Feb 27, 2025
d2141e8
ingest: Add support for CAP-63 (#5615)
tamirms Feb 27, 2025
b7b0b5e
clients: Update Stellar Core client to latest state archival API (#5608)
Shaptic Feb 27, 2025
f6d74a7
services/horizon/internal/ingest/processors: Fix ingestContractAssetB…
tamirms Mar 3, 2025
413fe10
ingest: Update ingestion library and horizon to adapt to protocol 23 …
tamirms Mar 17, 2025
b5c1291
Remove support for stellar core in-memory mode (#5627)
urvisavla Mar 21, 2025
2ffb516
Merge remote-tracking branch 'upstream/master' into protocol-23
tamirms May 7, 2025
e88802c
Merge pull request #5689 from tamirms/protocol-23
tamirms May 8, 2025
349e477
Update XDR definitions for protocol 23 (#5694)
tamirms May 20, 2025
5165a70
Bump stellar-core to 23.0.0.rc1 for galexie (#5702)
urvisavla May 20, 2025
4d12317
Galexie: Skip publishing docker image with latest tag for RC builds (…
urvisavla May 21, 2025
651093e
Merge remote-tracking branch 'origin/master' into protocol-23
karthikiyer56 May 21, 2025
951a614
Fix failing test in ttp
karthikiyer56 May 21, 2025
d7251be
protocols: Update Stellar Core's `getledgerentry` endpoint schema (#5…
Shaptic May 21, 2025
95bbd97
Fix remainder of merge conflicts
karthikiyer56 May 21, 2025
2a77a34
Galexie shud have the latest Rc23 image
karthikiyer56 May 21, 2025
43708bf
Update core binary to v23 rc (#5701)
tamirms May 21, 2025
8e1a3f1
Merge remote-tracking branch 'origin/protocol-23' into karthik/2023-0…
karthikiyer56 May 21, 2025
46a3ae3
update stellar core version for veridy_range in horizon.ymml to point…
karthikiyer56 May 21, 2025
d0335c8
change verify range to use jammy instead of focal
karthikiyer56 May 21, 2025
17fd7aa
Merge pull request #5706 from stellar/karthik/2023-0-21/merge-master-…
karthikiyer56 May 21, 2025
53d703e
Add EMIT_CLASSIC_EVENTS and BACKFILL_STELLAR_ASSET_EVENTS flags
chowbao May 22, 2025
6e0530d
Karthik/p23 sac event support (#5710)
karthikiyer56 May 28, 2025
b121493
Add support for accelerating eviction in integration tests (#5716)
tamirms May 30, 2025
a335381
Make provision to add destination_muxed_id in the output for the oper…
karthikiyer56 May 30, 2025
f7e9089
Protocol 23 integration (#5717)
urvisavla Jun 12, 2025
5e0024b
port latest master to protocol-23 (#5724)
sreuland Jun 14, 2025
0e5de3e
Karthik/ttp for p23 events (#5721)
karthikiyer56 Jun 17, 2025
fd9af65
services/horizon: protocol 23 state archival/eviction integration tes…
urvisavla Jun 17, 2025
befe76e
services/horizon/internal/integration: Add more eviction integration …
tamirms Jun 18, 2025
33a1f13
Fix the version check for BACKFILL_RESTORE_META flag to use the proto…
urvisavla Jun 18, 2025
deaa3c3
Add opt-in for unified events when Core supports >= Protocol 23 (#5723)
Shaptic Jun 18, 2025
25aad89
Relax ttl invariant in AssetStatsProcessor (#5733)
tamirms Jun 20, 2025
85c1c46
services/horizon: Update CHANGELOG
urvisavla Jun 18, 2025
cb720d5
remove deprecated errorResultXdr from async transaction response (#5737)
tamirms Jun 25, 2025
db7908b
services/horizon: Fix ingestion of restored SAC instances (#5735)
tamirms Jun 27, 2025
ff55353
Add support for muxed information from contractEvents to show up in o…
karthikiyer56 Jul 1, 2025
8ba30fd
Update changelog for protocol 23 release (#5742)
tamirms Jul 2, 2025
81639f3
Merge remote-tracking branch 'upstream/master' into port_master_to23
sreuland Jul 3, 2025
1f08a68
update core ref to p23 build in ci for verify-range
sreuland Jul 3, 2025
bbd00d0
#5741: temp fix on branches used to test verify-range image in ci step
sreuland Jul 3, 2025
e3e7ed0
Merge pull request #5743 from sreuland/port_master_to23
sreuland Jul 3, 2025
9dc3ac3
Add logic for muxed info in effects processor (#5744)
karthikiyer56 Jul 7, 2025
11de2b4
services/horizon/internal/integration: Update load tests to work with…
tamirms Jul 8, 2025
ae9e310
services/horizon/internal/db2/schema: Replace brin index on trade agg…
tamirms Jul 8, 2025
fd5d4ff
Merge branch 'master' into merge-upstream
Shaptic Jul 14, 2025
619d129
Merge upstream `master` into `protocol-23`
Shaptic Jul 15, 2025
d70ce3d
Merge branch 'master' into merge-master
urvisavla Jul 15, 2025
a558bf9
Merge pull request #5753 from urvisavla/merge-master
urvisavla Jul 15, 2025
1b3be72
services/horizon: Add robustness to checks for the existence of an ef…
Shaptic Jul 15, 2025
e39e256
.github/workflows: Update integration tests with stellar-core rc4 ver…
tamirms Jul 16, 2025
01d16bf
#5719: added EmitVerboseMeta to CaptiveCoreTomlParams (#5759)
sreuland Jul 16, 2025
b9a8f82
set stellar-core binary path in the params. It is used to determine t…
urvisavla Jul 26, 2025
8c5b745
services/horizon/internal/integration: Add extra state archival integ…
tamirms Jul 29, 2025
f4dc820
Include muxed info for the case where sender and receiver are both th…
karthikiyer56 Jul 31, 2025
45f1c58
Use 23.0.0-2621.rc5.d8e968030.focal in integration tests (#5772)
tamirms Aug 5, 2025
8bf8767
ingest/loadtest: Fix ledger entries contained in synthetic ledgers (#…
tamirms Aug 5, 2025
5b6dacb
Add support for EMIT_VERBOSE_META cmdline boolean flag in horizon and…
karthikiyer56 Aug 8, 2025
71e7923
services/horizon: Use latest stellar-core v23 release in integration …
tamirms Aug 8, 2025
9c9fc15
Horizon changelog (#5778)
karthikiyer56 Aug 9, 2025
b72ff09
ingest/loadtest: various ingestion load test improvements (#5781)
tamirms Aug 12, 2025
2cc5db3
Merge remote-tracking branch 'origin/protocol-23'
karthikiyer56 Aug 12, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/galexie-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
GALEXIE_INTEGRATION_TESTS_ENABLED: "true"
GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core
# this pins to a version of quickstart:testing that has the same version as STELLAR_CORE_VERSION
# this is the multi-arch index sha, get it by 'docker buildx imagetools inspect stellar/quickstart:testing'
GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE: docker.io/stellar/quickstart:testing@sha256:5333ec87069efd7bb61f6654a801dc093bf0aad91f43a5ba84806d3efe4a6322
# this is the multi-arch index sha, get it by 'docker buildx imagetools inspect stellar/quickstart:future'
GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE: docker.io/stellar/quickstart:future@sha256:ea7f4dd4c8e1dc4eb69194ef5b9659aa73e08a89146ea80acfc2fdc073fffb32
GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL: "false"
GALEXIE_INTEGRATION_TESTS_LOCALSTACK_IMAGE_TAG: "4.6.0"
GALEXIE_INTEGRATION_TESTS_LOCALSTACK_IMAGE_PULL: "false"
STELLAR_CORE_VERSION: 22.3.0-2485.e643061a4.focal
STELLAR_CORE_VERSION: 23.0.0-2634.d5cbc0793.focal
steps:
- name: Set VERSION
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/galexie.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
matrix:
storage_type: [ GCS, S3 ]
env:
CAPTIVE_CORE_DEBIAN_PKG_VERSION: 22.3.0-2485.e643061a4.focal
CAPTIVE_CORE_DEBIAN_PKG_VERSION: 23.0.0-2634.d5cbc0793.focal
GALEXIE_INTEGRATION_TESTS_ENABLED: "true"
GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core
# this pins to a version of quickstart:testing that has the same version as GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN
# this is the multi-arch index sha, get it by 'docker buildx imagetools inspect stellar/quickstart:testing'
GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE: docker.io/stellar/quickstart:testing@sha256:5333ec87069efd7bb61f6654a801dc093bf0aad91f43a5ba84806d3efe4a6322
# this is the multi-arch index sha, get it by 'docker buildx imagetools inspect stellar/quickstart:future'
GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE: docker.io/stellar/quickstart:future@sha256:ea7f4dd4c8e1dc4eb69194ef5b9659aa73e08a89146ea80acfc2fdc073fffb32
GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL: "false"
GALEXIE_INTEGRATION_TESTS_LOCALSTACK_IMAGE_TAG: "4.6.0"
GALEXIE_INTEGRATION_TESTS_LOCALSTACK_IMAGE_PULL: "false"
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,4 @@ jobs:
args: -v --issues-exit-code=0 --config=.golangci.yml # exit without errors for now - won't fail the build
github-token: ${{ secrets.GITHUB_TOKEN }}
only-new-issues: true




continue-on-error: true
28 changes: 17 additions & 11 deletions .github/workflows/horizon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
matrix:
os: [ubuntu-22.04]
go: ["1.22", "1.23"]
pg: [12, 16]
protocol-version: [22]
pg: [14, 16]
protocol-version: [22,23]
runs-on: ${{ matrix.os }}
services:
postgres:
Expand All @@ -32,10 +32,12 @@ jobs:
env:
HORIZON_INTEGRATION_TESTS_ENABLED: true
HORIZON_INTEGRATION_TESTS_CORE_MAX_SUPPORTED_PROTOCOL: ${{ matrix.protocol-version }}
HORIZON_INTEGRATION_TESTS_CAPTIVE_CORE_USE_DB: true
PROTOCOL_22_CORE_DEBIAN_PKG_VERSION: 22.3.0-2485.e643061a4.focal
PROTOCOL_22_CORE_DOCKER_IMG: stellar/stellar-core:22.3.0-2485.e643061a4.focal
PROTOCOL_22_STELLAR_RPC_DOCKER_IMG: stellar/stellar-rpc:22.1.2
PROTOCOL_22_CORE_DEBIAN_PKG_VERSION: 23.0.0-2634.d5cbc0793.focal
PROTOCOL_22_CORE_DOCKER_IMG: stellar/unsafe-stellar-core:23.0.0-2634.d5cbc0793.focal
PROTOCOL_22_STELLAR_RPC_DOCKER_IMG: stellar/stellar-rpc:23.0.0-rc2-126
PROTOCOL_23_CORE_DEBIAN_PKG_VERSION: 23.0.0-2634.d5cbc0793.focal
PROTOCOL_23_CORE_DOCKER_IMG: stellar/unsafe-stellar-core:23.0.0-2634.d5cbc0793.focal
PROTOCOL_23_STELLAR_RPC_DOCKER_IMG: stellar/stellar-rpc:23.0.0-rc2-126
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
Expand Down Expand Up @@ -79,8 +81,8 @@ jobs:
- name: Install core
run: |
# Workaround for https://github.com/actions/virtual-environments/issues/5245,
# libc++1-8 won't be installed if another version is installed (but apt won't give you a helpul
# message about why the installation fails)
# libc++1-8 won't be installed if another version is installed (but
# apt won't give you a helpul message about why the installation fails)
sudo apt list --installed | grep libc++
sudo apt-get remove -y libc++1-* libc++abi1-* || true

Expand All @@ -98,7 +100,7 @@ jobs:
- name: Calculate the source hash
id: calculate_source_hash
run: |
combined_hash=$(echo "horizon-hash-${{ hashFiles('./horizon') }}-${{ hashFiles('./clients/horizonclient/**') }}-${{ hashFiles('./protocols/horizon/**') }}-${{ hashFiles('./txnbuild/**') }}-${{ hashFiles('./ingest/**') }}-${{ hashFiles('./xdr/**') }}-${{ hashFiles('./services/**') }}-${{ env.PROTOCOL_21_CORE_DOCKER_IMG }}-${{ env.PROTOCOL_21_RPC_DOCKER_IMG }}-${{ env.PROTOCOL_21_CORE_DEBIAN_PKG_VERSION }}-${{ env.PREFIX }}" | sha256sum | cut -d ' ' -f 1)
combined_hash=$(echo "horizon-hash-${{ hashFiles('./horizon') }}-${{ hashFiles('./clients/horizonclient/**') }}-${{ hashFiles('./protocols/horizon/**') }}-${{ hashFiles('./txnbuild/**') }}-${{ hashFiles('./ingest/**') }}-${{ hashFiles('./xdr/**') }}-${{ hashFiles('./services/**') }}-${{ env.PROTOCOL_23_CORE_DOCKER_IMG }}-${{ env.PROTOCOL_23_RPC_DOCKER_IMG }}-${{ env.PROTOCOL_23_CORE_DEBIAN_PKG_VERSION }}-${{ env.PREFIX }}" | sha256sum | cut -d ' ' -f 1)
echo "COMBINED_SOURCE_HASH=$combined_hash" >> "$GITHUB_ENV"

- name: Restore Horizon binary and integration tests source hash to cache
Expand All @@ -124,7 +126,7 @@ jobs:
runs-on: ubuntu-22.04
env:
GO_VERSION: 1.23.4
STELLAR_CORE_VERSION: 22.3.0-2485.e643061a4.jammy
STELLAR_CORE_VERSION: 23.0.0-2634.d5cbc0793.jammy
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -135,7 +137,11 @@ jobs:
run: |
docker build --build-arg="GO_VERSION=$GO_VERSION" --build-arg="STELLAR_CORE_VERSION=$STELLAR_CORE_VERSION" -f services/horizon/docker/verify-range/Dockerfile -t stellar/horizon-verify-range services/horizon/docker/verify-range/
# Any range should do for basic testing, this range was chosen pretty early in history so that it only takes a few mins to run
docker run -e BRANCH=$(git rev-parse HEAD) -e FROM=10000063 -e TO=10000127 stellar/horizon-verify-range
# TODO - remove the BASE_BRANCH override once protocol-23 merges to master,
# this is fine while protocol-23 branch is active.
# reason - master can't be used becaue the p23 version of core won't accept the same toml config params.
# this is still effective at least to confirm verify-range image works. it just doesn't do the compare from master.
docker run -e BASE_BRANCH=$(git rev-parse HEAD) -e BRANCH=$(git rev-parse HEAD) -e FROM=10000063 -e TO=10000127 stellar/horizon-verify-range

# Push image
- if: github.ref == 'refs/heads/master'
Expand Down
17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docker build targets use an optional "TAG" environment
# variable can be set to use custom tag name. For example:
# TAG=my-registry.example.com/keystore:dev make keystore
DOWNLOADABLE_XDRS = xdr/Stellar-SCP.x \
XDRS = xdr/Stellar-SCP.x \
xdr/Stellar-ledger-entries.x \
xdr/Stellar-ledger.x \
xdr/Stellar-overlay.x \
Expand All @@ -12,13 +12,12 @@ xdr/Stellar-contract-meta.x \
xdr/Stellar-contract-spec.x \
xdr/Stellar-contract.x \
xdr/Stellar-internal.x \
xdr/Stellar-contract-config-setting.x
xdr/Stellar-contract-config-setting.x \
xdr/Stellar-exporter.x

XDRS = $(DOWNLOADABLE_XDRS) xdr/Stellar-exporter.x


XDRGEN_COMMIT=e2cac557162d99b12ae73b846cf3d5bfe16636de
XDR_COMMIT=529d5176f24c73eeccfa5eba481d4e89c19b1181
XDRGEN_COMMIT=af107f07237a15fcf5f9aea71b2bebfcc1113b45
XDR_COMMIT=4b7a2ef7931ab2ca2499be68d849f38190b443ca

.PHONY: xdr xdr-clean xdr-update

Expand Down Expand Up @@ -46,15 +45,15 @@ recoverysigner:
regulated-assets-approval-server:
$(MAKE) -C services/regulated-assets-approval-server/ docker-build

gxdr/xdr_generated.go: $(DOWNLOADABLE_XDRS)
gxdr/xdr_generated.go: $(XDRS)
go run github.com/xdrpp/goxdr/cmd/goxdr -p gxdr -enum-comments -o $@ $(XDRS)
gofmt -s -w $@

xdr/%.x:
printf "%s" ${XDR_COMMIT} > xdr/xdr_commit_generated.txt
curl -Lsf -o $@ https://raw.githubusercontent.com/stellar/stellar-xdr/$(XDR_COMMIT)/$(@F)

xdr/xdr_generated.go: $(DOWNLOADABLE_XDRS)
xdr/xdr_generated.go: $(XDRS)
docker run -it --rm -v $$PWD:/wd -w /wd ruby /bin/bash -c '\
gem install specific_install -v 0.3.8 && \
gem specific_install https://github.com/stellar/xdrgen.git -b $(XDRGEN_COMMIT) && \
Expand All @@ -70,7 +69,7 @@ xdr/xdr_generated.go: $(DOWNLOADABLE_XDRS)
xdr: gxdr/xdr_generated.go xdr/xdr_generated.go

xdr-clean:
rm $(DOWNLOADABLE_XDRS) || true
rm $(XDRS) || true

xdr-update: xdr-clean xdr

Expand Down
18 changes: 12 additions & 6 deletions clients/stellarcore/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ type GenSorobanConfig struct {
BaseSeqNum uint32
NetworkPassphrase string
SigningKey *keypair.Full
// looks for `stellar-core` in the system PATH if empty
StellarCorePath string
StellarCoreImage string
}

func GenSorobanConfigUpgradeTxAndKey(
Expand All @@ -96,11 +95,18 @@ func GenSorobanConfigUpgradeTxAndKey(
if err != nil {
return nil, xdr.ConfigUpgradeSetKey{}, err
}
corePath := config.StellarCorePath
if corePath == "" {
corePath = "stellar-core"

cmd := exec.Command("docker", "pull", config.StellarCoreImage)
_, err = cmd.Output()
if err != nil {
return nil, xdr.ConfigUpgradeSetKey{}, err
}
cmd := exec.Command(corePath, "get-settings-upgrade-txs",

cmd = exec.Command("docker",
"run",
"-i",
config.StellarCoreImage,
"get-settings-upgrade-txs",
config.SigningKey.Address(),
strconv.FormatUint(uint64(config.BaseSeqNum), 10),
config.NetworkPassphrase,
Expand Down
84 changes: 56 additions & 28 deletions clients/stellarcore/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package stellarcore

import (
"context"
"crypto/rand"
"fmt"
"io"
"net/http"
"net/url"
"os"
"os/exec"
"testing"

"github.com/jarcoal/httpmock"
Expand Down Expand Up @@ -143,24 +142,54 @@ func TestGetLedgerEntries(t *testing.T) {
hmock := httptest.NewClient()
c := &Client{HTTP: hmock, URL: "http://localhost:11626"}

var hash xdr.ContractId
_, err := rand.Read(hash[:])
require.NoError(t, err)

tr, err := xdr.NewScVal(xdr.ScValTypeScvBool, true)
require.NoError(t, err)
fl, err := xdr.NewScVal(xdr.ScValTypeScvBool, false)
require.NoError(t, err)

rawEntry := xdr.ContractDataEntry{
Ext: xdr.ExtensionPoint{},
Contract: xdr.ScAddress{Type: xdr.ScAddressTypeScAddressTypeContract, ContractId: &hash},
Key: tr,
Durability: xdr.ContractDataDurabilityPersistent,
Val: fl,
}
entry := xdr.LedgerEntry{
LastModifiedLedgerSeq: 1210,
Data: xdr.LedgerEntryData{
Type: xdr.LedgerEntryTypeContractData,
ContractData: &rawEntry,
},
}
entryB64, err := xdr.MarshalBase64(entry)
require.NoError(t, err)

var key xdr.LedgerKey
acc, err := xdr.AddressToAccountId(keypair.MustRandom().Address())
require.NoError(t, err)
key.SetAccount(acc)
keyB64, err := key.MarshalBinaryBase64()
require.NoError(t, err)

// build a fake response body
mockResp := proto.GetLedgerEntryResponse{
Ledger: 1215, // checkpoint align on expected request
Entries: []proto.LedgerEntryResponse{{
Entry: "pretend this is XDR lol",
State: "live",
Ttl: 1234,
Entry: entryB64,
State: "live",
LiveUntilLedgerSeq: 1234,
}, {
Entry: "pretend this is another XDR lol",
Entry: entryB64,
State: "archived",
}, {
State: "new",
}},
}

var key xdr.LedgerKey
acc, err := xdr.AddressToAccountId(keypair.MustRandom().Address())
require.NoError(t, err)
key.SetAccount(acc)

// happy path - fetch an entry
ce := hmock.On("POST", "http://localhost:11626/getledgerentry")
hmock.RegisterResponder(
Expand All @@ -171,9 +200,11 @@ func TestGetLedgerEntries(t *testing.T) {
requestData, ierr := io.ReadAll(r.Body)
require.NoError(t, ierr)

keyB64, ierr := key.MarshalBinaryBase64()
require.NoError(t, ierr)
expected := fmt.Sprintf("key=%s&ledgerSeq=1234", url.QueryEscape(keyB64))
expected := fmt.Sprintf(
"key=%s&key=%s&key=%s&ledgerSeq=1234",
url.QueryEscape(keyB64),
url.QueryEscape(keyB64),
url.QueryEscape(keyB64))
require.Equal(t, expected, string(requestData))

resp, ierr := httpmock.NewJsonResponse(http.StatusOK, &mockResp)
Expand All @@ -182,39 +213,36 @@ func TestGetLedgerEntries(t *testing.T) {
return resp, nil
})

resp, err := c.GetLedgerEntries(context.Background(), 1234, key)
resp, err := c.GetLedgerEntries(context.Background(), 1234, key, key, key)
require.NoError(t, err)
require.NotNil(t, resp)

require.EqualValues(t, 1215, resp.Ledger)
require.Len(t, resp.Entries, 2)
require.Equal(t, "pretend this is XDR lol", resp.Entries[0].Entry)
require.Equal(t, "pretend this is another XDR lol", resp.Entries[1].Entry)
require.EqualValues(t, 1234, resp.Entries[0].Ttl)
require.Len(t, resp.Entries, 3)
require.Equal(t, entryB64, resp.Entries[0].Entry)
require.Equal(t, entryB64, resp.Entries[1].Entry)
require.Empty(t, resp.Entries[2].Entry)
require.EqualValues(t, 1234, resp.Entries[0].LiveUntilLedgerSeq)
require.EqualValues(t, 0, resp.Entries[1].LiveUntilLedgerSeq)
require.EqualValues(t, 0, resp.Entries[2].LiveUntilLedgerSeq)
require.EqualValues(t, "live", resp.Entries[0].State)
require.EqualValues(t, "archived", resp.Entries[1].State)
require.EqualValues(t, "new", resp.Entries[2].State)

// TTL keys aren't returned
key.Type = xdr.LedgerEntryTypeTtl
_, err = c.GetLedgerEntries(context.Background(), 1234, key)
require.Error(t, err)
}

func TestGenSorobanConfigUpgradeTxAndKey(t *testing.T) {
coreBinary := os.Getenv("STELLAR_CORE_BINARY_PATH")
if coreBinary == "" {
var err error
coreBinary, err = exec.LookPath("stellar-core")
if err != nil {
t.Skip("couldn't find stellar core binary")
}
}
key, err := keypair.ParseFull("SB6VZS57IY25334Y6F6SPGFUNESWS7D2OSJHKDPIZ354BK3FN5GBTS6V")
require.NoError(t, err)
funcConfig := GenSorobanConfig{
BaseSeqNum: 1,
NetworkPassphrase: network.TestNetworkPassphrase,
SigningKey: key,
StellarCorePath: coreBinary,
StellarCoreImage: "stellar/stellar-core:22",
}
config := xdr.ConfigUpgradeSet{
UpdatedEntry: []xdr.ConfigSettingEntry{
Expand Down
8 changes: 7 additions & 1 deletion gxdr/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ func Dump(v goxdr.XdrType) []byte {
var buf bytes.Buffer
writer := goxdr.XdrOut{Out: &buf}
writer.Marshal("", v)
return buf.Bytes()
output := buf.Bytes()
buf.Reset()
return output
}

func Parse(val goxdr.XdrType, in []byte) {
val.XdrMarshal(&goxdr.XdrIn{bytes.NewReader(in)}, "")
}

// Convert serializes the given goxdr value into another destination value
Expand Down
Loading
Loading