From c47f826db5c0429fc037e7e0c44ca22e8bfa17a0 Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Mon, 25 Feb 2019 14:21:41 -0800 Subject: [PATCH] add faking info for staking --- api/service/staking/service.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/api/service/staking/service.go b/api/service/staking/service.go index 8c7de6511..f4650290b 100644 --- a/api/service/staking/service.go +++ b/api/service/staking/service.go @@ -129,6 +129,16 @@ func (s *Service) getStakingInfo() *proto.StakingContractInfoResponse { } } +func (s *Service) getFakeStakingInfo() *proto.StakingContractInfoResponse { + balance := big.NewInt(params.Ether) + nonce := uint64(0) + return &proto.StakingContractInfoResponse{ + ContractAddress: StakingContractAddress, + Balance: balance.Bytes(), + Nonce: nonce, + } +} + // Constructs the staking message func constructStakingMessage(ts types.Transactions) []byte { msg := &message.Message{ @@ -148,7 +158,8 @@ func constructStakingMessage(ts types.Transactions) []byte { } func (s *Service) createRawStakingMessage() []byte { - stakingInfo := s.getStakingInfo() + // TODO(minhdoan): Enable getStakingInfo back after testing. + stakingInfo := s.getFakeStakingInfo() toAddress := common.HexToAddress(stakingInfo.ContractAddress) tx := types.NewTransaction( stakingInfo.Nonce,