it-chain
it-chain copied to clipboard
[Consensus] HandleStartConsensusCommand test 문의
func TestStartConsensusCommandHandler_HandleStartConsensusCommand(t *testing.T) {
//mockStateApi := newMockStateApi(nil)
//testHandler := adapter.NewStartConsensusCommandHandler(mockStateApi)
//
//// case 1 : success
//expectedSeal := []byte{'s', 'e', 'a', 'l'}
//expectedTxList := []event.Tx{}
//for i := 0; i < 5; i++ {
// expectedTxList = append(expectedTxList, event.Tx{
// ID: string(i),
// })
//}
//
//expectedCommand := event.BlockCreated{
// Seal: expectedSeal,
// TxList: expectedTxList,
//}
//
//testResult, testErr := testHandler.HandleStartConsensusCommand(expectedCommand)
//
//assert.True(t, testResult)
//assert.Equal(t, "", testErr.Message)
//
//// case 2 : consensus on error
//consensusStartError := errors.New("on consensus failed!")
//mockStateApi = newMockStateApi(consensusStartError)
//testHandler = adapter.NewStartConsensusCommandHandler(mockStateApi)
//
//testResult, testErr = testHandler.HandleStartConsensusCommand(expectedCommand)
//
//assert.False(t, testResult)
//assert.Equal(t, consensusStartError.Error(), testErr.Message)
}
consensus 쪽의 TestStartConsensusCommandHandler_HandleStartConsensusCommand
테스트 함수 처리가 주석 되어 있는데 어떤 이유가 있는 건가요??
@hihiboss