コード例 #1
0
ファイル: bucket_key_test.go プロジェクト: C0rWin/fabric
func TestBucketKeyWrongBucketNumberCausePanic_3(t *testing.T) {
	conf = newConfig(26, 3, fnvHash)
	defer testutil.AssertPanic(t, "A panic should occur when asking for a level beyond a valid range")
	newBucketKey(0, 2)
}
コード例 #2
0
ファイル: state_test.go プロジェクト: Colearo/fabric
func TestStateTxWrongCallCausePanic_2(t *testing.T) {
	_, state := createFreshDBAndConstructState(t)
	defer testutil.AssertPanic(t, "A panic should occur when a tx-begin is invoked before tx-finish for on-going tx")
	state.TxBegin("txUuid")
	state.TxBegin("anotherUuid")
}
コード例 #3
0
ファイル: state_test.go プロジェクト: Colearo/fabric
func TestStateTxWrongCallCausePanic_3(t *testing.T) {
	_, state := createFreshDBAndConstructState(t)
	defer testutil.AssertPanic(t, "A panic should occur when Uuid for tx-begin and tx-finish ends")
	state.TxBegin("txUuid")
	state.TxFinish("anotherUuid", true)
}
コード例 #4
0
ファイル: state_test.go プロジェクト: Colearo/fabric
func TestStateTxWrongCallCausePanic_1(t *testing.T) {
	_, state := createFreshDBAndConstructState(t)
	defer testutil.AssertPanic(t, "A panic should occur when a set state is invoked with out calling a tx-begin")
	state.Set("chaincodeID1", "key1", []byte("value1"))
}