From d1af2d878a2318d2c7d510799f4e92d996c3e556 Mon Sep 17 00:00:00 2001 From: huangweichang Date: Thu, 3 Sep 2020 11:26:50 +0800 Subject: [PATCH] adjust for requestrand msg --- msg/random/rand.go | 11 ++++++++--- service/task/task_execute_test.go | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/msg/random/rand.go b/msg/random/rand.go index de2849c..7c2ed92 100644 --- a/msg/random/rand.go +++ b/msg/random/rand.go @@ -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 { @@ -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()) } diff --git a/service/task/task_execute_test.go b/service/task/task_execute_test.go index e21ae8c..c5d3803 100644 --- a/service/task/task_execute_test.go +++ b/service/task/task_execute_test.go @@ -108,7 +108,7 @@ func Test_parseBlock(t *testing.T) { name: "test parse block", args: args{ client: client, - b: 1001, + b: 601, }, }, }