resourceadapter

package
v0.0.0-...-fb9541f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EffectTypeNames = map[history.EffectType]string{
	history.EffectAccountCreated:                     "account_created",
	history.EffectAccountRemoved:                     "account_removed",
	history.EffectAccountCredited:                    "account_credited",
	history.EffectAccountDebited:                     "account_debited",
	history.EffectAccountThresholdsUpdated:           "account_thresholds_updated",
	history.EffectAccountHomeDomainUpdated:           "account_home_domain_updated",
	history.EffectAccountFlagsUpdated:                "account_flags_updated",
	history.EffectAccountInflationDestinationUpdated: "account_inflation_destination_updated",
	history.EffectSignerCreated:                      "signer_created",
	history.EffectSignerRemoved:                      "signer_removed",
	history.EffectSignerUpdated:                      "signer_updated",
	history.EffectTrustlineCreated:                   "trustline_created",
	history.EffectTrustlineRemoved:                   "trustline_removed",
	history.EffectTrustlineUpdated:                   "trustline_updated",
	history.EffectTrustlineAuthorized:                "trustline_authorized",
	history.EffectTrustlineDeauthorized:              "trustline_deauthorized",
	history.EffectOfferCreated:                       "offer_created",
	history.EffectOfferRemoved:                       "offer_removed",
	history.EffectOfferUpdated:                       "offer_updated",
	history.EffectTrade:                              "trade",
	history.EffectDataCreated:                        "data_created",
	history.EffectDataRemoved:                        "data_removed",
	history.EffectDataUpdated:                        "data_updated",
	history.EffectSequenceBumped:                     "sequence_bumped",
}

Functions

func NewEffect

func NewEffect(
	ctx context.Context,
	row history.Effect,
	ledger history.Ledger,
) (result hal.Pageable, err error)

NewEffect creates a new effect resource from the provided database representation of the effect.

func NewOperation

func NewOperation(
	ctx context.Context,
	operationRow history.Operation,
	transactionRow *history.Transaction,
	ledger history.Ledger,
) (result hal.Pageable, err error)

NewOperation creates a new operation resource, finding the appropriate type to use based upon the row's type.

func PopulateAccount

func PopulateAccount(
	ctx context.Context,
	dest *protocol.Account,
	ca core.Account,
	cd []core.AccountData,
	cs []core.Signer,
	ct []core.Trustline,
) error

PopulateAccount fills out the resource's fields

func PopulateAccountEntry

func PopulateAccountEntry(
	ctx context.Context,
	dest *protocol.Account,
	account history.AccountEntry,
	accountData []history.Data,
	accountSigners []history.AccountSigner,
	trustLines []history.TrustLine,
) error

PopulateAccountEntry fills out the resource's fields

func PopulateAccountFlags

func PopulateAccountFlags(dest *protocol.AccountFlags, row core.Account)

func PopulateAccountSigner

func PopulateAccountSigner(
	ctx context.Context,
	dest *protocol.AccountSigner,
	has history.AccountSigner,
)

PopulateAccountSigner fills out the resource's fields

func PopulateAccountThresholds

func PopulateAccountThresholds(dest *protocol.AccountThresholds, row core.Account)

func PopulateAsset

func PopulateAsset(ctx context.Context, dest *protocol.Asset, asset xdr.Asset) error

func PopulateAssetStat

func PopulateAssetStat(
	ctx context.Context,
	res *protocol.AssetStat,
	row assets.AssetStatsR,
) (err error)

PopulateAssetStat fills out the details func PopulateAssetStat(

func PopulateBalance

func PopulateBalance(dest *protocol.Balance, row core.Trustline) (err error)

func PopulateBaseEffect

func PopulateBaseEffect(ctx context.Context, this *effects.Base, row history.Effect, ledger history.Ledger)

Populate loads this resource from `row`

func PopulateBaseOperation

func PopulateBaseOperation(
	ctx context.Context,
	dest *operations.Base,
	operationRow history.Operation,
	transactionRow *history.Transaction,
	ledger history.Ledger,
)

Populate fills out this resource using `row` as the source.

func PopulateExpAssetStat

func PopulateExpAssetStat(
	ctx context.Context,
	res *protocol.AssetStat,
	row history.ExpAssetStat,
	issuer history.AccountEntry,
) (err error)

PopulateExpAssetStat populates an AssetStat using asset stats and account entries generated from the experimental ingestion system. PopulateAssetStat() is similar except it uses asset stats rows from the legacy ingestion system

func PopulateHistoryBalance

func PopulateHistoryBalance(dest *protocol.Balance, row history.TrustLine) (err error)

func PopulateHistoryOffer

func PopulateHistoryOffer(ctx context.Context, dest *protocol.Offer, row history.Offer, ledger *history.Ledger)

PopulateHistoryOffer constructs an offer response struct from an offer row extracted from the the horizon offers table. Note that the only difference between PopulateHistoryOffer and PopulateOffer is that PopulateHistoryOffer takes an offer row from the horizon database whereas PopulateOffer takes an offer row from the paydex core database. Once the experimental horizon ingestion system is fully rolled out there will be no need to query offers from the paydex core database and we will be able to remove PopulateOffer

func PopulateLedger

func PopulateLedger(ctx context.Context, dest *protocol.Ledger, row history.Ledger)

func PopulateMasterSigner

func PopulateMasterSigner(dest *protocol.Signer, row core.Account)

PopulateMasterSigner fills out the fields of the signer, using a paydex account to provide the data.

func PopulateNativeBalance

func PopulateNativeBalance(dest *protocol.Balance, stroops, buyingLiabilities, sellingLiabilities xdr.Int64) (err error)

func PopulateOffer

func PopulateOffer(ctx context.Context, dest *protocol.Offer, row core.Offer, ledger *history.Ledger)

func PopulateOrderBookSummary

func PopulateOrderBookSummary(
	ctx context.Context,
	dest *protocol.OrderBookSummary,
	selling xdr.Asset,
	buying xdr.Asset,
	row core.OrderBookSummary,
) error

func PopulatePath

func PopulatePath(ctx context.Context, dest *horizon.Path, p paths.Path) (err error)

PopulatePath converts the paths.Path into a Path

func PopulateRoot

func PopulateRoot(
	ctx context.Context,
	dest *horizon.Root,
	ledgerState ledger.State,
	hVersion, cVersion string,
	passphrase string,
	currentProtocolVersion int32,
	coreSupportedProtocolVersion int32,
	friendBotURL *url.URL,
	experimentalIngestionEnabled bool,
	templates map[string]string,
)

Populate fills in the details

func PopulateSigner

func PopulateSigner(ctx context.Context, dest *protocol.Signer, row core.Signer)

Populate fills out the fields of the signer, using one of an account's secondary signers.

func PopulateTrade

func PopulateTrade(
	ctx context.Context,
	dest *protocol.Trade,
	row history.Trade,
)

Populate fills out the details of a trade using a row from the history_trades table.

func PopulateTradeAggregation

func PopulateTradeAggregation(
	ctx context.Context,
	dest *protocol.TradeAggregation,
	row history.TradeAggregation,
) error

Populate fills out the details of a trade using a row from the history_trades table.

func PopulateTransaction

func PopulateTransaction(
	ctx context.Context,
	dest *protocol.Transaction,
	row history.Transaction,
)

Populate fills out the details

func PopulateTransactionResultCodes

func PopulateTransactionResultCodes(ctx context.Context,
	dest *protocol.TransactionResultCodes,
	fail *txsub.FailedTransactionError,
) (err error)

Populate fills out the details

func PopulateTransactionSuccess

func PopulateTransactionSuccess(ctx context.Context, dest *protocol.TransactionSuccess, result txsub.Result)

Populate fills out the details

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL