Documentation
¶
Index ¶
- Variables
- func BuildInstructionData(t *testing.T, opType op.Type, opCommand op.Command, originalMessage []byte, ...) *instruction.Data
- func BuildInstructionDataWithID(t *testing.T, instructionID common.Hash, opType op.Type, opCommand op.Command, ...) *instruction.Data
- func FetchAndVerifyActionResponse(t *testing.T, port uint, actionID common.Hash, ...) *types.ActionResponse
- func FetchAndVerifyRewardingData(t *testing.T, pc *ProxyConfig, instructionID common.Hash, opType op.Type, ...)
- func GetTeeInfo(t *testing.T, pc *ProxyConfig) *types.TeeInfoResponse
- func GetVotingStatuses(t *testing.T, pc *ProxyConfig, rewardEpochID uint32, instructionID common.Hash) *voting.Statuses
- func GetWalletInfo(t *testing.T, pc *ProxyConfig, walletID [32]byte, keyID uint64) *pkgwallets.KeyData
- func SetProxyURLOnTEE(t *testing.T, port uint, proxyURL string)
- func SignAndSendInstruction(t *testing.T, iData *instruction.Data, privKey *ecdsa.PrivateKey, port uint) *voting.SignedReceipt
- func SignAndSendInstructions(t *testing.T, iData *instruction.Data, privKeys []*ecdsa.PrivateKey, port uint) []*voting.SignedReceipt
- func SignAndSendInstructionsWithAddVarMsgs(t *testing.T, iData *instruction.Data, ...) ([]*voting.SignedReceipt, []instruction.Data)
- func VerifyActionResponse(t *testing.T, res *types.ActionResponse, submissionTag types.SubmissionTag, ...)
- func VerifyReceipts(t *testing.T, receipts []*voting.SignedReceipt, iData *instruction.Data)
- func VerifyReceiptsForMultipleInstructions(t *testing.T, receipts []*voting.SignedReceipt, insts []instruction.Data)
- func VerifyVotingStatus(t *testing.T, statuses *voting.Statuses, ...)
- type ProxyConfig
Constants ¶
This section is empty.
Variables ¶
var StorageTimeConfig = struct { CycleInternal time.Duration CycleQueueResponseWait time.Duration }{ CycleInternal: 50 * time.Millisecond, CycleQueueResponseWait: 10 * time.Second, }
var TestTimeConfig = struct { Timeout time.Duration Interval time.Duration }{ Timeout: 2000 * time.Millisecond, Interval: 50 * time.Millisecond, }
Functions ¶
func BuildInstructionData ¶
func BuildInstructionData( t *testing.T, opType op.Type, opCommand op.Command, originalMessage []byte, timestamp uint64, additionalFixedMessageRaw any, additionalVariableMessage any, cosigners []common.Address, cosignersThreshold uint64, teeID common.Address, rewardEpochID uint32, ) *instruction.Data
func BuildInstructionDataWithID ¶
func BuildInstructionDataWithID( t *testing.T, instructionID common.Hash, opType op.Type, opCommand op.Command, originalMessage []byte, timestamp uint64, additionalFixedMessageRaw any, additionalVariableMessage any, cosigners []common.Address, cosignersThreshold uint64, teeID common.Address, rewardEpochID uint32, ) *instruction.Data
func FetchAndVerifyActionResponse ¶
func FetchAndVerifyActionResponse(t *testing.T, port uint, actionID common.Hash, submissionTag types.SubmissionTag, opType op.Type, opCommand op.Command, teeID common.Address, expectedStatus uint8) *types.ActionResponse
FetchAndVerifyActionResponse Fetches ActionResponse and verifies the signature
func FetchAndVerifyRewardingData ¶
func FetchAndVerifyRewardingData(t *testing.T, pc *ProxyConfig, instructionID common.Hash, opType op.Type, opCommand op.Command, receipts []*voting.SignedReceipt)
FetchAndVerifyRewardingData Fetches rewarding data and verifies the action response and vote sequence
func GetTeeInfo ¶
func GetTeeInfo(t *testing.T, pc *ProxyConfig) *types.TeeInfoResponse
GetTeeInfo Fetches TeeInfoResponse until TestTimeConfig.Timeout every TestTimeConfig.Interval
func GetVotingStatuses ¶
func GetVotingStatuses(t *testing.T, pc *ProxyConfig, rewardEpochID uint32, instructionID common.Hash) *voting.Statuses
GetVotingStatuses Fetches VoteStatus until TestTimeConfig.Timeout every TestTimeConfig.Interval
func GetWalletInfo ¶
func GetWalletInfo(t *testing.T, pc *ProxyConfig, walletID [32]byte, keyID uint64) *pkgwallets.KeyData
GetWalletInfo Fetches KeyData until TestTimeConfig.Timeout every TestTimeConfig.Interval
func SignAndSendInstruction ¶
func SignAndSendInstruction(t *testing.T, iData *instruction.Data, privKey *ecdsa.PrivateKey, port uint) *voting.SignedReceipt
func SignAndSendInstructions ¶
func SignAndSendInstructions(t *testing.T, iData *instruction.Data, privKeys []*ecdsa.PrivateKey, port uint) []*voting.SignedReceipt
func SignAndSendInstructionsWithAddVarMsgs ¶
func SignAndSendInstructionsWithAddVarMsgs(t *testing.T, iData *instruction.Data, additionalVariableMessage []hexutil.Bytes, privKeys []*ecdsa.PrivateKey, port uint) ([]*voting.SignedReceipt, []instruction.Data)
func VerifyActionResponse ¶
func VerifyActionResponse(t *testing.T, res *types.ActionResponse, submissionTag types.SubmissionTag, opType op.Type, opCommand op.Command, teeID common.Address)
VerifyActionResponse Verifies the action response against expected values and checks the signature
func VerifyReceipts ¶
func VerifyReceipts(t *testing.T, receipts []*voting.SignedReceipt, iData *instruction.Data)
func VerifyReceiptsForMultipleInstructions ¶
func VerifyReceiptsForMultipleInstructions(t *testing.T, receipts []*voting.SignedReceipt, insts []instruction.Data)
Types ¶
type ProxyConfig ¶
type ProxyConfig struct {
ExtPort uint
IntPort uint
TeeID common.Address
TeePubKey *ecdsa.PublicKey
ProxyPubKey *ecdsa.PublicKey
Aq *queue.ActionQueues
Rs *result.ResultStorage
Vc *config.Voting
Pc chan policy.SigningPolicy
Ws *wallets.Service
If *info.Service
}
func RunProxy ¶
func RunProxy(t *testing.T, internalPort, externalPort uint, proxyPk *ecdsa.PrivateKey, wg *sync.WaitGroup) (*ProxyConfig, func())
RunProxy simulates behavior of internal/initialize.go - Starts internal and external proxy servers, and fetches TEE ID from TEE