move drand to common_roles & fix mock randomness override
This commit is contained in:
parent
3f15146c19
commit
fda66f5bd9
@ -238,15 +238,3 @@ func extractCarData(ctx context.Context, rdata []byte, rpath string) []byte {
|
||||
return rdata
|
||||
}
|
||||
|
||||
func runDrandNode(t *TestEnvironment) error {
|
||||
t.RecordMessage("running drand node")
|
||||
_, err := prepareDrandNode(t)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO add ability to halt / recover on demand
|
||||
ctx := context.Background()
|
||||
t.SyncClient.MustSignalAndWait(ctx, stateDone, t.TestInstanceCount)
|
||||
return nil
|
||||
}
|
||||
|
@ -66,3 +66,16 @@ func runMiner(t *TestEnvironment) error {
|
||||
t.SyncClient.MustSignalAndWait(ctx, stateDone, t.TestInstanceCount)
|
||||
return nil
|
||||
}
|
||||
|
||||
func runDrandNode(t *TestEnvironment) error {
|
||||
t.RecordMessage("running drand node")
|
||||
_, err := prepareDrandNode(t)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO add ability to halt / recover on demand
|
||||
ctx := context.Background()
|
||||
t.SyncClient.MustSignalAndWait(ctx, stateDone, t.TestInstanceCount)
|
||||
return nil
|
||||
}
|
||||
|
@ -693,7 +693,13 @@ func getDrandConfig(ctx context.Context, t *TestEnvironment) (node.Option, error
|
||||
), nil
|
||||
|
||||
case "mock":
|
||||
return node.Override(new(beacon.RandomBeacon), modtest.RandomBeacon), nil
|
||||
return node.Options(
|
||||
node.Override(new(beacon.RandomBeacon), modtest.RandomBeacon),
|
||||
node.Override(new(dtypes.DrandConfig), dtypes.DrandConfig{
|
||||
ChainInfoJSON: "{\"Hash\":\"wtf\"}",
|
||||
}),
|
||||
node.Override(new(dtypes.DrandBootstrap), dtypes.DrandBootstrap{}),
|
||||
), nil
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown random_beacon_type: %s", beaconType)
|
||||
|
Loading…
Reference in New Issue
Block a user