@@ -31,38 +31,26 @@ type LedgerTransactionReader interface {
31
31
// Archive here only has the methods LightHorizon cares about, to make caching/wrapping easier
32
32
type Archive interface {
33
33
34
- //GetLedger - retreive a ledger's meta data
35
- //
36
- //ctx - the caller's request context
37
- //ledgerCloseMeta - the sequence number of ledger to fetch
38
- //
39
- //returns error or meta data for requested ledger
34
+ // GetLedger - takes a caller context and a sequence number and returns the meta data
35
+ // for the ledger corresponding to the sequence number. If there is any error, it will
36
+ // return nil and the error.
40
37
GetLedger (ctx context.Context , sequence uint32 ) (xdr.LedgerCloseMeta , error )
41
38
42
- // Close - releases any resources used for this archive instance.
39
+ // Close - will release any resources used for this archive instance and should be
40
+ // called at end of usage of archive.
43
41
Close () error
44
42
45
- // NewLedgerTransactionReaderFromLedgerCloseMeta - get a reader for ledger meta data
46
- //
47
- // networkPassphrase - the network passphrase
48
- // ledgerCloseMeta - the meta data for a ledger
49
- //
50
- // returns error or LedgerTransactionReader
43
+ // NewLedgerTransactionReaderFromLedgerCloseMeta - takes the passphrase for the blockchain network
44
+ // and the LedgerCloseMeta(meta data) and returns a reader that can be used to obtain a LedgerTransaction model
45
+ // from the meta data. If there is any error, it will return nil and the error.
51
46
NewLedgerTransactionReaderFromLedgerCloseMeta (networkPassphrase string , ledgerCloseMeta xdr.LedgerCloseMeta ) (LedgerTransactionReader , error )
52
47
53
- // GetTransactionParticipants - get set of all participants(accounts) in a transaction
54
- //
55
- // transaction - the ledger transaction
56
- //
57
- // returns error or map with keys of participant account id's and value of empty struct
48
+ // GetTransactionParticipants - takes a LedgerTransaction and returns a set of all
49
+ // participants(accounts) in the transaction. If there is any error, it will return nil and the error.
58
50
GetTransactionParticipants (transaction LedgerTransaction ) (map [string ]struct {}, error )
59
51
60
- // GetOperationParticipants - get set of all participants(accounts) in a operation
61
- //
62
- // transaction - the ledger transaction
63
- // operation - the operation within this transaction
64
- // opIndex - the 0 based index of the operation within the transaction
65
- //
66
- // returns error or map with keys of participant account id's and value of empty struct
52
+ // GetOperationParticipants - takes a LedgerTransaction, the Operation within the transaction, and
53
+ // the 0 based index of the operation within the transaction. It will return a set of all participants(accounts)
54
+ // in the operation. If there is any error, it will return nil and the error.
67
55
GetOperationParticipants (transaction LedgerTransaction , operation xdr.Operation , opIndex int ) (map [string ]struct {}, error )
68
56
}
0 commit comments