|
|
@ -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,19 +145,22 @@ 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 { |
|
|
|
msg := &message.Message{ |
|
|
|
tsBytes, err := rlp.EncodeToBytes(ts) |
|
|
|
Type: message.MessageType_NEWNODE_BEACON_STAKING, |
|
|
|
if err == nil { |
|
|
|
Request: &message.Message_Staking{ |
|
|
|
msg := &message.Message{ |
|
|
|
Staking: &message.StakingRequest{ |
|
|
|
Type: message.MessageType_NEWNODE_BEACON_STAKING, |
|
|
|
Transaction: ts.GetRlp(0), |
|
|
|
Request: &message.Message_Staking{ |
|
|
|
NodeId: "", |
|
|
|
Staking: &message.StakingRequest{ |
|
|
|
|
|
|
|
Transaction: tsBytes, |
|
|
|
|
|
|
|
NodeId: "", |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
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 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|