mockoracle

package
v3.1.0-fork Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockOracle

type MockOracle struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MockOracle is a mock oracle for test.

func (*MockOracle) AddOffset

func (o *MockOracle) AddOffset(d time.Duration)

AddOffset adds the offset of the oracle.

func (*MockOracle) Close

func (o *MockOracle) Close()

Close implements oracle.Oracle interface.

func (*MockOracle) Disable

func (o *MockOracle) Disable()

Disable disables the Oracle

func (*MockOracle) Enable

func (o *MockOracle) Enable()

Enable enables the Oracle

func (*MockOracle) GetLowResolutionTimestamp

func (o *MockOracle) GetLowResolutionTimestamp(ctx context.Context) (uint64, error)

GetLowResolutionTimestamp implements oracle.Oracle interface.

func (*MockOracle) GetLowResolutionTimestampAsync

func (o *MockOracle) GetLowResolutionTimestampAsync(ctx context.Context) oracle.Future

GetLowResolutionTimestampAsync implements oracle.Oracle interface.

func (*MockOracle) GetTimestamp

func (o *MockOracle) GetTimestamp(context.Context) (uint64, error)

GetTimestamp implements oracle.Oracle interface.

func (*MockOracle) GetTimestampAsync

func (o *MockOracle) GetTimestampAsync(ctx context.Context) oracle.Future

GetTimestampAsync implements oracle.Oracle interface.

func (*MockOracle) IsExpired

func (o *MockOracle) IsExpired(lockTimestamp uint64, TTL uint64) bool

IsExpired implements oracle.Oracle interface.

func (*MockOracle) UntilExpired

func (o *MockOracle) UntilExpired(lockTimeStamp uint64, TTL uint64) int64

UntilExpired implement oracle.Oracle interface.

Jump to

Keyboard shortcuts

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