Commit b35ffc11 authored by 张振华's avatar 张振华

linter

parent ca870478
......@@ -139,7 +139,7 @@ func guessBet(cmd *cobra.Command, args []string) {
fee, _ := cmd.Flags().GetFloat64("fee")
params := &pkt.GuessBetTxReq{
GameId: gameID,
GameID: gameID,
Option: option,
Bets: betsNumber,
Fee: int64(fee * float64(1e8)),
......@@ -173,7 +173,7 @@ func guessStopBet(cmd *cobra.Command, args []string) {
fee, _ := cmd.Flags().GetFloat64("fee")
params := &pkt.GuessStopBetTxReq{
GameId: gameID,
GameID: gameID,
Fee: int64(fee * float64(1e8)),
}
......@@ -204,7 +204,7 @@ func guessAbort(cmd *cobra.Command, args []string) {
gameID, _ := cmd.Flags().GetString("gameId")
fee, _ := cmd.Flags().GetFloat64("fee")
params := &pkt.GuessAbortTxReq{
GameId: gameID,
GameID: gameID,
Fee: int64(fee * float64(1e8)),
}
......@@ -241,7 +241,7 @@ func guessPublish(cmd *cobra.Command, args []string) {
fee, _ := cmd.Flags().GetFloat64("fee")
params := &pkt.GuessPublishTxReq{
GameId: gameID,
GameID: gameID,
Result: result,
Fee: int64(fee * float64(1e8)),
}
......@@ -300,7 +300,7 @@ func guessQuery(cmd *cobra.Command, args []string) {
case 1:
gameIds := strings.Split(gameIDs, ";")
req := &pkt.QueryGuessGameInfos{
GameIds: gameIds,
GameIDs: gameIds,
}
params.FuncName = pkt.FuncName_QueryGamesByIds
params.Payload = types.MustPBToJSON(req)
......@@ -310,7 +310,7 @@ func guessQuery(cmd *cobra.Command, args []string) {
case 2:
req := &pkt.QueryGuessGameInfo{
GameId: gameID,
GameID: gameID,
}
params.FuncName = pkt.FuncName_QueryGameById
params.Payload = types.MustPBToJSON(req)
......
......@@ -24,9 +24,9 @@ func (g *Guess) rollbackIndex(log *pkt.ReceiptGuessGame) (kvs []*types.KeyValue)
//如果发生了状态变化,恢复老状态的记录,删除新添加的状态记录
if log.StatusChange {
kvs = append(kvs, addGuessGameStatusIndexKey(log.PreStatus, log.GameId, log.PreIndex))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.GameId, log.PreIndex))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.GameId, log.PreIndex))
kvs = append(kvs, addGuessGameStatusIndexKey(log.PreStatus, log.GameID, log.PreIndex))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.GameID, log.PreIndex))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.GameID, log.PreIndex))
kvs = append(kvs, delGuessGameStatusIndexKey(log.Status, log.Index))
kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.Index))
......@@ -34,20 +34,20 @@ func (g *Guess) rollbackIndex(log *pkt.ReceiptGuessGame) (kvs []*types.KeyValue)
}
} else if log.StatusChange {
//其他状态时的状态发生变化的情况,要将老状态对应的记录恢复,同时删除新加的状态记录;对于每个地址的下注记录也需要遍历处理。
kvs = append(kvs, addGuessGameStatusIndexKey(log.PreStatus, log.GameId, log.PreIndex))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.GameId, log.PreIndex))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.GameId, log.PreIndex))
kvs = append(kvs, addGuessGameStatusIndexKey(log.PreStatus, log.GameID, log.PreIndex))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.GameID, log.PreIndex))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.GameID, log.PreIndex))
kvs = append(kvs, delGuessGameStatusIndexKey(log.Status, log.Index))
kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.Index))
kvs = append(kvs, delGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.Index))
//从game中遍历每个地址的记录进行删除新增记录,回复老记录
game, err := readGame(g.GetStateDB(), log.GameId)
game, err := readGame(g.GetStateDB(), log.GameID)
if err == nil {
for i := 0; i < len(game.Plays); i++ {
player := game.Plays[i]
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.PreStatus, player.Addr, log.GameId, player.Bet.PreIndex))
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.PreStatus, player.Addr, log.GameID, player.Bet.PreIndex))
kvs = append(kvs, delGuessGameAddrStatusIndexKey(log.Status, player.Addr, log.Index))
}
}
......
......@@ -13,19 +13,19 @@ func (g *Guess) updateIndex(log *pkt.ReceiptGuessGame) (kvs []*types.KeyValue) {
//新创建游戏
if log.Status == pkt.GuessGameStatusStart {
//kvs = append(kvs, addGuessGameAddrIndexKey(log.Status, log.Addr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAdminIndexKey(log.Status, log.AdminAddr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.GameId, log.Index))
kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameID, log.Index))
kvs = append(kvs, addGuessGameAdminIndexKey(log.Status, log.AdminAddr, log.GameID, log.Index))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.GameID, log.Index))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.GameID, log.Index))
} else if log.Status == pkt.GuessGameStatusBet {
//如果是下注状态,则有用户进行了下注操作
kvs = append(kvs, addGuessGameAddrIndexKey(log.Status, log.Addr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.Status, log.Addr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAddrIndexKey(log.Status, log.Addr, log.GameID, log.Index))
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.Status, log.Addr, log.GameID, log.Index))
//如果发生了状态变化,则是从start->bet,对于老状态的记录进行删除操作,并增加新状态记录
if log.StatusChange {
kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.GameId, log.Index))
kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameID, log.Index))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.GameID, log.Index))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.GameID, log.Index))
kvs = append(kvs, delGuessGameStatusIndexKey(log.PreStatus, log.PreIndex))
kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.PreIndex))
......@@ -33,20 +33,20 @@ func (g *Guess) updateIndex(log *pkt.ReceiptGuessGame) (kvs []*types.KeyValue) {
}
} else if log.StatusChange {
//其他状态时的状态发生变化,要将老状态对应的记录删除,同时加入新状态记录;对于每个地址的下注记录也需要遍历处理。
kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.GameId, log.Index))
kvs = append(kvs, addGuessGameStatusIndexKey(log.Status, log.GameID, log.Index))
kvs = append(kvs, addGuessGameAdminStatusIndexKey(log.Status, log.AdminAddr, log.GameID, log.Index))
kvs = append(kvs, addGuessGameCategoryStatusIndexKey(log.Status, log.Category, log.GameID, log.Index))
kvs = append(kvs, delGuessGameStatusIndexKey(log.PreStatus, log.PreIndex))
kvs = append(kvs, delGuessGameAdminStatusIndexKey(log.PreStatus, log.AdminAddr, log.PreIndex))
kvs = append(kvs, delGuessGameCategoryStatusIndexKey(log.PreStatus, log.Category, log.PreIndex))
//从game中遍历每个地址的记录进行新状态记录的增和老状态记录的删除
game, err := readGame(g.GetStateDB(), log.GameId)
game, err := readGame(g.GetStateDB(), log.GameID)
if err == nil {
for i := 0; i < len(game.Plays); i++ {
player := game.Plays[i]
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.Status, player.Addr, log.GameId, log.Index))
kvs = append(kvs, addGuessGameAddrStatusIndexKey(log.Status, player.Addr, log.GameID, log.Index))
kvs = append(kvs, delGuessGameAddrStatusIndexKey(log.PreStatus, player.Addr, player.Bet.PreIndex))
}
}
......
......@@ -139,8 +139,8 @@ func readGame(db dbm.KV, id string) (*pkt.GuessGame, error) {
//Infos 根据游戏id列表查询多个游戏详情信息
func Infos(db dbm.KV, infos *pkt.QueryGuessGameInfos) (types.Message, error) {
var games []*pkt.GuessGame
for i := 0; i < len(infos.GameIds); i++ {
id := infos.GameIds[i]
for i := 0; i < len(infos.GameIDs); i++ {
id := infos.GameIDs[i]
game, err := readGame(db, id)
if err != nil {
return nil, err
......@@ -302,8 +302,8 @@ func getGameListByCategoryStatus(db dbm.Lister, category string, status int32, i
func (action *Action) saveGame(game *pkt.GuessGame) (kvset []*types.KeyValue) {
value := types.Encode(game)
action.db.Set(Key(game.GetGameId()), value)
kvset = append(kvset, &types.KeyValue{Key: Key(game.GameId), Value: value})
action.db.Set(Key(game.GetGameID()), value)
kvset = append(kvset, &types.KeyValue{Key: Key(game.GameID), Value: value})
return kvset
}
......@@ -331,7 +331,7 @@ func (action *Action) GetReceiptLog(game *pkt.GuessGame, statusChange bool) *typ
}
r.Index = game.Index
r.GameId = game.GameId
r.GameID = game.GameID
r.Status = game.Status
r.AdminAddr = game.AdminAddr
r.PreStatus = game.PreStatus
......@@ -359,7 +359,7 @@ func (action *Action) readGame(id string) (*pkt.GuessGame, error) {
// 新建一局游戏
func (action *Action) newGame(gameID string, start *pkt.GuessGameStart) (*pkt.GuessGame, error) {
game := &pkt.GuessGame{
GameId: gameID,
GameID: gameID,
Status: pkt.GuessGameActionStart,
//StartTime: action.blocktime,
StartTxHash: gameID,
......@@ -468,10 +468,10 @@ func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) {
var logs []*types.ReceiptLog
var kv []*types.KeyValue
game, err := action.readGame(pbBet.GetGameId())
game, err := action.readGame(pbBet.GetGameID())
if err != nil {
logger.Error("GameBet", "addr", action.fromaddr, "execaddr", action.execaddr, "get game failed",
pbBet.GetGameId(), "err", err)
pbBet.GetGameID(), "err", err)
return nil, err
}
......@@ -484,7 +484,7 @@ func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) {
canBet := action.RefreshStatusByTime(game)
if canBet == false {
if !canBet {
var receiptLog *types.ReceiptLog
if prevStatus != game.Status {
//状态发生了变化,且是变到了不可下注的状态,那么对于所有下注的addr来说,其addr:status主键的数据都需要更新
......@@ -529,7 +529,7 @@ func (action *Action) GameBet(pbBet *pkt.GuessGameBet) (*types.Receipt, error) {
checkValue := pbBet.BetsNum
if !action.CheckExecAccountBalance(action.fromaddr, checkValue, 0) {
logger.Error("GameBet", "addr", action.fromaddr, "execaddr", action.execaddr, "id",
pbBet.GetGameId(), "err", types.ErrNoBalance)
pbBet.GetGameID(), "err", types.ErrNoBalance)
return nil, types.ErrNoBalance
}
......@@ -562,10 +562,10 @@ func (action *Action) GameStopBet(pbBet *pkt.GuessGameStopBet) (*types.Receipt,
var logs []*types.ReceiptLog
var kv []*types.KeyValue
game, err := action.readGame(pbBet.GetGameId())
game, err := action.readGame(pbBet.GetGameID())
if err != nil {
logger.Error("GameStopBet", "addr", action.fromaddr, "execaddr", action.execaddr, "get game failed",
pbBet.GetGameId(), "err", err)
pbBet.GetGameID(), "err", err)
return nil, err
}
......@@ -622,10 +622,10 @@ func (action *Action) GamePublish(publish *pkt.GuessGamePublish) (*types.Receipt
var logs []*types.ReceiptLog
var kv []*types.KeyValue
game, err := action.readGame(publish.GetGameId())
game, err := action.readGame(publish.GetGameID())
if err != nil {
logger.Error("GamePublish", "addr", action.fromaddr, "execaddr", action.execaddr, "get game failed",
publish.GetGameId(), "err", err)
publish.GetGameID(), "err", err)
return nil, err
}
......@@ -706,7 +706,7 @@ func (action *Action) GamePublish(publish *pkt.GuessGamePublish) (*types.Receipt
}
if game.DevFeeFactor > 0 {
devFee = int64(totalBetsNumber) * game.DevFeeFactor / 1000
devFee = totalBetsNumber * game.DevFeeFactor / 1000
receipt, err := action.coinsAccount.ExecTransfer(game.AdminAddr, devAddr, action.execaddr, devFee)
if err != nil {
action.coinsAccount.ExecFrozen(game.AdminAddr, action.execaddr, devFee) // rollback
......@@ -719,7 +719,7 @@ func (action *Action) GamePublish(publish *pkt.GuessGamePublish) (*types.Receipt
}
if game.PlatFeeFactor > 0 {
platFee = int64(totalBetsNumber) * game.PlatFeeFactor / 1000
platFee = totalBetsNumber * game.PlatFeeFactor / 1000
receipt, err := action.coinsAccount.ExecTransfer(game.AdminAddr, platAddr, action.execaddr, platFee)
if err != nil {
action.coinsAccount.ExecFrozen(game.AdminAddr, action.execaddr, platFee) // rollback
......@@ -736,7 +736,7 @@ func (action *Action) GamePublish(publish *pkt.GuessGamePublish) (*types.Receipt
for j := 0; j < len(game.Plays); j++ {
player := game.Plays[j]
if player.Bet.Option == game.Result {
value := int64(player.Bet.BetsNumber * winValue / winBetsNumber)
value := player.Bet.BetsNumber * winValue / winBetsNumber
receipt, err := action.coinsAccount.ExecTransfer(game.AdminAddr, player.Addr, action.execaddr, value)
if err != nil {
action.coinsAccount.ExecFrozen(player.Addr, action.execaddr, value) // rollback
......@@ -766,10 +766,10 @@ func (action *Action) GameAbort(pbend *pkt.GuessGameAbort) (*types.Receipt, erro
var logs []*types.ReceiptLog
var kv []*types.KeyValue
game, err := action.readGame(pbend.GetGameId())
game, err := action.readGame(pbend.GetGameID())
if err != nil {
logger.Error("GameAbort", "addr", action.fromaddr, "execaddr", action.execaddr, "get game failed",
pbend.GetGameId(), "err", err)
pbend.GetGameID(), "err", err)
return nil, err
}
......@@ -796,7 +796,7 @@ func (action *Action) GameAbort(pbend *pkt.GuessGameAbort) (*types.Receipt, erro
//激活冻结账户
for i := 0; i < len(game.Plays); i++ {
player := game.Plays[i]
value := int64(player.Bet.BetsNumber)
value := player.Bet.BetsNumber
receipt, err := action.coinsAccount.ExecActive(player.Addr, action.execaddr, value)
if err != nil {
logger.Error("GameAbort", "addr", player.Addr, "execaddr", action.execaddr, "amount", value, "err", err)
......@@ -864,8 +864,6 @@ func (action *Action) ChangeStatus(game *pkt.GuessGame, destStatus int32) {
game.Status = destStatus
game.Index = action.getIndex()
}
return
}
//ChangeAllAddrIndex 状态更新时,更新下注记录的历史信息
......
......@@ -81,7 +81,7 @@ func addGuessGameAddrIndexKey(status int32, addr, gameID string, index int64) *t
kv := &types.KeyValue{}
kv.Key = calcGuessGameAddrKey(addr, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
GameID: gameID,
Status: status,
Index: index,
}
......@@ -100,7 +100,7 @@ func addGuessGameStatusIndexKey(status int32, gameID string, index int64) *types
kv := &types.KeyValue{}
kv.Key = calcGuessGameStatusKey(status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
GameID: gameID,
Status: status,
Index: index,
}
......@@ -119,7 +119,7 @@ func addGuessGameAddrStatusIndexKey(status int32, addr, gameID string, index int
kv := &types.KeyValue{}
kv.Key = calcGuessGameAddrStatusKey(addr, status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
GameID: gameID,
Status: status,
Index: index,
}
......@@ -138,7 +138,7 @@ func addGuessGameAdminIndexKey(status int32, addr, gameID string, index int64) *
kv := &types.KeyValue{}
kv.Key = calcGuessGameAdminKey(addr, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
GameID: gameID,
Status: status,
Index: index,
}
......@@ -157,7 +157,7 @@ func addGuessGameAdminStatusIndexKey(status int32, addr, gameID string, index in
kv := &types.KeyValue{}
kv.Key = calcGuessGameAdminStatusKey(addr, status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
GameID: gameID,
Status: status,
Index: index,
}
......@@ -176,7 +176,7 @@ func addGuessGameCategoryStatusIndexKey(status int32, category, gameID string, i
kv := &types.KeyValue{}
kv.Key = calcGuessGameCategoryStatusKey(category, status, index)
record := &pkt.GuessGameRecord{
GameId: gameID,
GameID: gameID,
Status: status,
Index: index,
}
......
......@@ -16,7 +16,7 @@ func (g *Guess) Query_QueryGamesByIds(in *pkt.QueryGuessGameInfos) (types.Messag
//Query_QueryGameById method
func (g *Guess) Query_QueryGameById(in *pkt.QueryGuessGameInfo) (types.Message, error) {
game, err := readGame(g.GetStateDB(), in.GetGameId())
game, err := readGame(g.GetStateDB(), in.GetGameID())
if err != nil {
return nil, err
}
......
......@@ -6,7 +6,7 @@ package types;
//GuessGame 竞猜游戏详情
message GuessGame {
string gameId = 1; //游戏ID
string gameID = 1; //游戏ID
int32 status = 2; //游戏的状态:创建->投注->截止投注->开奖
int32 preStatus = 3;
int64 startTime = 4; //创建游戏的时间
......@@ -94,36 +94,36 @@ message GuessGameStart{
//GuessGameBet 参与游戏下注
message GuessGameBet{
string gameId = 1;
string gameID = 1;
string option = 2;
int64 betsNum = 3;
}
//GuessGameStopBet 游戏停止下注
message GuessGameStopBet{
string gameId = 1;
string gameID = 1;
}
//GuessGameAbort 游戏异常终止,退还下注
message GuessGameAbort{
string gameId = 1;
string gameID = 1;
}
//GuessGamePublish 游戏结果揭晓
message GuessGamePublish{
string gameId = 1;
string gameID = 1;
string result = 2;
}
//GuessGameQuery 查询游戏结果
message GuessGameQuery{
string gameId = 1;
string gameID = 1;
uint32 ty = 2;
}
//QueryGuessGameInfo 游戏信息查询消息
message QueryGuessGameInfo {
string gameId = 1;
string gameID = 1;
string addr = 2;
int32 status = 3;
int64 index = 4;
......@@ -138,7 +138,7 @@ message ReplyGuessGameInfo {
//QueryGuessGameInfos 游戏信息列表查询消息
message QueryGuessGameInfos {
repeated string gameIds = 1;
repeated string gameIDs = 1;
}
//ReplyGuessGameInfos 游戏信息列表查询响应消息
......@@ -148,7 +148,7 @@ message ReplyGuessGameInfos {
//ReceiptGuessGame 竞猜游戏收据信息
message ReceiptGuessGame {
string gameId = 1;
string gameID = 1;
int32 preStatus = 2;
int32 status = 3;
string addr = 4;
......@@ -178,7 +178,7 @@ message GuessStartTxReq {
//GuessBetTxReq 构造bet交易的请求
message GuessBetTxReq {
string gameId = 1;
string gameID = 1;
string option = 2;
int64 bets = 3;
int64 fee = 4;
......@@ -186,26 +186,26 @@ message GuessBetTxReq {
//GuessStopBetTxReq 构造stopBet交易的请求
message GuessStopBetTxReq {
string gameId = 1;
string gameID = 1;
int64 fee = 2;
}
//GuessAbortTxReq 构造abort交易的请求
message GuessAbortTxReq {
string gameId = 1;
string gameID = 1;
int64 fee = 2;
}
//GuessPublishTxReq 构造publish交易的请求
message GuessPublishTxReq {
string gameId = 1;
string gameID = 1;
string result = 2;
int64 fee = 3;
}
// GuessGameRecord game信息查询记录
message GuessGameRecord {
string gameId = 1;
string gameID = 1;
int32 status = 2;
int64 index = 3;
}
......
......@@ -52,7 +52,7 @@ func (c *channelClient) GuessStart(ctx context.Context, parm *pb.GuessStartTxReq
//构造bet原始交易
func (c *channelClient) GuessBet(ctx context.Context, parm *pb.GuessBetTxReq) (*types.UnsignTx, error) {
v := &pb.GuessGameBet{
GameId: parm.GameId,
GameID: parm.GameID,
Option: parm.Option,
BetsNum: parm.Bets,
}
......@@ -81,7 +81,7 @@ func (c *channelClient) GuessBet(ctx context.Context, parm *pb.GuessBetTxReq) (*
//构造stopBet原始交易
func (c *channelClient) GuessStopBet(ctx context.Context, parm *pb.GuessStopBetTxReq) (*types.UnsignTx, error) {
v := &pb.GuessGameStopBet{
GameId: parm.GameId,
GameID: parm.GameID,
}
val := &pb.GuessGameAction{
......@@ -108,7 +108,7 @@ func (c *channelClient) GuessStopBet(ctx context.Context, parm *pb.GuessStopBetT
//构造abort原始交易
func (c *channelClient) GuessAbort(ctx context.Context, parm *pb.GuessAbortTxReq) (*types.UnsignTx, error) {
v := &pb.GuessGameAbort{
GameId: parm.GameId,
GameID: parm.GameID,
}
val := &pb.GuessGameAction{
......@@ -134,7 +134,7 @@ func (c *channelClient) GuessAbort(ctx context.Context, parm *pb.GuessAbortTxReq
//构造publish原始交易
func (c *channelClient) GuessPublish(ctx context.Context, parm *pb.GuessPublishTxReq) (*types.UnsignTx, error) {
v := &pb.GuessGamePublish{
GameId: parm.GameId,
GameID: parm.GameID,
Result: parm.Result,
}
......
This diff is collapsed.
......@@ -22,7 +22,7 @@ type GuessGameStartTx struct {
//GuessGameBetTx struct
type GuessGameBetTx struct {
GameId string `json:"gameId,omitempty"`
GameID string `json:"gameId,omitempty"`
Option string `json:"option,omitempty"`
BetsNum int64 `json:"betsNum,omitempty"`
Fee int64 `json:"fee,omitempty"`
......@@ -30,19 +30,19 @@ type GuessGameBetTx struct {
//GuessGameStopBetTx struct
type GuessGameStopBetTx struct {
GameId string `json:"gameId,omitempty"`
GameID string `json:"gameId,omitempty"`
Fee int64 `json:"fee,omitempty"`
}
//GuessGamePublishTx struct
type GuessGamePublishTx struct {
GameId string `json:"gameId,omitempty"`
GameID string `json:"gameId,omitempty"`
Result string `json:"result,omitempty"`
Fee int64 `json:"fee,omitempty"`
}
//GuessGameAbortTx struct
type GuessGameAbortTx struct {
GameId string `json:"gameId,omitempty"`
GameID string `json:"gameId,omitempty"`
Fee int64 `json:"fee,omitempty"`
}
......@@ -164,7 +164,7 @@ func CreateRawGuessBetTx(parm *GuessGameBetTx) (*types.Transaction, error) {
}
v := &GuessGameBet{
GameId: parm.GameId,
GameID: parm.GameID,
Option: parm.Option,
BetsNum: parm.BetsNum,
}
......@@ -195,7 +195,7 @@ func CreateRawGuessStopBetTx(parm *GuessGameStopBetTx) (*types.Transaction, erro
}
v := &GuessGameStopBet{
GameId: parm.GameId,
GameID: parm.GameID,
}
val := &GuessGameAction{
Ty: GuessGameActionStopBet,
......@@ -224,7 +224,7 @@ func CreateRawGuessPublishTx(parm *GuessGamePublishTx) (*types.Transaction, erro
}
v := &GuessGamePublish{
GameId: parm.GameId,
GameID: parm.GameID,
Result: parm.Result,
}
......@@ -255,7 +255,7 @@ func CreateRawGuessAbortTx(parm *GuessGameAbortTx) (*types.Transaction, error) {
}
v := &GuessGameAbort{
GameId: parm.GameId,
GameID: parm.GameID,
}
val := &GuessGameAction{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment