Skip to content

Commit

Permalink
bugfix XdrLedgerKey parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rogobete committed Jul 16, 2023
1 parent ed922d3 commit f61eef2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# [Stellar SDK for PHP](https://github.com/Soneso/stellar-php-sdk)

![v1.2.0](https://img.shields.io/badge/v1.2.0-green.svg)
![v1.2.1](https://img.shields.io/badge/v1.2.1-green.svg)

The Soneso open source Stellar SDK for PHP provides APIs to build and sign transactions, connect and query [Horizon](https://github.com/stellar/horizon).

Expand Down
2 changes: 1 addition & 1 deletion Soneso/StellarSDK/StellarSDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
class StellarSDK
{

public const VERSION_NR = "1.2.0";
public const VERSION_NR = "1.2.1";
public static string $PUBLIC_NET_HORIZON_URL = "https://horizon.stellar.org";
public static string $TEST_NET_HORIZON_URL = "https://horizon-testnet.stellar.org";
public static string $FUTURE_NET_HORIZON_URL = "https://horizon-futurenet.stellar.org";
Expand Down
4 changes: 2 additions & 2 deletions Soneso/StellarSDK/Xdr/XdrLedgerKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function encode(): string {
XdrLedgerEntryType::OFFER => $this->offer->encode(),
XdrLedgerEntryType::DATA => $this->data->encode(),
XdrLedgerEntryType::CLAIMABLE_BALANCE => $this->balanceID->encode(),
XdrLedgerEntryType::LIQUIDITY_POOL => XdrEncoder::string($this->liquidityPoolID, 64),
XdrLedgerEntryType::LIQUIDITY_POOL => XdrEncoder::opaqueFixed(hex2bin($this->liquidityPoolID), 32),
XdrLedgerEntryType::CONTRACT_DATA => $this->encodeContractData(),
XdrLedgerEntryType::CONTRACT_CODE => XdrEncoder::opaqueFixed($this->contractCodeHash, 32),
XdrLedgerEntryType::CONFIG_SETTING => $this->configSetting->encode(),
Expand Down Expand Up @@ -62,7 +62,7 @@ public static function decode(XdrBuffer $xdr) : XdrLedgerKey {
$result->balanceID = XdrClaimableBalanceID::decode($xdr);
break;
case XdrLedgerEntryType::LIQUIDITY_POOL:
$result->liquidityPoolID = $xdr->readString(64);
$result->liquidityPoolID = bin2hex($xdr->readOpaqueFixed(32));
break;
case XdrLedgerEntryType::CONTRACT_DATA:
$result->contractID = bin2hex($xdr->readOpaqueFixed(32));
Expand Down

0 comments on commit f61eef2

Please sign in to comment.