Documentation
¶
Index ¶
- Constants
- Variables
- func AdjustAuthoritySet(adjustingNodes string)
- func CheckAuthoritySet(t *testing.T)
- func ClearContextResponseWriter(context *web.Context)
- func CountAuthoritySet() (int, int, int)
- func CreateAndPopulateTestDatabaseOverlay() *databaseOverlay.Overlay
- func CreateAndPopulateTestDatabaseOverlayForFER(testEntries []FEREntryWithHeight, desiredHeight int) *databaseOverlay.Overlay
- func CreateAndPopulateTestState() *state.State
- func CreateAndPopulateTestStateAndStartValidator() *state.State
- func CreateAndPopulateTestStateForFER(testEntries []FEREntryWithHeight, desiredHeight int) *state.State
- func CreateEmptyTestDatabaseOverlay() *databaseOverlay.Overlay
- func CreateEmptyTestState() *state.State
- func CreateFirstAnchorEntry() *entryBlock.Entry
- func CreateFirstTestEntry() *entryBlock.Entry
- func CreatePopulateAndExecuteTestState() *state.State
- func CreateTestAdminBlock(prev *adminBlock.AdminBlock) *adminBlock.AdminBlock
- func CreateTestAdminHeader(prev *adminBlock.AdminBlock) *adminBlock.ABlockHeader
- func CreateTestAnchorEnry(dBlock *directoryBlock.DirectoryBlock) *entryBlock.Entry
- func CreateTestAnchorEntryBlock(p interfaces.IEntryBlock, prevDBlock *directoryBlock.DirectoryBlock) (*entryBlock.EBlock, []*entryBlock.Entry)
- func CreateTestDBStateList() []interfaces.IMsg
- func CreateTestDirBlockInfo(prev *dbInfo.DirBlockInfo) *dbInfo.DirBlockInfo
- func CreateTestDirectoryBlock(prevBlock *directoryBlock.DirectoryBlock) *directoryBlock.DirectoryBlock
- func CreateTestDirectoryBlockHeader(prevBlock *directoryBlock.DirectoryBlock) *directoryBlock.DBlockHeader
- func CreateTestDirectoryBlockHeaderWithNetworkID(prevBlock *directoryBlock.DirectoryBlock, networkID uint32) *directoryBlock.DBlockHeader
- func CreateTestDirectoryBlockWithNetworkID(prevBlock *directoryBlock.DirectoryBlock, networkID uint32) *directoryBlock.DirectoryBlock
- func CreateTestEntry(n uint32) *entryBlock.Entry
- func CreateTestEntryBlock(p interfaces.IEntryBlock) (*entryBlock.EBlock, []*entryBlock.Entry)
- func CreateTestEntryBlockForFER(p interfaces.IEntryBlock, height uint32) (*entryBlock.EBlock, []*entryBlock.Entry)
- func CreateTestEntryBlockWithContentN(p interfaces.IEntryBlock, content uint32) (*entryBlock.EBlock, []*entryBlock.Entry)
- func CreateTestEntryCreditBlock(prev interfaces.IEntryCreditBlock) interfaces.IEntryCreditBlock
- func CreateTestFEREntry(n uint32) *entryBlock.Entry
- func CreateTestFactoidBlock(prev interfaces.IFBlock) interfaces.IFBlock
- func CreateTestFactoidBlockWithCoinbase(prev interfaces.IFBlock, address interfaces.IAddress, amount uint64) interfaces.IFBlock
- func CreateTestFactoidBlockWithTransaction(prev interfaces.IFBlock, sentSecret string, receivePublic []byte, amt uint64) interfaces.IFBlock
- func CreateWebContext() *web.Context
- func ExecuteAllBlocksFromDatabases(s *state.State)
- func GetAllDBStateMsgsFromDatabase(s *state.State) []interfaces.IMsg
- func GetAnchorChainID() interfaces.IHash
- func GetBody(context *web.Context) string
- func GetChainID() interfaces.IHash
- func GetRespMap(context *web.Context) map[string]interface{}
- func GetRespText(context *web.Context) string
- func Halt(t *testing.T)
- func IntToByteSlice(n int) []byte
- func MakeSureAnchorValidationKeyIsPresent()
- func NewCommitChain(eBlock *entryBlock.EBlock) *entryCreditBlock.CommitChain
- func NewCommitEntry(eBlock *entryBlock.EBlock) *entryCreditBlock.CommitEntry
- func NewECAddress(n uint64) interfaces.IAddress
- func NewECAddressPublicKeyString(n uint64) string
- func NewECAddressString(n uint64) string
- func NewFactoidAddress(n uint64) interfaces.IAddress
- func NewFactoidAddressStrings(n uint64) (string, string, string)
- func NewFactoidRCDAddress(n uint64) interfaces.IRCD
- func NewFactoidRCDAddressString(n uint64) string
- func NewFullPrivKey(n uint64) []byte
- func NewPrimitivesPrivateKey(n uint64) *primitives.PrivateKey
- func NewPrivKey(n uint64) []byte
- func NewPrivKeyString(n uint64) string
- func NewRepeatingHash(b byte) interfaces.IHash
- func PopulateTestDatabaseOverlay(dbo *databaseOverlay.Overlay)
- func PrintList(title string, list map[string]uint64)
- func PrivateKeyToEDPub(priv []byte) []byte
- func ResetFactomHome(t *testing.T, subDir string)
- func RunCmd(cmd string)
- func SetupSim(GivenNodes string, UserAddedOptions map[string]string, height int, ...) *state.State
- func ShutDownEverything(t *testing.T)
- func SignCommit(n uint64, tx interfaces.ISignable)
- func SignFactoidTransaction(n uint64, tx interfaces.ITransaction)
- func StatusEveryMinute(s *state.State)
- func TestABlockEntryFunctions(a interfaces.IABEntry, b interfaces.IABEntry, t *testing.T)
- func TestMarshaling(a interfaces.BinaryMarshallable, b interfaces.BinaryMarshallable, ...)
- func TimeNow(s *state.State)
- func UnmarshalResp(context *web.Context, dst interface{})
- func UnmarshalRespDirectly(context *web.Context, dst interface{})
- func WaitBlocks(s *state.State, blks int)
- func WaitForAllNodes(state *state.State)
- func WaitForBlock(s *state.State, newBlock int)
- func WaitForMinute(s *state.State, newMinute int)
- func WaitForQuiet(s *state.State, newBlock int, newMinute int)
- func WaitMinutes(s *state.State, min int)
- func WriteConfigFile(identityNumber int, fnode int, extra string, t *testing.T)
- type BlockSet
- func CreateFullTestBlockSet() []*BlockSet
- func CreateTestBlockSet(prev *BlockSet) *BlockSet
- func CreateTestBlockSetForFER(prev *BlockSet, db *databaseOverlay.Overlay, testEntries []FEREntryWithHeight) *BlockSet
- func CreateTestBlockSetWithNetworkID(prev *BlockSet, networkID uint32, transactions bool) *BlockSet
- type FEREntryWithHeight
- type TestResponseWriter
Constants ¶
View Source
const ( DBlockHeadPrimaryIndex = "30060a6e8247e0ee085f29714a95d91f659c78ceea7ced49fd312c115e0440c3" DBlockHeadSecondaryIndex = "376c6f28ffeaf08a61df390b4a9731f241d340d913564c3ca6eab32e113b5cd2" ABlockHeadPrimaryIndex = "073bd46185217fddbd6d422cc23f28fe8ea58bf63c2e7521b7de3623b52e3b41" ABlockHeadSecondaryIndex = "4d4d40eff3c48e054226d7308ac6a8e2230dc489be7ca39631abac258f33902b" ECBlockHeadPrimaryIndex = "bdf70fe3bd42c74bb86668e10bff2c8c1c52c6c89f625d3d9b6e763081916a56" ECBlockHeadSecondaryIndex = "c70b7f03068418741f6815f26560cbb2a11447c9b8717c4fe6ac2a0852750393" FBlockHeadPrimaryIndex = "84c8ac94c639117ef1b80d00c48f03c4a14bd74f17d86d56a8d8a4a73e6f91a8" FBlockHeadSecondaryIndex = "5f4d14e8b4bf5d8545d7ccaccccc99d2757b6ef5eaf5ffac03705457bb9d65ac" EBlockHeadPrimaryIndex = "6e7e64ac45ff57edbf8537a0c99fba2e9ee351ef3d3f4abd93af9f01107e592c" EBlockHeadSecondaryIndex = "e79fb46ad81f0b4fac7f1e66728b40b390f8fcc3806e93f94550eec041eecff2" AnchorBlockHeadPrimaryIndex = "df3ade9eec4b08d5379cc64270c30ea7315d8a8a1a69efe2b98a60ecdd69e604" AnchorBlockHeadSecondaryIndex = "7ab57fdb07ad75f35cb8f85bf435f60d5eab381c9da253780978cdb9d7ea5fae" )
Variables ¶
View Source
var BlockCount int = 10
View Source
var DefaultCoinbaseAmount uint64 = 100000000
View Source
var ExpectedHeight, Leaders, Audits, Followers int
View Source
var RanSimTest = false // only run 1 sim test at a time
Functions ¶
func AdjustAuthoritySet ¶
func AdjustAuthoritySet(adjustingNodes string)
func CheckAuthoritySet ¶
func CountAuthoritySet ¶
func CreateAndPopulateTestDatabaseOverlay ¶
func CreateAndPopulateTestDatabaseOverlay() *databaseOverlay.Overlay
func CreateAndPopulateTestDatabaseOverlayForFER ¶
func CreateAndPopulateTestDatabaseOverlayForFER(testEntries []FEREntryWithHeight, desiredHeight int) *databaseOverlay.Overlay
func CreateAndPopulateTestStateForFER ¶
func CreateAndPopulateTestStateForFER(testEntries []FEREntryWithHeight, desiredHeight int) *state.State
func CreateEmptyTestDatabaseOverlay ¶
func CreateEmptyTestDatabaseOverlay() *databaseOverlay.Overlay
func CreateEmptyTestState ¶
func CreateFirstAnchorEntry ¶
func CreateFirstAnchorEntry() *entryBlock.Entry
func CreateFirstTestEntry ¶
func CreateFirstTestEntry() *entryBlock.Entry
func CreateTestAdminBlock ¶
func CreateTestAdminBlock(prev *adminBlock.AdminBlock) *adminBlock.AdminBlock
func CreateTestAdminHeader ¶
func CreateTestAdminHeader(prev *adminBlock.AdminBlock) *adminBlock.ABlockHeader
func CreateTestAnchorEnry ¶
func CreateTestAnchorEnry(dBlock *directoryBlock.DirectoryBlock) *entryBlock.Entry
func CreateTestAnchorEntryBlock ¶
func CreateTestAnchorEntryBlock(p interfaces.IEntryBlock, prevDBlock *directoryBlock.DirectoryBlock) (*entryBlock.EBlock, []*entryBlock.Entry)
func CreateTestDBStateList ¶
func CreateTestDBStateList() []interfaces.IMsg
func CreateTestDirBlockInfo ¶
func CreateTestDirBlockInfo(prev *dbInfo.DirBlockInfo) *dbInfo.DirBlockInfo
func CreateTestDirectoryBlock ¶
func CreateTestDirectoryBlock(prevBlock *directoryBlock.DirectoryBlock) *directoryBlock.DirectoryBlock
func CreateTestDirectoryBlockHeader ¶
func CreateTestDirectoryBlockHeader(prevBlock *directoryBlock.DirectoryBlock) *directoryBlock.DBlockHeader
func CreateTestDirectoryBlockHeaderWithNetworkID ¶
func CreateTestDirectoryBlockHeaderWithNetworkID(prevBlock *directoryBlock.DirectoryBlock, networkID uint32) *directoryBlock.DBlockHeader
func CreateTestDirectoryBlockWithNetworkID ¶
func CreateTestDirectoryBlockWithNetworkID(prevBlock *directoryBlock.DirectoryBlock, networkID uint32) *directoryBlock.DirectoryBlock
func CreateTestEntry ¶
func CreateTestEntry(n uint32) *entryBlock.Entry
func CreateTestEntryBlock ¶
func CreateTestEntryBlock(p interfaces.IEntryBlock) (*entryBlock.EBlock, []*entryBlock.Entry)
func CreateTestEntryBlockForFER ¶
func CreateTestEntryBlockForFER(p interfaces.IEntryBlock, height uint32) (*entryBlock.EBlock, []*entryBlock.Entry)
func CreateTestEntryBlockWithContentN ¶
func CreateTestEntryBlockWithContentN(p interfaces.IEntryBlock, content uint32) (*entryBlock.EBlock, []*entryBlock.Entry)
func CreateTestEntryCreditBlock ¶
func CreateTestEntryCreditBlock(prev interfaces.IEntryCreditBlock) interfaces.IEntryCreditBlock
func CreateTestFEREntry ¶
func CreateTestFEREntry(n uint32) *entryBlock.Entry
func CreateTestFactoidBlock ¶
func CreateTestFactoidBlock(prev interfaces.IFBlock) interfaces.IFBlock
func CreateTestFactoidBlockWithCoinbase ¶
func CreateTestFactoidBlockWithCoinbase(prev interfaces.IFBlock, address interfaces.IAddress, amount uint64) interfaces.IFBlock
func CreateTestFactoidBlockWithTransaction ¶
func CreateTestFactoidBlockWithTransaction(prev interfaces.IFBlock, sentSecret string, receivePublic []byte, amt uint64) interfaces.IFBlock
func CreateWebContext ¶
func GetAllDBStateMsgsFromDatabase ¶
func GetAllDBStateMsgsFromDatabase(s *state.State) []interfaces.IMsg
func GetAnchorChainID ¶
func GetAnchorChainID() interfaces.IHash
func GetChainID ¶
func GetChainID() interfaces.IHash
func GetRespMap ¶
func GetRespText ¶
func IntToByteSlice ¶
func MakeSureAnchorValidationKeyIsPresent ¶
func MakeSureAnchorValidationKeyIsPresent()
func NewCommitChain ¶
func NewCommitChain(eBlock *entryBlock.EBlock) *entryCreditBlock.CommitChain
func NewCommitEntry ¶
func NewCommitEntry(eBlock *entryBlock.EBlock) *entryCreditBlock.CommitEntry
func NewECAddress ¶
func NewECAddress(n uint64) interfaces.IAddress
func NewECAddressString ¶
func NewFactoidAddress ¶
func NewFactoidAddress(n uint64) interfaces.IAddress
func NewFactoidRCDAddress ¶
func NewFactoidRCDAddress(n uint64) interfaces.IRCD
func NewFullPrivKey ¶
Create a full 64 bit key holding both private and public key
func NewPrimitivesPrivateKey ¶
func NewPrimitivesPrivateKey(n uint64) *primitives.PrivateKey
func NewPrivKey ¶
Create 32 bit private key (without the public key part)
func NewPrivKeyString ¶
func NewRepeatingHash ¶
func NewRepeatingHash(b byte) interfaces.IHash
func PopulateTestDatabaseOverlay ¶
func PopulateTestDatabaseOverlay(dbo *databaseOverlay.Overlay)
func PrivateKeyToEDPub ¶
func ResetFactomHome ¶
func SetupSim ¶
func SetupSim(GivenNodes string, UserAddedOptions map[string]string, height int, electionsCnt int, RoundsCnt int, t *testing.T) *state.State
EX. state0 := SetupSim("LLLLLLLLLLLLLLLAAAAAAAAAA", map[string]string {"--controlpanelsetting" : "readwrite"}, t)
func ShutDownEverything ¶
func SignCommit ¶
func SignCommit(n uint64, tx interfaces.ISignable)
func SignFactoidTransaction ¶
func SignFactoidTransaction(n uint64, tx interfaces.ITransaction)
func StatusEveryMinute ¶
print the status for every minute for a state
func TestABlockEntryFunctions ¶
func TestABlockEntryFunctions(a interfaces.IABEntry, b interfaces.IABEntry, t *testing.T)
func TestMarshaling ¶
func TestMarshaling(a interfaces.BinaryMarshallable, b interfaces.BinaryMarshallable, extraBytes int, t *testing.T)
TestMarshaling will test a marshing and unmarshal operation. Do the comparison of equality yourself. Extrabytes adds a random number of bytes up to extrabytes in length
func UnmarshalResp ¶
func UnmarshalRespDirectly ¶
func WaitForAllNodes ¶
func WaitForQuiet ¶
Wait till block = newBlock and minute = newMinute
func WaitMinutes ¶
Types ¶
type BlockSet ¶
type BlockSet struct { DBlock *directoryBlock.DirectoryBlock ABlock *adminBlock.AdminBlock ECBlock interfaces.IEntryCreditBlock FBlock interfaces.IFBlock EBlock *entryBlock.EBlock AnchorEBlock *entryBlock.EBlock Entries []*entryBlock.Entry Height int }
func CreateFullTestBlockSet ¶
func CreateFullTestBlockSet() []*BlockSet
func CreateTestBlockSet ¶
func CreateTestBlockSetForFER ¶
func CreateTestBlockSetForFER(prev *BlockSet, db *databaseOverlay.Overlay, testEntries []FEREntryWithHeight) *BlockSet
type FEREntryWithHeight ¶
type FEREntryWithHeight struct { AnFEREntry interfaces.IEBEntry Height uint32 }
type TestResponseWriter ¶
func (*TestResponseWriter) Header ¶
func (t *TestResponseWriter) Header() http.Header
func (*TestResponseWriter) WriteHeader ¶
func (t *TestResponseWriter) WriteHeader(h int)
Click to show internal directories.
Click to hide internal directories.