Skip to content

Commit

Permalink
services/horizon: Expand CAP 33 integration tests and fix 500 error b…
Browse files Browse the repository at this point in the history
…ug (#3072)

* Add Sponsorhip update checks
* Expand Claimable Balance test
* Add Signer test
* Fix type for RevokeSponsorship's OfferID field, which was causing a 500 error on `/operations` due to an unmarshalling error.
  • Loading branch information
2opremio authored Sep 29, 2020
1 parent 40f821d commit 0569304
Show file tree
Hide file tree
Showing 7 changed files with 576 additions and 112 deletions.
2 changes: 1 addition & 1 deletion protocols/horizon/effects/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const (

// EffectClaimableBalanceSponsorshipRemoved occurs when the sponsorship of a claimable balance ledger entry
// is removed
EffectClaimableBalanceSponsorshipRemoved EffectType = 71 // from revoke_sponsorship
EffectClaimableBalanceSponsorshipRemoved EffectType = 71 // from claim_claimable_balance

// EffectSignerSponsorshipCreated occurs when the sponsorship of a signer is created
EffectSignerSponsorshipCreated EffectType = 72 // from set_options
Expand Down
2 changes: 1 addition & 1 deletion protocols/horizon/operations/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ type RevokeSponsorship struct {
ClaimableBalanceID *string `json:"claimable_balance_id,omitempty"`
DataAccountID *string `json:"data_account_id,omitempty"`
DataName *string `json:"data_name,omitempty"`
OfferID *string `json:"offer_id,omitempty"`
OfferID *int64 `json:"offer_id,omitempty,string"`
TrustlineAccountID *string `json:"trustline_account_id,omitempty"`
TrustlineAsset *string `json:"trustline_asset,omitempty"`
SignerAccountID *string `json:"signer_account_id,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion services/horizon/internal/db2/history/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const (

// EffectClaimableBalanceSponsorshipRemoved occurs when the sponsorship of a claimable balance ledger entry
// is removed
EffectClaimableBalanceSponsorshipRemoved EffectType = 71 // from revoke_sponsorship
EffectClaimableBalanceSponsorshipRemoved EffectType = 71 // from claim_claimable_balance

// EffectSignerSponsorshipCreated occurs when the sponsorship of a signer is created
EffectSignerSponsorshipCreated EffectType = 72 // from set_options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ func addLedgerKeyDetails(result map[string]interface{}, ledgerKey xdr.LedgerKey)
result["data_account_id"] = ledgerKey.Data.AccountId.Address()
result["data_name"] = ledgerKey.Data.DataName
case xdr.LedgerEntryTypeOffer:
result["offer_id"] = ledgerKey.Offer.OfferId
result["offer_id"] = fmt.Sprintf("%d", ledgerKey.Offer.OfferId)
case xdr.LedgerEntryTypeTrustline:
result["trustline_account_id"] = ledgerKey.TrustLine.AccountId.Address()
result["trustline_asset"] = ledgerKey.TrustLine.Asset.StringCanonical()
Expand Down
Loading

0 comments on commit 0569304

Please sign in to comment.