Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
adjust for requestrand msg
Browse files Browse the repository at this point in the history
  • Loading branch information
weichang-x committed Sep 3, 2020
1 parent c1a48f1 commit d1af2d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions msg/random/rand.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package random

import (
types "github.com/irisnet/irishub-sync/types"
"github.com/irisnet/irishub-sync/types"
"github.com/irisnet/irishub-sync/util/constant"
"github.com/irisnet/irishub-sync/store"
)

type DocTxMsgRequestRand struct {
Consumer string `bson:"consumer"` // request address
BlockInterval uint64 `bson:"block_interval"` // block interval after which the requested random number will be generated
Consumer string `bson:"consumer"` // request address
BlockInterval uint64 `bson:"block_interval"` // block interval after which the requested random number will be generated
Oracle bool `bson:"oracle"`
ServiceFeeCap store.Coins `bson:"service_fee_cap"`
}

func (doctx *DocTxMsgRequestRand) Type() string {
Expand All @@ -18,4 +21,6 @@ func (doctx *DocTxMsgRequestRand) BuildMsg(txMsg interface{}) {
msg := txMsg.(types.MsgRequestRandom)
doctx.Consumer = msg.Consumer.String()
doctx.BlockInterval = msg.BlockInterval
doctx.Oracle = msg.Oracle
doctx.ServiceFeeCap = types.ParseCoins(msg.ServiceFeeCap.String())
}
2 changes: 1 addition & 1 deletion service/task/task_execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func Test_parseBlock(t *testing.T) {
name: "test parse block",
args: args{
client: client,
b: 1001,
b: 601,
},
},
}
Expand Down

0 comments on commit d1af2d8

Please sign in to comment.