Skip to content

Commit

Permalink
[project] More Spring Cleaning (#2751)
Browse files Browse the repository at this point in the history
* [project] Remove hmyclient

* [drand] Remove dead drand

* [drand] Remove dead code in proto, more dead drand things

* [project] Remove dead demo tool

* [project] Remove dead Lottery solidity

* [project] Remove dead hmy client main

* [node] Remove unused variable in test code

* [project] Remove keygen

* [project] Remove not useful test
  • Loading branch information
fxfactorial authored Apr 6, 2020
1 parent ba1c0cd commit a7b7961
Show file tree
Hide file tree
Showing 31 changed files with 87 additions and 2,896 deletions.
13 changes: 0 additions & 13 deletions api/client/client_test.go

This file was deleted.

25 changes: 0 additions & 25 deletions api/proto/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const (
Consensus MessageCategory = iota
Node
Client
DRand
// TODO: add more types
)

const (
Expand Down Expand Up @@ -75,32 +73,9 @@ func GetConsensusMessagePayload(message []byte) ([]byte, error) {
return message[MessageCategoryBytes:], nil
}

// GetDRandMessagePayload gets the randomness message payload from the p2p message content
func GetDRandMessagePayload(message []byte) ([]byte, error) {
if len(message) < MessageCategoryBytes {
return []byte{}, errors.New("failed to get message payload: no data available")
}
return message[MessageCategoryBytes:], nil
}

// GetStakingMessagePayload gets the staking message payload from the p2p message content
func GetStakingMessagePayload(message []byte) ([]byte, error) {
if len(message) < MessageCategoryBytes {
return []byte{}, errors.New("failed to get message payload: no data available")
}
return message[MessageCategoryBytes:], nil
}

// ConstructConsensusMessage creates a message with the payload and returns as byte array.
func ConstructConsensusMessage(payload []byte) []byte {
byteBuffer := bytes.NewBuffer([]byte{byte(Consensus)})
byteBuffer.Write(payload)
return byteBuffer.Bytes()
}

// ConstructDRandMessage creates a message with the payload and returns as byte array.
func ConstructDRandMessage(payload []byte) []byte {
byteBuffer := bytes.NewBuffer([]byte{byte(DRand)})
byteBuffer.Write(payload)
return byteBuffer.Bytes()
}
23 changes: 0 additions & 23 deletions api/proto/message/client_test.go

This file was deleted.

Loading

0 comments on commit a7b7961

Please sign in to comment.