Skip to content

Commit

Permalink
Merge pull request #1815 from dedis/work-be1-etienne-stuart-database
Browse files Browse the repository at this point in the history
[BE1] Refactor and Database
  • Loading branch information
sgueissa committed May 15, 2024
2 parents 5b6c4d7 + dbdc717 commit 2db8b47
Show file tree
Hide file tree
Showing 92 changed files with 11,243 additions and 231 deletions.
4 changes: 2 additions & 2 deletions be1-go/channel/authentication/authentication_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ type fakeHub struct {
// newFakeHub returns a fake Hub.
func newFakeHub(publicOrg kyber.Point, log zerolog.Logger, laoFac channel.LaoFactory) (*fakeHub, error) {

schemaValidator, err := validation.NewSchemaValidator(log)
schemaValidator, err := validation.NewSchemaValidator()
if err != nil {
return nil, xerrors.Errorf("failed to create the schema validator: %v", err)
}
Expand Down Expand Up @@ -285,7 +285,7 @@ func (h *fakeHub) Sign(data []byte) ([]byte, error) {
func (h *fakeHub) NotifyWitnessMessage(_ string, _ string, _ string) {}

// GetPeersInfo implements channel.HubFunctionalities
func (h *fakeHub) GetPeersInfo() []method.ServerInfo {
func (h *fakeHub) GetPeersInfo() []method.GreetServerParams {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion be1-go/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type HubFunctionalities interface {
SendAndHandleMessage(method.Broadcast) error
NotifyWitnessMessage(messageId string, publicKey string, signature string)
GetClientServerAddress() string
GetPeersInfo() []method.ServerInfo
GetPeersInfo() []method.GreetServerParams
}

// Broadcastable defines a channel that can broadcast
Expand Down
4 changes: 2 additions & 2 deletions be1-go/channel/chirp/chirp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ type fakeHub struct {
// NewFakeHub returns a fake Hub.
func NewFakeHub(publicOrg kyber.Point, log zerolog.Logger, laoFac channel.LaoFactory) (*fakeHub, error) {

schemaValidator, err := validation.NewSchemaValidator(log)
schemaValidator, err := validation.NewSchemaValidator()
if err != nil {
return nil, xerrors.Errorf("failed to create the schema validator: %v", err)
}
Expand Down Expand Up @@ -626,7 +626,7 @@ func (h *fakeHub) Sign(data []byte) ([]byte, error) {
func (h *fakeHub) NotifyWitnessMessage(messageId string, publicKey string, signature string) {}

// GetPeersInfo implements channel.HubFunctionalities
func (h *fakeHub) GetPeersInfo() []method.ServerInfo {
func (h *fakeHub) GetPeersInfo() []method.GreetServerParams {
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions be1-go/channel/coin/coin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ type fakeHub struct {
// NewFakeHub returns a fake Hub.
func NewFakeHub(publicOrg kyber.Point, log zerolog.Logger, laoFac channel.LaoFactory) (*fakeHub, error) {

schemaValidator, err := validation.NewSchemaValidator(log)
schemaValidator, err := validation.NewSchemaValidator()
if err != nil {
return nil, xerrors.Errorf("failed to create the schema validator: %v", err)
}
Expand Down Expand Up @@ -811,7 +811,7 @@ func (h *fakeHub) Sign(data []byte) ([]byte, error) {
func (h *fakeHub) NotifyWitnessMessage(messageId string, publicKey string, signature string) {}

// GetPeersInfo implements channel.HubFunctionalities
func (h *fakeHub) GetPeersInfo() []method.ServerInfo {
func (h *fakeHub) GetPeersInfo() []method.GreetServerParams {
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions be1-go/channel/consensus/consensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,7 @@ type fakeHub struct {
// NewFakeHub returns a fake Hub.
func NewFakeHub(pubKeyOwner kyber.Point, log zerolog.Logger, laoFac channel.LaoFactory) (*fakeHub, error) {

schemaValidator, err := validation.NewSchemaValidator(log)
schemaValidator, err := validation.NewSchemaValidator()
if err != nil {
return nil, xerrors.Errorf("failed to create the schema validator: %v", err)
}
Expand Down Expand Up @@ -2017,7 +2017,7 @@ func (h *fakeHub) Sign(data []byte) ([]byte, error) {
func (h *fakeHub) NotifyWitnessMessage(messageId string, publicKey string, signature string) {}

// GetPeersInfo implements channel.HubFunctionalities
func (h *fakeHub) GetPeersInfo() []method.ServerInfo {
func (h *fakeHub) GetPeersInfo() []method.GreetServerParams {
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions be1-go/channel/election/election_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ type fakeHub struct {
// NewFakeHub returns a fake Hub.
func NewFakeHub(publicOrg kyber.Point, log zerolog.Logger, laoFac channel.LaoFactory) (*fakeHub, error) {

schemaValidator, err := validation.NewSchemaValidator(log)
schemaValidator, err := validation.NewSchemaValidator()
if err != nil {
return nil, xerrors.Errorf("failed to create the schema validator: %v", err)
}
Expand Down Expand Up @@ -754,7 +754,7 @@ func (h *fakeHub) Sign(data []byte) ([]byte, error) {
func (h *fakeHub) NotifyWitnessMessage(messageId string, publicKey string, signature string) {}

// GetPeersInfo implements channel.HubFunctionalities
func (h *fakeHub) GetPeersInfo() []method.ServerInfo {
func (h *fakeHub) GetPeersInfo() []method.GreetServerParams {
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions be1-go/channel/generalChirping/generalChirping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ type fakeHub struct {
// NewFakeHub returns a fake Hub.
func NewFakeHub(publicOrg kyber.Point, log zerolog.Logger, laoFac channel.LaoFactory) (*fakeHub, error) {

schemaValidator, err := validation.NewSchemaValidator(log)
schemaValidator, err := validation.NewSchemaValidator()
if err != nil {
return nil, xerrors.Errorf("failed to create the schema validator: %v", err)
}
Expand Down Expand Up @@ -278,7 +278,7 @@ func (h *fakeHub) Sign(data []byte) ([]byte, error) {
func (h *fakeHub) NotifyWitnessMessage(messageId string, publicKey string, signature string) {}

// GetPeersInfo implements channel.HubFunctionalities
func (h *fakeHub) GetPeersInfo() []method.ServerInfo {
func (h *fakeHub) GetPeersInfo() []method.GreetServerParams {
return nil
}

Expand Down
10 changes: 5 additions & 5 deletions be1-go/channel/lao/lao_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ type fakeHub struct {
// NewFakeHub returns a fake Hub.
func NewFakeHub(clientAddress string, publicOrg kyber.Point, log zerolog.Logger, laoFac channel.LaoFactory) (*fakeHub, error) {

schemaValidator, err := validation.NewSchemaValidator(log)
schemaValidator, err := validation.NewSchemaValidator()
if err != nil {
return nil, xerrors.Errorf("failed to create the schema validator: %v", err)
}
Expand Down Expand Up @@ -809,19 +809,19 @@ func (h *fakeHub) Sign(data []byte) ([]byte, error) {
func (h *fakeHub) NotifyWitnessMessage(messageId string, publicKey string, signature string) {}

// GetPeersInfo implements channel.HubFunctionalities
func (h *fakeHub) GetPeersInfo() []method.ServerInfo {
peer1 := method.ServerInfo{
func (h *fakeHub) GetPeersInfo() []method.GreetServerParams {
peer1 := method.GreetServerParams{
PublicKey: "",
ClientAddress: "wss://localhost:9002/client",
ServerAddress: "",
}

peer2 := method.ServerInfo{
peer2 := method.GreetServerParams{
PublicKey: "",
ClientAddress: "wss://localhost:9004/client",
ServerAddress: "",
}
return []method.ServerInfo{peer1, peer2}
return []method.GreetServerParams{peer1, peer2}
}

func (h *fakeHub) GetSchemaValidator() validation.SchemaValidator {
Expand Down
4 changes: 2 additions & 2 deletions be1-go/channel/reaction/reaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ type fakeHub struct {
// NewFakeHub returns a fake Hub.
func NewFakeHub(publicOrg kyber.Point, log zerolog.Logger, laoFac channel.LaoFactory) (*fakeHub, error) {

schemaValidator, err := validation.NewSchemaValidator(log)
schemaValidator, err := validation.NewSchemaValidator()
if err != nil {
return nil, xerrors.Errorf("failed to create the schema validator: %v", err)
}
Expand Down Expand Up @@ -670,7 +670,7 @@ func (h *fakeHub) Sign(data []byte) ([]byte, error) {
func (h *fakeHub) NotifyWitnessMessage(messageId string, publicKey string, signature string) {}

// GetPeersInfo implements channel.HubFunctionalities
func (h *fakeHub) GetPeersInfo() []method.ServerInfo {
func (h *fakeHub) GetPeersInfo() []method.GreetServerParams {
return nil
}

Expand Down
Loading

0 comments on commit 2db8b47

Please sign in to comment.