dbtest

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TST = token.Type("TST")
	ABC = token.Type("ABC")
)

Variables

View Source
var IdentityCases = []struct {
	Name string
	Fn   func(*testing.T, driver.IdentityStore)
}{
	{"IdentityInfo", TIdentityInfo},
	{"SignerInfo", TSignerInfo},
	{"Configurations", TConfigurations},
	{"GetConfiguration", TGetConfiguration},
	{"SignerInfoConcurrent", TSignerInfoConcurrent},
	{"GetExistingSignerInfo", TGetExistingSignerInfo},
	{"RegisterIdentityDescriptor", TRegisterIdentityDescriptor},
}
View Source
var IdentityNotificationCases = []struct {
	Name string
	Fn   func(*testing.T, driver.IdentityStore)
}{
	{"IdentityNotifier", TIdentityNotifier},
}
View Source
var KeyStoreCases = []struct {
	Name string
	Fn   func(*testing.T, driver.KeyStore)
}{
	{"TKeyStoreAddGet", TKeyStoreAddGet},
}
View Source
var TokenNotifierCases = []struct {
	Name string
	Fn   func(*testing.T, TestTokenDB, driver.TokenNotifier)
}{
	{"TokenNotifier", TTokenNotifier},
	{"SubscribeStore", TSubscribeStore},
	{"SubscribeStoreDelete", TSubscribeStoreDelete},
	{"SubscribeStoreNoCommit", TSubscribeStoreNoCommit},
	{"SubscribeRead", TSubscribeRead},
}

Functions

func EValidationRecordQueries

func EValidationRecordQueries(t *testing.T, db driver3.EndorserStore)

func EndorserTest

func EndorserTest(t *testing.T, cfgProvider cfgProvider)

func IdentityTest

func IdentityTest(t *testing.T, cfgProvider cfgProvider)

func KeyStoreTest

func KeyStoreTest(t *testing.T, cfgProvider cfgProvider)

func TAllowsSameTxID

func TAllowsSameTxID(t *testing.T, db driver3.TokenTransactionStore)

func TCertification

func TCertification(t *testing.T, db TestTokenDB)

func TConfigurations

func TConfigurations(t *testing.T, db driver.IdentityStore)

func TDeleteAndMine

func TDeleteAndMine(t *testing.T, db TestTokenDB)

func TDeleteMultiple

func TDeleteMultiple(t *testing.T, db TestTokenDB)

func TEndorserAcks

func TEndorserAcks(t *testing.T, db driver3.TokenTransactionStore)

func TFailsIfRequestDoesNotExist

func TFailsIfRequestDoesNotExist(t *testing.T, db driver3.TokenTransactionStore)

func TGetConfID added in v0.15.1

TGetConfID asserts that GetConfID round-trips the confID passed to StoreIdentity for a given identity, regardless of which role it was bound under, and returns an empty string with no error for an identity that was never bound. This is the read side that SignerRouter relies on to pin a signer to exactly one KeyManager without probing every KeyManager registered under the identity's type.

func TGetConfiguration

func TGetConfiguration(t *testing.T, db driver.IdentityStore)

func TGetDeletedTokensPendingSKICleanup

func TGetDeletedTokensPendingSKICleanup(t *testing.T, db TestTokenDB)

func TGetExistingSignerInfo added in v0.15.1

func TGetExistingSignerInfo(t *testing.T, db driver.IdentityStore)

TGetExistingSignerInfo checks that GetExistingSignerInfo returns the hashes of exactly the identities for which signer info was stored, when queried with a mix of known and unknown identities.

func TGetTokenInfos

func TGetTokenInfos(t *testing.T, db TestTokenDB)

GetTokenMetadata retrieves the token information for the passed ids. For each id, the callback is invoked to unmarshal the token information

func TIdentityInfo

func TIdentityInfo(t *testing.T, db driver.IdentityStore)

func TIdentityNotifier

func TIdentityNotifier(t *testing.T, db driver.IdentityStore)

func TIssuerBalance added in v0.15.1

func TIssuerBalance(t *testing.T, db TestTokenDB)

TIssuerBalance verifies that IssuedBalance and RedeemedBalance sum the amounts of the issued and redeemed tokens respectively, honoring the token type filter, and that a redeemed token (empty owner) can be stored and is excluded from the issued balance.

func TKeyStoreAddGet

func TKeyStoreAddGet(t *testing.T, db driver.KeyStore)

func TListAuditTokens

func TListAuditTokens(t *testing.T, db TestTokenDB)

// ListAuditTokens returns the audited tokens associated to the passed ids

func TListIssuedTokens

func TListIssuedTokens(t *testing.T, db TestTokenDB)

func TListUnspentTokensByWallets

func TListUnspentTokensByWallets(t *testing.T, db TestTokenDB)

TListUnspentTokensByWallets exercises the batch variant of ListUnspentTokensBy. Seeds tokens across multiple wallets — two via the ownership wallet_id column (StoreToken's owner list) and one via the owner_wallet_id column on TokenRecord — then verifies the batch method partitions results correctly and honors the empty-input / missing-wallet / type-filter contracts.

func TMovements

func TMovements(t *testing.T, db driver3.TokenTransactionStore)

func TPublicParams

func TPublicParams(t *testing.T, db TestTokenDB)

func TQueryTokenDetails

func TQueryTokenDetails(t *testing.T, db TestTokenDB)

func TRegisterIdentityDescriptor

func TRegisterIdentityDescriptor(t *testing.T, db driver.IdentityStore)

func TRollback

func TRollback(t *testing.T, db driver3.TokenTransactionStore)

func TSaveAndGetToken

func TSaveAndGetToken(t *testing.T, db TestTokenDB)

func TSignerInfo

func TSignerInfo(t *testing.T, db driver.IdentityStore)

func TSignerInfoConcurrent

func TSignerInfoConcurrent(t *testing.T, db driver.IdentityStore)

func TStatus

func TStatus(t *testing.T, db driver3.TokenTransactionStore)

func TStoresTimestamp

func TStoresTimestamp(t *testing.T, db driver3.TokenTransactionStore)

func TSubscribeRead

func TSubscribeRead(t *testing.T, db TestTokenDB, notifier driver.TokenNotifier)

func TSubscribeStore

func TSubscribeStore(t *testing.T, db TestTokenDB, notifier driver.TokenNotifier)

func TSubscribeStoreDelete

func TSubscribeStoreDelete(t *testing.T, db TestTokenDB, notifier driver.TokenNotifier)

func TSubscribeStoreNoCommit

func TSubscribeStoreNoCommit(t *testing.T, db TestTokenDB, notifier driver.TokenNotifier)

func TTokenNotifier

func TTokenNotifier(t *testing.T, db TestTokenDB, notifier driver.TokenNotifier)

func TTokenRequest

func TTokenRequest(t *testing.T, db driver3.TokenTransactionStore)

func TTokenTransaction

func TTokenTransaction(t *testing.T, db TestTokenDB)

func TTokenTypes

func TTokenTypes(t *testing.T, db TestTokenDB)

func TTransaction

func TTransaction(t *testing.T, db driver3.TokenTransactionStore)

func TTransactionQueries

func TTransactionQueries(t *testing.T, db driver3.TokenTransactionStore)
func TWalletConfigurationLink(t *testing.T, db driver.WalletStore, identityDB driver.IdentityStore, conf driver.IdentityConfiguration)

TWalletConfigurationLink asserts that a wallet's conf_id, once stored, resolves back to the exact IdentityConfiguration it was linked to — i.e. that IdentityConfiguration.UniqueID() round-trips through GetConfiguration and can be used to join a Wallets row back to its originating IdentityConfigurations row.

func TestFully

func TestFully(t *testing.T, tokenDB driver3.TokenStore, tokenLockDB driver3.TokenLockStore, tokenTransactionDB driver3.TokenTransactionStore)

func TokenLocksTest

func TokenLocksTest(t *testing.T, cfgProvider cfgProvider)

func TokensTest

func TokensTest(t *testing.T, cfgProvider cfgProvider)

func TransactionsTest

func TransactionsTest(t *testing.T, cfgProvider cfgProvider)

func WalletTest

func WalletTest(t *testing.T, cfgProvider cfgProvider)

Types

type TestTokenDB

type TestTokenDB interface {
	driver.TokenStore

	StoreToken(ctx context.Context, tr driver.TokenRecord, owners []string) error
	GetAllTokenInfos(ctx context.Context, ids []*token.ID) ([][]byte, error)
}

type Value

type Value struct {
	V string
}

Jump to

Keyboard shortcuts

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