Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services/horizon: Support new CAP-21 transaction conditions #4297

Merged
merged 22 commits into from
Mar 25, 2022
Merged
Changes from 1 commit
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
Next Next commit
Add cap-21 transaction preconditions
  • Loading branch information
Paul Bellamy committed Mar 21, 2022
commit d28c2ca0195013c4fd5569ebdc1582f7fd1bb504
75 changes: 47 additions & 28 deletions protocols/horizon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,34 +499,53 @@ type Transaction struct {
// When TransactionSuccess is removed from the SDKs we can remove this HAL link
Transaction hal.Link `json:"transaction"`
} `json:"_links"`
ID string `json:"id"`
PT string `json:"paging_token"`
Successful bool `json:"successful"`
Hash string `json:"hash"`
Ledger int32 `json:"ledger"`
LedgerCloseTime time.Time `json:"created_at"`
Account string `json:"source_account"`
AccountMuxed string `json:"account_muxed,omitempty"`
AccountMuxedID uint64 `json:"account_muxed_id,omitempty,string"`
AccountSequence string `json:"source_account_sequence"`
FeeAccount string `json:"fee_account"`
FeeAccountMuxed string `json:"fee_account_muxed,omitempty"`
FeeAccountMuxedID uint64 `json:"fee_account_muxed_id,omitempty,string"`
FeeCharged int64 `json:"fee_charged,string"`
MaxFee int64 `json:"max_fee,string"`
OperationCount int32 `json:"operation_count"`
EnvelopeXdr string `json:"envelope_xdr"`
ResultXdr string `json:"result_xdr"`
ResultMetaXdr string `json:"result_meta_xdr"`
FeeMetaXdr string `json:"fee_meta_xdr"`
MemoType string `json:"memo_type"`
MemoBytes string `json:"memo_bytes,omitempty"`
Memo string `json:"memo,omitempty"`
Signatures []string `json:"signatures"`
ValidAfter string `json:"valid_after,omitempty"`
ValidBefore string `json:"valid_before,omitempty"`
FeeBumpTransaction *FeeBumpTransaction `json:"fee_bump_transaction,omitempty"`
InnerTransaction *InnerTransaction `json:"inner_transaction,omitempty"`
ID string `json:"id"`
PT string `json:"paging_token"`
Successful bool `json:"successful"`
Hash string `json:"hash"`
Ledger int32 `json:"ledger"`
LedgerCloseTime time.Time `json:"created_at"`
Account string `json:"source_account"`
AccountMuxed string `json:"account_muxed,omitempty"`
AccountMuxedID uint64 `json:"account_muxed_id,omitempty,string"`
AccountSequence string `json:"source_account_sequence"`
FeeAccount string `json:"fee_account"`
FeeAccountMuxed string `json:"fee_account_muxed,omitempty"`
FeeAccountMuxedID uint64 `json:"fee_account_muxed_id,omitempty,string"`
FeeCharged int64 `json:"fee_charged,string"`
MaxFee int64 `json:"max_fee,string"`
OperationCount int32 `json:"operation_count"`
EnvelopeXdr string `json:"envelope_xdr"`
ResultXdr string `json:"result_xdr"`
ResultMetaXdr string `json:"result_meta_xdr"`
FeeMetaXdr string `json:"fee_meta_xdr"`
MemoType string `json:"memo_type"`
MemoBytes string `json:"memo_bytes,omitempty"`
Memo string `json:"memo,omitempty"`
Signatures []string `json:"signatures"`
// Action needed in release: horizon-v3.0.0: remove valid_(after|before)
ValidAfter string `json:"valid_after,omitempty"`
ValidBefore string `json:"valid_before,omitempty"`
Preconditions TransactionPreconditions `json:"preconditions,omitempty"`
FeeBumpTransaction *FeeBumpTransaction `json:"fee_bump_transaction,omitempty"`
InnerTransaction *InnerTransaction `json:"inner_transaction,omitempty"`
}

type TransactionPreconditions struct {
Timebounds struct {
MinTime string `json:"min_time,omitempty"`
MaxTime string `json:"max_time,omitempty"`
} `json:"timebounds,omitempty"`
paulbellamy marked this conversation as resolved.
Show resolved Hide resolved
Ledgerbounds struct {
MinLedger *uint32 `json:"min_ledger,omitempty"`
MaxLedger *uint32 `json:"max_ledger,omitempty"`
} `json:"ledgerbounds,omitempty"`

MinAccountSequence string `json:"min_account_sequence,omitempty"`
MinSequenceAge string `json:"min_account_sequence_age,omitempty"`
MinSequenceLedgerGap uint32 `json:"min_account_sequence_ledger_gap,omitempty"`

Signers []string `json:"extra_signers,omitempty"`
}

// FeeBumpTransaction contains information about a fee bump transaction
Expand Down