test_helpers

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FakeIlk = TestIlk{
		Hex:        "0x464b450000000000000000000000000000000000000000000000000000000000",
		Identifier: "FKE",
	}

	AnotherFakeIlk = TestIlk{
		Hex:        "0x464b453200000000000000000000000000000000000000000000000000000000",
		Identifier: "FKE2",
	}

	EmptyMetadatas []vdbStorage.ValueMetadata

	FakeIlkRateMetadata = vdbStorage.GetValueMetadata(vat.IlkRate, map[vdbStorage.Key]string{constants.Ilk: FakeIlk.Hex}, vdbStorage.Uint256)
	FakeIlkArtMetadata  = vdbStorage.GetValueMetadata(vat.IlkArt, map[vdbStorage.Key]string{constants.Ilk: FakeIlk.Hex}, vdbStorage.Uint256)
	FakeIlkSpotMetadata = vdbStorage.GetValueMetadata(vat.IlkSpot, map[vdbStorage.Key]string{constants.Ilk: FakeIlk.Hex}, vdbStorage.Uint256)
	FakeIlkLineMetadata = vdbStorage.GetValueMetadata(vat.IlkLine, map[vdbStorage.Key]string{constants.Ilk: FakeIlk.Hex}, vdbStorage.Uint256)
	FakeIlkDustMetadata = vdbStorage.GetValueMetadata(vat.IlkDust, map[vdbStorage.Key]string{constants.Ilk: FakeIlk.Hex}, vdbStorage.Uint256)

	FakeIlkVatMetadatas = []vdbStorage.ValueMetadata{
		FakeIlkRateMetadata,
		FakeIlkArtMetadata,
		FakeIlkSpotMetadata,
		FakeIlkLineMetadata,
		FakeIlkDustMetadata,
	}
	FakeIlkCatMetadatas = []vdbStorage.ValueMetadata{
		fakeIlkChopMetadata,
		fakeIlkLumpMetadata,
		fakeIlkFlipMetadata,
	}
	FakeIlkJugMetadatas = []vdbStorage.ValueMetadata{
		fakeIlkRhoMetadata,
		fakeIlkTaxMetadata,
	}
	FakeIlkSpotMetadatas = []vdbStorage.ValueMetadata{
		fakeIlkPipMetadata,
		fakeIlkMatMetadata,
	}

	AnotherFakeIlkVatMetadatas = []vdbStorage.ValueMetadata{
		anotherFakeIlkRateMetadata,
		anotherFakeIlkArtMetadata,
		anotherFakeIlkSpotMetadata,
		anotherFakeIlkLineMetadata,
		anotherFakeIlkDustMetadata,
	}
	AnotherFakeIlkCatMetadatas = []vdbStorage.ValueMetadata{
		anotherFakeIlkChopMetadata,
		anotherFakeIlkLumpMetadata,
		anotherFakeIlkFlipMetadata,
	}
	AnotherFakeIlkJugMetadatas = []vdbStorage.ValueMetadata{
		anotherFakeIlkRhoMetadata,
		anotherFakeIlkTaxMetadata,
	}
	AnotherFakeIlkSpotMetadatas = []vdbStorage.ValueMetadata{
		anotherFakeIlkPipMetadata,
		anotherFakeIlkMatMetadata,
	}
)

Functions

func AssertUrn

func AssertUrn(actual, expected UrnState)

func CreateCatRecords

func CreateCatRecords(db *postgres.DB, header core.Header, valuesMap map[string]interface{}, metadatas []vdbStorage.ValueMetadata, repository cat.CatStorageRepository)

func CreateDeal added in v0.2.15

func CreateDeal(input DealCreationInput) (err error)

func CreateDent added in v0.2.15

func CreateDent(input DentCreationInput) (err error)

func CreateFlap added in v0.2.15

func CreateFlap(db *postgres.DB, header core.Header, valuesMap map[string]interface{}, flapMetadatas []vdbStorage.ValueMetadata, contractAddress string)

func CreateFlapKick added in v0.2.15

func CreateFlapKick(contractAddress string, bidId int, headerId, logId int64, db *postgres.DB) error

func CreateFlip added in v0.2.15

func CreateFlip(db *postgres.DB, header core.Header, valuesMap map[string]interface{}, flipMetadatas []vdbStorage.ValueMetadata, contractAddress string)

func CreateFlipKick added in v0.2.15

func CreateFlipKick(contractAddress string, bidId int, headerId, logId int64, usr string, db *postgres.DB) error

func CreateFlop added in v0.2.15

func CreateFlop(db *postgres.DB, header core.Header, valuesMap map[string]interface{}, flopMetadatas []vdbStorage.ValueMetadata, contractAddress string)

func CreateFlopKick added in v0.2.15

func CreateFlopKick(contractAddress string, bidId int, headerId, logId int64, db *postgres.DB) error

func CreateIlk added in v0.2.4

func CreateIlk(db *postgres.DB, header core.Header, valuesMap map[string]interface{}, vatMetadatas, catMetadatas, jugMetadatas, spotMetadatas []vdbStorage.ValueMetadata)

func CreateJugRecords

func CreateJugRecords(db *postgres.DB, header core.Header, valuesMap map[string]interface{}, metadatas []vdbStorage.ValueMetadata, repository jug.JugStorageRepository)

func CreateManagedCdp added in v0.2.15

func CreateManagedCdp(db *postgres.DB, header core.Header, valuesMap map[string]interface{}, metadatas []vdbStorage.ValueMetadata) error

func CreateSpotRecords added in v0.2.7

func CreateSpotRecords(db *postgres.DB, header core.Header, valuesMap map[string]interface{}, metadatas []vdbStorage.ValueMetadata, repository spot.SpotStorageRepository)

func CreateTend added in v0.2.15

func CreateTend(input TendCreationInput) (err error)

func CreateTick added in v0.2.15

func CreateTick(input TickCreationInput) (err error)

func CreateUrn

func CreateUrn(db *postgres.DB, setupData map[string]interface{}, header core.Header, metadata UrnMetadata, vatRepo vat.VatStorageRepository)

Creates urn by creating necessary state diffs and the corresponding header

func CreateVatRecords

func CreateVatRecords(db *postgres.DB, header core.Header, valuesMap map[string]interface{}, metadatas []vdbStorage.ValueMetadata, repository vat.VatStorageRepository)

func CreateYank added in v0.2.15

func CreateYank(input YankCreationInput) (err error)

func GetCdpManagerMetadatas added in v0.2.15

func GetCdpManagerMetadatas(cdpi string) []vdbStorage.ValueMetadata

func GetCdpManagerStorageValues added in v0.2.15

func GetCdpManagerStorageValues(seed int, ilkHex string, urnGuy string, cdpi int) map[string]interface{}

func GetEmptyNullString added in v0.2.4

func GetEmptyNullString() sql.NullString

func GetExpectedTimestamp added in v0.2.3

func GetExpectedTimestamp(epoch int) string

func GetFlapMetadatas added in v0.2.15

func GetFlapMetadatas(bidId string) []vdbStorage.ValueMetadata

func GetFlapStorageValues added in v0.2.15

func GetFlapStorageValues(seed, bidId int) map[string]interface{}

func GetFlipMetadatas added in v0.2.15

func GetFlipMetadatas(bidId string) []vdbStorage.ValueMetadata

func GetFlipStorageValues added in v0.2.15

func GetFlipStorageValues(seed int, ilk string, bidId int) map[string]interface{}

func GetFlopMetadatas added in v0.2.15

func GetFlopMetadatas(bidId string) []vdbStorage.ValueMetadata

func GetFlopStorageValues added in v0.2.15

func GetFlopStorageValues(seed, bidId int) map[string]interface{}

func GetIlkValues

func GetIlkValues(seed int) map[string]interface{}

func GetRandomInt added in v0.2.4

func GetRandomInt(min, max int) int

func GetUrnSetupData

func GetUrnSetupData() map[string]interface{}

func GetValidNullString added in v0.2.4

func GetValidNullString(val string) sql.NullString

func SetUpFlapBidContext added in v0.2.15

func SetUpFlapBidContext(setupData FlapBidCreationInput) (err error)

func SetUpFlipBidContext added in v0.2.15

func SetUpFlipBidContext(setupData FlipBidContextInput) (ilkId, urnId int64, err error)

func SetUpFlopBidContext added in v0.2.15

func SetUpFlopBidContext(setupData FlopBidCreationInput) (err error)

Types

type BidEvent added in v0.2.15

type BidEvent struct {
	BidId           string `db:"bid_id"`
	Lot             string
	BidAmount       string `db:"bid_amount"`
	Act             string
	ContractAddress string `db:"contract_address"`
}

type BiteEvent added in v0.2.4

type BiteEvent struct {
	IlkIdentifier string `db:"ilk_identifier"`
	UrnIdentifier string `db:"urn_identifier"`
	Ink           string
	Art           string
	Tab           string
}

type DealCreationInput added in v0.2.15

type DealCreationInput struct {
	DB              *postgres.DB
	BidId           int
	ContractAddress string
	DealHeaderId    int64
}

type DentCreationInput added in v0.2.15

type DentCreationInput struct {
	DB              *postgres.DB
	ContractAddress string
	BidId           int
	Lot             int
	BidAmount       int
	DentHeaderId    int64
	DentLogId       int64
}

type FlapBid added in v0.2.15

type FlapBid struct {
	// contains filtered or unexported fields
}

func FlapBidFromValues added in v0.2.15

func FlapBidFromValues(bidId, dealt, updated, created string, bidValues map[string]interface{}) FlapBid

type FlapBidCreationInput added in v0.2.15

type FlapBidCreationInput struct {
	DealCreationInput
	Dealt            bool
	FlapKickHeaderId int64
}

type FlipBid added in v0.2.15

type FlipBid struct {
	IlkId string `db:"ilk_id"`
	UrnId string `db:"urn_id"`
	Gal   string
	Tab   string
	// contains filtered or unexported fields
}

func FlipBidFromValues added in v0.2.15

func FlipBidFromValues(bidId, ilkId, urnId, dealt, updated, created string, bidValues map[string]interface{}) FlipBid

type FlipBidContextInput added in v0.2.15

type FlipBidContextInput struct {
	DealCreationInput
	Dealt            bool
	IlkHex           string
	UrnGuy           string
	FlipKickHeaderId int64
}

type FlopBid added in v0.2.15

type FlopBid struct {
	// contains filtered or unexported fields
}

func FlopBidFromValues added in v0.2.15

func FlopBidFromValues(bidId, dealt, updated, created string, bidValues map[string]interface{}) FlopBid

type FlopBidCreationInput added in v0.2.15

type FlopBidCreationInput struct {
	DealCreationInput
	Dealt            bool
	FlopKickHeaderId int64
}

type FrobEvent

type FrobEvent struct {
	IlkIdentifier string `db:"ilk_identifier"`
	UrnIdentifier string `db:"urn_identifier"`
	Dink          string
	Dart          string
	Rate          string `db:"ilk_rate"`
}

type IlkFileEvent added in v0.2.4

type IlkFileEvent struct {
	IlkIdentifier sql.NullString `db:"ilk_identifier"`
	What          string
	Data          string
}

type IlkState

type IlkState struct {
	IlkIdentifier string `db:"ilk_identifier"`
	BlockNumber   string `db:"block_number"`
	Rate          string
	Art           string
	Spot          string
	Line          string
	Dust          string
	Chop          string
	Lump          string
	Flip          string
	Rho           string
	Duty          string
	Pip           string
	Mat           string
	Created       sql.NullString
	Updated       sql.NullString
}

func IlkStateFromValues

func IlkStateFromValues(ilk, updated, created string, ilkValues map[string]interface{}) IlkState

type ManagedCdp added in v0.2.15

type ManagedCdp struct {
	Id            string `db:"cdpi"`
	Usr           string
	UrnIdentifier string `db:"urn_identifier"`
	IlkIdentifier string `db:"ilk_identifier"`
	Created       sql.NullString
}

func ManagedCdpFromValues added in v0.2.15

func ManagedCdpFromValues(ilkIdentifier, created string, cdpValues map[string]interface{}) ManagedCdp

type PokeEvent added in v0.2.7

type PokeEvent struct {
	IlkId string `db:"ilk_id"`
	Val   string
	Spot  string
}

type SinQueueEvent added in v0.2.4

type SinQueueEvent struct {
	Era         string
	Act         string
	BlockHeight string `db:"block_height"`
}

type TendCreationInput added in v0.2.15

type TendCreationInput struct {
	DB              *postgres.DB
	ContractAddress string
	BidId           int
	Lot             int
	BidAmount       int
	TendHeaderId    int64
	TendLogId       int64
}

type TestIlk added in v0.2.3

type TestIlk struct {
	Hex        string
	Identifier string
}

type TickCreationInput added in v0.2.15

type TickCreationInput struct {
	DB              *postgres.DB
	BidId           int
	ContractAddress string
	TickHeaderId    int64
	TickLogId       int64
}

type UrnMetadata

type UrnMetadata struct {
	UrnInk vdbStorage.ValueMetadata
	UrnArt vdbStorage.ValueMetadata
}

func GetUrnMetadata

func GetUrnMetadata(ilk, urn string) UrnMetadata

type UrnState

type UrnState struct {
	UrnIdentifier string `db:"urn_identifier"`
	IlkIdentifier string `db:"ilk_identifier"`
	BlockHeight   int    `db:"block_height"`
	Ink           string
	Art           string
	Created       sql.NullString
	Updated       sql.NullString
}

type YankCreationInput added in v0.2.15

type YankCreationInput struct {
	DB              *postgres.DB
	ContractAddress string
	BidId           int
	YankHeaderId    int64
	YankLogId       int64
}

Jump to

Keyboard shortcuts

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