@@ -15,11 +15,11 @@ import (
15
15
"github.com/stretchr/testify/assert"
16
16
"github.com/stretchr/testify/require"
17
17
abci "github.com/tendermint/tendermint/abci/types"
18
+ tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
18
19
dbm "github.com/tendermint/tm-db"
19
20
20
21
ocabci "github.com/line/ostracon/abci/types"
21
22
"github.com/line/ostracon/libs/log"
22
- ocproto "github.com/line/ostracon/proto/ostracon/types"
23
23
24
24
"github.com/line/lbm-sdk/codec"
25
25
"github.com/line/lbm-sdk/snapshots"
@@ -217,7 +217,7 @@ func TestWithRouter(t *testing.T) {
217
217
txPerHeight := 5
218
218
219
219
for blockN := 0 ; blockN < nBlocks ; blockN ++ {
220
- header := ocproto .Header {Height : int64 (blockN ) + 1 }
220
+ header := tmproto .Header {Height : int64 (blockN ) + 1 }
221
221
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
222
222
223
223
for i := 0 ; i < txPerHeight ; i ++ {
@@ -312,7 +312,7 @@ func TestQuery(t *testing.T) {
312
312
require .Equal (t , 0 , len (res .Value ))
313
313
314
314
// query is still empty after a DeliverTx before we commit
315
- header := ocproto .Header {Height : app .LastBlockHeight () + 1 }
315
+ header := tmproto .Header {Height : app .LastBlockHeight () + 1 }
316
316
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
317
317
318
318
_ , resTx , err := app .Deliver (aminoTxEncoder (), tx )
@@ -338,7 +338,7 @@ func TestGRPCQuery(t *testing.T) {
338
338
app := setupBaseApp (t , grpcQueryOpt )
339
339
340
340
app .InitChain (abci.RequestInitChain {})
341
- header := ocproto .Header {Height : app .LastBlockHeight () + 1 }
341
+ header := tmproto .Header {Height : app .LastBlockHeight () + 1 }
342
342
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
343
343
app .Commit ()
344
344
@@ -417,7 +417,7 @@ func TestMultiMsgDeliverTx(t *testing.T) {
417
417
// run a multi-msg tx
418
418
// with all msgs the same route
419
419
420
- header := ocproto .Header {Height : 1 }
420
+ header := tmproto .Header {Height : 1 }
421
421
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
422
422
tx := newTxCounter (0 , 0 , 1 , 2 )
423
423
txBytes , err := codec .Marshal (tx )
@@ -498,7 +498,7 @@ func TestSimulateTx(t *testing.T) {
498
498
nBlocks := 3
499
499
for blockN := 0 ; blockN < nBlocks ; blockN ++ {
500
500
count := int64 (blockN + 1 )
501
- header := ocproto .Header {Height : count }
501
+ header := tmproto .Header {Height : count }
502
502
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
503
503
504
504
tx := newTxCounter (count , count )
@@ -553,7 +553,7 @@ func TestRunInvalidTransaction(t *testing.T) {
553
553
554
554
app := setupBaseApp (t , anteOpt , routerOpt )
555
555
556
- header := ocproto .Header {Height : 1 }
556
+ header := tmproto .Header {Height : 1 }
557
557
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
558
558
559
559
// transaction with no messages
@@ -680,7 +680,7 @@ func TestTxGasLimits(t *testing.T) {
680
680
681
681
app := setupBaseApp (t , anteOpt , routerOpt )
682
682
683
- header := ocproto .Header {Height : 1 }
683
+ header := tmproto .Header {Height : 1 }
684
684
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
685
685
686
686
testCases := []struct {
@@ -794,7 +794,7 @@ func TestMaxBlockGasLimits(t *testing.T) {
794
794
tx := tc .tx
795
795
796
796
// reset the block gas
797
- header := ocproto .Header {Height : app .LastBlockHeight () + 1 }
797
+ header := tmproto .Header {Height : app .LastBlockHeight () + 1 }
798
798
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
799
799
800
800
// execute the transaction multiple times
@@ -847,7 +847,7 @@ func TestCustomRunTxPanicHandler(t *testing.T) {
847
847
848
848
app := setupBaseApp (t , anteOpt , routerOpt )
849
849
850
- header := ocproto .Header {Height : 1 }
850
+ header := tmproto .Header {Height : 1 }
851
851
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
852
852
853
853
app .AddRunTxRecoveryHandler (func (recoveryObj interface {}) error {
@@ -889,7 +889,7 @@ func TestBaseAppAnteHandler(t *testing.T) {
889
889
app .InitChain (abci.RequestInitChain {})
890
890
registerTestCodec (cdc )
891
891
892
- header := ocproto .Header {Height : app .LastBlockHeight () + 1 }
892
+ header := tmproto .Header {Height : app .LastBlockHeight () + 1 }
893
893
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
894
894
895
895
// execute a tx that will fail ante handler execution
@@ -998,7 +998,7 @@ func TestGasConsumptionBadTx(t *testing.T) {
998
998
999
999
app .InitChain (abci.RequestInitChain {})
1000
1000
1001
- header := ocproto .Header {Height : app .LastBlockHeight () + 1 }
1001
+ header := tmproto .Header {Height : app .LastBlockHeight () + 1 }
1002
1002
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
1003
1003
1004
1004
tx := newTxCounter (5 , 0 )
@@ -1091,7 +1091,7 @@ func TestInitChainer(t *testing.T) {
1091
1091
require .Equal (t , value , res .Value )
1092
1092
1093
1093
// commit and ensure we can still query
1094
- header := ocproto .Header {Height : app .LastBlockHeight () + 1 }
1094
+ header := tmproto .Header {Height : app .LastBlockHeight () + 1 }
1095
1095
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
1096
1096
app .Commit ()
1097
1097
@@ -1129,14 +1129,14 @@ func TestBeginBlock_WithInitialHeight(t *testing.T) {
1129
1129
1130
1130
require .PanicsWithError (t , "invalid height: 4; expected: 3" , func () {
1131
1131
app .BeginBlock (ocabci.RequestBeginBlock {
1132
- Header : ocproto .Header {
1132
+ Header : tmproto .Header {
1133
1133
Height : 4 ,
1134
1134
},
1135
1135
})
1136
1136
})
1137
1137
1138
1138
app .BeginBlock (ocabci.RequestBeginBlock {
1139
- Header : ocproto .Header {
1139
+ Header : tmproto .Header {
1140
1140
Height : 3 ,
1141
1141
},
1142
1142
})
@@ -1439,7 +1439,7 @@ func TestCheckTx(t *testing.T) {
1439
1439
require .Equal (t , nTxs , storedCounter )
1440
1440
1441
1441
// If a block is committed, CheckTx state should be reset.
1442
- header := ocproto .Header {Height : 1 }
1442
+ header := tmproto .Header {Height : 1 }
1443
1443
app .BeginBlock (ocabci.RequestBeginBlock {Header : header , Hash : []byte ("hash" )})
1444
1444
1445
1445
require .NotNil (t , app .checkState .ctx .BlockGasMeter (), "block gas meter should have been set to checkState" )
@@ -1481,7 +1481,7 @@ func TestDeliverTx(t *testing.T) {
1481
1481
txPerHeight := 5
1482
1482
1483
1483
for blockN := 0 ; blockN < nBlocks ; blockN ++ {
1484
- header := ocproto .Header {Height : int64 (blockN ) + 1 }
1484
+ header := tmproto .Header {Height : int64 (blockN ) + 1 }
1485
1485
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
1486
1486
1487
1487
for i := 0 ; i < txPerHeight ; i ++ {
@@ -1627,7 +1627,7 @@ func TestLoadVersionInvalid(t *testing.T) {
1627
1627
err = app .LoadVersion (- 1 )
1628
1628
require .Error (t , err )
1629
1629
1630
- header := ocproto .Header {Height : 1 }
1630
+ header := tmproto .Header {Height : 1 }
1631
1631
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
1632
1632
res := app .Commit ()
1633
1633
commitID1 := sdk.CommitID {Version : 1 , Hash : res .Data }
@@ -1678,7 +1678,7 @@ func setupBaseAppWithSnapshots(t *testing.T, blocks uint, blockTxs int, options
1678
1678
r := rand .New (rand .NewSource (3920758213583 ))
1679
1679
keyCounter := 0
1680
1680
for height := int64 (1 ); height <= int64 (blocks ); height ++ {
1681
- app .BeginBlock (ocabci.RequestBeginBlock {Header : ocproto .Header {Height : height }})
1681
+ app .BeginBlock (ocabci.RequestBeginBlock {Header : tmproto .Header {Height : height }})
1682
1682
for txNum := 0 ; txNum < blockTxs ; txNum ++ {
1683
1683
tx := txTest {Msgs : []sdk.Msg {}}
1684
1684
for msgNum := 0 ; msgNum < 100 ; msgNum ++ {
@@ -1749,13 +1749,13 @@ func TestLoadVersion(t *testing.T) {
1749
1749
require .Equal (t , emptyCommitID , lastID )
1750
1750
1751
1751
// execute a block, collect commit ID
1752
- header := ocproto .Header {Height : 1 }
1752
+ header := tmproto .Header {Height : 1 }
1753
1753
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
1754
1754
res := app .Commit ()
1755
1755
commitID1 := sdk.CommitID {Version : 1 , Hash : res .Data }
1756
1756
1757
1757
// execute a block, collect commit ID
1758
- header = ocproto .Header {Height : 2 }
1758
+ header = tmproto .Header {Height : 2 }
1759
1759
app .BeginBlock (ocabci.RequestBeginBlock {Header : header })
1760
1760
res = app .Commit ()
1761
1761
commitID2 := sdk.CommitID {Version : 2 , Hash : res .Data }
@@ -1854,7 +1854,7 @@ func TestSetLoader(t *testing.T) {
1854
1854
require .Nil (t , err )
1855
1855
1856
1856
// "execute" one block
1857
- app .BeginBlock (ocabci.RequestBeginBlock {Header : ocproto .Header {Height : 2 }})
1857
+ app .BeginBlock (ocabci.RequestBeginBlock {Header : tmproto .Header {Height : 2 }})
1858
1858
res := app .Commit ()
1859
1859
require .NotNil (t , res .Data )
1860
1860
0 commit comments