From f04bae3f0b3e6385fee5b019355e327a284ce381 Mon Sep 17 00:00:00 2001 From: Darko Brdareski Date: Fri, 10 Dec 2021 11:41:24 +0100 Subject: [PATCH] Annotate rand_test --- chain/rand/rand_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/chain/rand/rand_test.go b/chain/rand/rand_test.go index 5e5dae3f1..b5e2482b7 100644 --- a/chain/rand/rand_test.go +++ b/chain/rand/rand_test.go @@ -1,3 +1,4 @@ +//stm:#unit package rand_test import ( @@ -55,11 +56,13 @@ func TestNullRandomnessV1(t *testing.T) { randEpoch := ts.TipSet.TipSet().Height() - 2 + //stm: @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_V1_01, @BLOCKCHAIN_RAND_EXTRACT_BEACON_ENTRY_FOR_EPOCH_01, @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_TIPSET_02 rand1, err := cg.StateManager().GetRandomnessFromBeacon(ctx, pers, randEpoch, entropy, ts.TipSet.TipSet().Key()) if err != nil { t.Fatal(err) } + //stm: @BLOCKCHAIN_BEACON_GET_BEACON_FOR_EPOCH_01 bch := cg.BeaconSchedule().BeaconForEpoch(randEpoch).Entry(ctx, uint64(beforeNullHeight)+offset) select { @@ -68,6 +71,7 @@ func TestNullRandomnessV1(t *testing.T) { t.Fatal(resp.Err) } + //stm: @BLOCKCHAIN_RAND_DRAW_RANDOMNESS_01 rand2, err := rand.DrawRandomness(resp.Entry.Data, pers, randEpoch, entropy) if err != nil { t.Fatal(err) @@ -131,11 +135,13 @@ func TestNullRandomnessV2(t *testing.T) { randEpoch := ts.TipSet.TipSet().Height() - 2 + //stm: @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_V2_01 rand1, err := cg.StateManager().GetRandomnessFromBeacon(ctx, pers, randEpoch, entropy, ts.TipSet.TipSet().Key()) if err != nil { t.Fatal(err) } + //stm: @BLOCKCHAIN_BEACON_GET_BEACON_FOR_EPOCH_01 bch := cg.BeaconSchedule().BeaconForEpoch(randEpoch).Entry(ctx, uint64(ts.TipSet.TipSet().Height())+offset) select { @@ -144,6 +150,7 @@ func TestNullRandomnessV2(t *testing.T) { t.Fatal(resp.Err) } + //stm: @BLOCKCHAIN_RAND_DRAW_RANDOMNESS_01, @BLOCKCHAIN_RAND_EXTRACT_BEACON_ENTRY_FOR_EPOCH_01, @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_TIPSET_03 // note that the randEpoch passed to DrawRandomness is still randEpoch (not the latest ts height) rand2, err := rand.DrawRandomness(resp.Entry.Data, pers, randEpoch, entropy) if err != nil { @@ -212,11 +219,13 @@ func TestNullRandomnessV3(t *testing.T) { randEpoch := ts.TipSet.TipSet().Height() - 2 + //stm: @BLOCKCHAIN_RAND_GET_BEACON_RANDOMNESS_V3_01, @BLOCKCHAIN_RAND_EXTRACT_BEACON_ENTRY_FOR_EPOCH_01 rand1, err := cg.StateManager().GetRandomnessFromBeacon(ctx, pers, randEpoch, entropy, ts.TipSet.TipSet().Key()) if err != nil { t.Fatal(err) } + //stm: @BLOCKCHAIN_BEACON_GET_BEACON_FOR_EPOCH_01 bch := cg.BeaconSchedule().BeaconForEpoch(randEpoch).Entry(ctx, uint64(randEpoch)+offset) select { @@ -225,6 +234,7 @@ func TestNullRandomnessV3(t *testing.T) { t.Fatal(resp.Err) } + //stm: @BLOCKCHAIN_RAND_DRAW_RANDOMNESS_01 rand2, err := rand.DrawRandomness(resp.Entry.Data, pers, randEpoch, entropy) if err != nil { t.Fatal(err)