Commit e75a95c1 authored by pengjun's avatar pengjun Committed by vipwzw

#653 fix fmt

parent 33f0cc2d
......@@ -39,7 +39,7 @@ const (
ProposalPOLID = byte(0x05)
VoteID = byte(0x06)
HasVoteID = byte(0x07)
VoteSetMaj23ID = byte(0X08)
VoteSetMaj23ID = byte(0x08)
VoteSetBitsID = byte(0x09)
ProposalHeartbeatID = byte(0x0a)
ProposalBlockID = byte(0x0b)
......@@ -117,9 +117,9 @@ type RoundState struct {
// RoundStateMessage ...
func (rs *RoundState) RoundStateMessage() *tmtypes.NewRoundStepMsg {
return &tmtypes.NewRoundStepMsg{
Height: rs.Height,
Round: int32(rs.Round),
Step: int32(rs.Step),
Height: rs.Height,
Round: int32(rs.Round),
Step: int32(rs.Step),
SecondsSinceStartTime: int32(time.Since(rs.StartTime).Seconds()),
LastCommitRound: int32(rs.LastCommit.Round()),
}
......
......@@ -73,9 +73,9 @@ func ParseX509CertificateToSm2(x509Cert *x509.Certificate) *sm2.Certificate {
UnknownExtKeyUsage: x509Cert.UnknownExtKeyUsage,
BasicConstraintsValid: x509Cert.BasicConstraintsValid,
IsCA: x509Cert.IsCA,
MaxPathLen: x509Cert.MaxPathLen,
MaxPathLenZero: x509Cert.MaxPathLenZero,
IsCA: x509Cert.IsCA,
MaxPathLen: x509Cert.MaxPathLen,
MaxPathLenZero: x509Cert.MaxPathLenZero,
SubjectKeyId: x509Cert.SubjectKeyId,
AuthorityKeyId: x509Cert.AuthorityKeyId,
......@@ -136,9 +136,9 @@ func ParseSm2CertificateToX509(sm2Cert *sm2.Certificate) *x509.Certificate {
UnknownExtKeyUsage: sm2Cert.UnknownExtKeyUsage,
BasicConstraintsValid: sm2Cert.BasicConstraintsValid,
IsCA: sm2Cert.IsCA,
MaxPathLen: sm2Cert.MaxPathLen,
MaxPathLenZero: sm2Cert.MaxPathLenZero,
IsCA: sm2Cert.IsCA,
MaxPathLen: sm2Cert.MaxPathLen,
MaxPathLenZero: sm2Cert.MaxPathLenZero,
SubjectKeyId: sm2Cert.SubjectKeyId,
AuthorityKeyId: sm2Cert.AuthorityKeyId,
......
......@@ -24,14 +24,14 @@ var (
PrivKeyA = "0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b" // 1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4
PrivKeyB = "0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4" // 1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR
Nodes = [][]byte{
[]byte("1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"),
[]byte("1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR"),
[]byte("1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"),
[]byte("1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR"),
}
)
func TestPokerbull(t *testing.T) {
types.SetTitleOnlyForTest("chain33")
total := int64(1000*types.Coin)
total := int64(1000 * types.Coin)
accountA := types.Account{
Balance: total,
Frozen: 0,
......@@ -63,8 +63,8 @@ func TestPokerbull(t *testing.T) {
// start game
p1 := &pkt.PBGameStart{
Value: 5*types.Coin,
PlayerNum: 2,
Value: 5 * types.Coin,
PlayerNum: 2,
}
createTx, err := types.CallCreateTransaction(pkt.PokerBullX, "Start", p1)
if err != nil {
......@@ -126,7 +126,7 @@ func TestPokerbull(t *testing.T) {
// continue game
p2 := &pkt.PBGameContinue{
GameId: common.ToHex(gameID),
GameId: common.ToHex(gameID),
}
createTx, err = types.CallCreateTransaction(pkt.PokerBullX, "Continue", p2)
if err != nil {
......@@ -185,11 +185,11 @@ func TestPokerbull(t *testing.T) {
}
// query
res, err := exec.Query(pkt.FuncNameQueryGameByID, types.Encode(&pkt.QueryPBGameInfo{GameId:common.ToHex(gameID)}))
res, err := exec.Query(pkt.FuncNameQueryGameByID, types.Encode(&pkt.QueryPBGameInfo{GameId: common.ToHex(gameID)}))
assert.Nil(t, err)
assert.NotNil(t, res)
res, err = exec.Query(pkt.FuncNameQueryGameByAddr, types.Encode(&pkt.QueryPBGameInfo{Addr:string(Nodes[0])}))
res, err = exec.Query(pkt.FuncNameQueryGameByAddr, types.Encode(&pkt.QueryPBGameInfo{Addr: string(Nodes[0])}))
assert.Nil(t, err)
assert.NotNil(t, res)
......@@ -227,4 +227,4 @@ func signTx(tx *types.Transaction, hexPrivKey string) (*types.Transaction, error
tx.Sign(int32(signType), privKey)
return tx, nil
}
\ No newline at end of file
}
......@@ -43,7 +43,7 @@ func TestJRPCChannel(t *testing.T) {
{fn: testQuitRawTxCmd},
{fn: testPlayRawTxCmd},
}
for _, testCase := range testCases {
err := testCase.fn(t, jrpcClient)
assert.Nil(t, err)
......@@ -96,7 +96,7 @@ func testContinueRawTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
}
func testPlayRawTxCmd(t *testing.T, jrpc *jsonclient.JSONClient) error {
payload := &pty.PBGamePlay{GameId: "123", Round:1, Value:5, Address: []string{"a", "b"}}
payload := &pty.PBGamePlay{GameId: "123", Round: 1, Value: 5, Address: []string{"a", "b"}}
params := &rpctypes.CreateTxIn{
Execer: types.ExecName(pty.PokerBullX),
ActionName: pty.CreatePlayTx,
......
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