diff --git a/internal/beaconchain/libs/beaconchain.go b/internal/beaconchain/libs/beaconchain.go index c92833c8c..e36106190 100644 --- a/internal/beaconchain/libs/beaconchain.go +++ b/internal/beaconchain/libs/beaconchain.go @@ -31,9 +31,9 @@ const BeaconchainServicePortDiff = 4444 //BCInfo is the information that needs to be stored on the disk in order to allow for a restart. type BCInfo struct { Leaders []*bcconn.NodeInfo `json:"leaders"` - ShardLeaderMap map[int]*bcconn.NodeInfo `json:"shardleadermap"` - NumberOfShards int `json:"numshards"` - NumberOfNodesAdded int `json:"numnodesadded"` + ShardLeaderMap map[int]*bcconn.NodeInfo `json:"shardLeaderMap"` + NumberOfShards int `json:"numShards"` + NumberOfNodesAdded int `json:"numNodesAdded"` IP string `json:"ip"` Port string `json:"port"` } diff --git a/internal/beaconchain/libs/beaconchain_test.go b/internal/beaconchain/libs/beaconchain_test.go index a180c115f..962539419 100644 --- a/internal/beaconchain/libs/beaconchain_test.go +++ b/internal/beaconchain/libs/beaconchain_test.go @@ -26,7 +26,7 @@ var ( func TestNewNode(t *testing.T) { var ip, port string ip = "127.0.0.1" - port = "8080" + port = "7523" numshards := 2 bc := New(numshards, ip, port) @@ -46,7 +46,7 @@ func TestNewNode(t *testing.T) { func TestShardLeaderMap(t *testing.T) { var ip string ip = "127.0.0.1" - beaconport := "8080" + beaconport := "7523" numshards := 1 bc := New(numshards, ip, beaconport) bc.BCInfo.Leaders = leaders @@ -59,7 +59,7 @@ func TestShardLeaderMap(t *testing.T) { func TestFetchLeaders(t *testing.T) { var ip string ip = "127.0.0.1" - beaconport := "8080" + beaconport := "7523" numshards := 1 bc := New(numshards, ip, beaconport) bc.BCInfo.Leaders = leaders @@ -78,7 +78,7 @@ func TestFetchLeaders(t *testing.T) { func TestAcceptNodeInfo(t *testing.T) { var ip string ip = "127.0.0.1" - beaconport := "8080" + beaconport := "7523" numshards := 1 bc := New(numshards, ip, beaconport) b := bcconn.SerializeNodeInfo(leader1) @@ -95,7 +95,7 @@ func TestAcceptNodeInfo(t *testing.T) { func TestRespondRandomness(t *testing.T) { var ip string ip = "127.0.0.1" - beaconport := "8080" + beaconport := "7523" numshards := 1 bc := New(numshards, ip, beaconport) bc.RespondRandomness(leader1) @@ -105,7 +105,7 @@ func TestRespondRandomness(t *testing.T) { func TestAcceptConnections(t *testing.T) { var ip string ip = "127.0.0.1" - beaconport := "8080" + beaconport := "7523" numshards := 1 bc := New(numshards, ip, beaconport) b := bcconn.SerializeNodeInfo(leader1) @@ -114,10 +114,9 @@ func TestAcceptConnections(t *testing.T) { } func TestSaveBC(t *testing.T) { - var ip, port string ip = "127.0.0.1" - port = "8080" + port = "7523" numshards := 2 bci := &BCInfo{IP: ip, Port: port, NumberOfShards: numshards} bc := &BeaconChain{BCInfo: *bci}