|
|
@ -6,6 +6,8 @@ import ( |
|
|
|
"math/big" |
|
|
|
"math/big" |
|
|
|
"time" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/rlp" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/common" |
|
|
|
"github.com/ethereum/go-ethereum/crypto" |
|
|
|
"github.com/ethereum/go-ethereum/crypto" |
|
|
|
"github.com/ethereum/go-ethereum/log" |
|
|
|
"github.com/ethereum/go-ethereum/log" |
|
|
@ -143,11 +145,13 @@ func (s *Service) getFakeStakingInfo() *proto.StakingContractInfoResponse { |
|
|
|
|
|
|
|
|
|
|
|
// Constructs the staking message
|
|
|
|
// Constructs the staking message
|
|
|
|
func constructStakingMessage(ts types.Transactions) []byte { |
|
|
|
func constructStakingMessage(ts types.Transactions) []byte { |
|
|
|
|
|
|
|
tsBytes, err := rlp.EncodeToBytes(ts) |
|
|
|
|
|
|
|
if err == nil { |
|
|
|
msg := &message.Message{ |
|
|
|
msg := &message.Message{ |
|
|
|
Type: message.MessageType_NEWNODE_BEACON_STAKING, |
|
|
|
Type: message.MessageType_NEWNODE_BEACON_STAKING, |
|
|
|
Request: &message.Message_Staking{ |
|
|
|
Request: &message.Message_Staking{ |
|
|
|
Staking: &message.StakingRequest{ |
|
|
|
Staking: &message.StakingRequest{ |
|
|
|
Transaction: ts.GetRlp(0), |
|
|
|
Transaction: tsBytes, |
|
|
|
NodeId: "", |
|
|
|
NodeId: "", |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -155,7 +159,8 @@ func constructStakingMessage(ts types.Transactions) []byte { |
|
|
|
if data, err := protobuf.Marshal(msg); err == nil { |
|
|
|
if data, err := protobuf.Marshal(msg); err == nil { |
|
|
|
return data |
|
|
|
return data |
|
|
|
} |
|
|
|
} |
|
|
|
utils.GetLogInstance().Error("Error when creating staking message") |
|
|
|
} |
|
|
|
|
|
|
|
utils.GetLogInstance().Error("Error when creating staking message", "error", err) |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|