@@ -23,6 +23,7 @@ type Input struct {
2323 HTTPPortRangeStart int `toml:"http_port_range_start"`
2424 P2PPortRangeStart int `toml:"p2p_port_range_start"`
2525 OverrideMode string `toml:"override_mode" validate:"required,oneof=all each"`
26+ DbInput * postgres.Input `toml:"db" validate:"required"`
2627 NodeSpecs []* clnode.Input `toml:"node_specs" validate:"required"`
2728 Out * Output `toml:"out"`
2829}
@@ -35,7 +36,7 @@ type Output struct {
3536
3637// NewSharedDBNodeSet create a new node set with a shared database instance
3738// all the nodes have their own isolated database
38- func NewSharedDBNodeSet (in * Input , bcOut * blockchain.Output , fakeUrl string ) (* Output , error ) {
39+ func NewSharedDBNodeSet (in * Input , bcOut * blockchain.Output ) (* Output , error ) {
3940 if in .Out != nil && in .Out .UseCache {
4041 return in .Out , nil
4142 }
@@ -50,7 +51,7 @@ func NewSharedDBNodeSet(in *Input, bcOut *blockchain.Output, fakeUrl string) (*O
5051 if len (in .NodeSpecs ) != in .Nodes && in .OverrideMode == "each" {
5152 return nil , fmt .Errorf ("amount of 'nodes' must be equal to specs provided in override_mode='each'" )
5253 }
53- out , err = sharedDBSetup (in , bcOut , fakeUrl )
54+ out , err = sharedDBSetup (in , bcOut )
5455 if err != nil {
5556 return nil , err
5657 }
@@ -72,9 +73,9 @@ func printURLs(out *Output) {
7273 framework .L .Debug ().Any ("DB" , pgURLs ).Send ()
7374}
7475
75- func sharedDBSetup (in * Input , bcOut * blockchain.Output , fakeUrl string ) (* Output , error ) {
76- in .NodeSpecs [ 0 ]. DbInput .Databases = in .Nodes
77- dbOut , err := postgres .NewPostgreSQL (in .NodeSpecs [ 0 ]. DbInput )
76+ func sharedDBSetup (in * Input , bcOut * blockchain.Output ) (* Output , error ) {
77+ in .DbInput .Databases = in .Nodes
78+ dbOut , err := postgres .NewPostgreSQL (in .DbInput )
7879 if err != nil {
7980 return nil , err
8081 }
@@ -122,8 +123,7 @@ func sharedDBSetup(in *Input, bcOut *blockchain.Output, fakeUrl string) (*Output
122123 }
123124
124125 nodeSpec := & clnode.Input {
125- DataProviderURL : fakeUrl ,
126- DbInput : in .NodeSpecs [overrideIdx ].DbInput ,
126+ DbInput : in .DbInput ,
127127 Node : & clnode.NodeInput {
128128 HTTPPort : httpPortRangeStart + i ,
129129 P2PPort : p2pPortRangeStart + i ,
0 commit comments