Documentation ¶
Index ¶
- Variables
- func NewHost(hk types.PublicKey, pt rhpv3.HostPriceTable, settings rhpv2.HostSettings) api.Host
- func NewHostPriceTable() rhpv3.HostPriceTable
- func NewHostSettings() rhpv2.HostSettings
- func NewHosts(n int) []api.Host
- func RandomHostKey() types.PublicKey
- func Retry(tries int, durationBetweenAttempts time.Duration, fn func() error) error
- type TT
- type TestingCommon
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // AutopilotConfig is the autopilot used for testing unless a different // one is explicitly set. AutopilotConfig = api.AutopilotConfig{ Contracts: api.ContractsConfig{ Allowance: types.Siacoins(1).Mul64(1e3), Amount: 3, Period: 144, RenewWindow: 72, Download: rhpv2.SectorSize * 500, Upload: rhpv2.SectorSize * 500, Storage: rhpv2.SectorSize * 5e3, Set: ContractSet, Prune: false, }, Hosts: api.HostsConfig{ MaxDowntimeHours: 10, MinRecentScanFailures: 10, AllowRedundantIPs: true, }, } ContractSet = "testset" ContractSetSettings = api.ContractSetSetting{ Default: ContractSet, } GougingSettings = api.GougingSettings{ MaxRPCPrice: types.Siacoins(1).Div64(1000), MaxContractPrice: types.Siacoins(10), MaxDownloadPrice: types.Siacoins(1).Mul64(1000), MaxUploadPrice: types.Siacoins(1).Mul64(1000), MaxStoragePrice: types.Siacoins(1000).Div64(144 * 30), HostBlockHeightLeeway: 240, MinPriceTableValidity: 10 * time.Second, MinAccountExpiry: time.Hour, MinMaxEphemeralAccountBalance: types.Siacoins(1), } PricePinSettings = api.DefaultPricePinSettings RedundancySettings = api.RedundancySettings{ MinShards: 2, TotalShards: 3, } S3AccessKeyID = "TESTINGYNHUWCPKOPSYQ" S3SecretAccessKey = "Rh30BNyj+qNI4ftYRteoZbHJ3X4Ln71QtZkRXzJ9" S3Credentials = credentials.NewStaticV4(S3AccessKeyID, S3SecretAccessKey, "") )
Functions ¶
func NewHost ¶ added in v1.0.7
func NewHost(hk types.PublicKey, pt rhpv3.HostPriceTable, settings rhpv2.HostSettings) api.Host
func NewHostPriceTable ¶ added in v1.0.7
func NewHostPriceTable() rhpv3.HostPriceTable
func NewHostSettings ¶ added in v1.0.7
func NewHostSettings() rhpv2.HostSettings
func RandomHostKey ¶ added in v1.0.7
Types ¶
type TT ¶
type TT interface { TestingCommon AssertContains(err error, target string) AssertIs(err, target error) FailAll(vs ...interface{}) OK(err error) OKAll(vs ...interface{}) // Retry will call 'fn' 'tries' times, waiting 'durationBetweenAttempts' // between each attempt, returning 'nil' the first time that 'fn' // returns nil. If 'nil' is never returned, then the final error // returned by 'fn' is returned. Retry(tries int, durationBetweenAttempts time.Duration, fn func() error) }
func NewTT ¶
func NewTT(tc TestingCommon) TT
type TestingCommon ¶
type TestingCommon interface { Log(args ...any) Logf(format string, args ...any) Error(args ...any) Errorf(format string, args ...any) Fatal(args ...any) Fatalf(format string, args ...any) Skip(args ...any) Skipf(format string, args ...any) SkipNow() Skipped() bool Helper() Cleanup(f func()) TempDir() string Setenv(key, value string) }
TestingCommon is an interface that describes the common methods of testing.T and testing.B ensuring this testutil can be used in both contexts.
Click to show internal directories.
Click to hide internal directories.