@@ -14,7 +14,7 @@ import (
1414 "github.com/IBAX-io/go-ibax/packages/block"
1515 "github.com/IBAX-io/go-ibax/packages/consts"
1616 "github.com/IBAX-io/go-ibax/packages/converter"
17- "github.com/IBAX-io/go-ibax/packages/model "
17+ "github.com/IBAX-io/go-ibax/packages/storage/sqldb "
1818
1919 "errors"
2020
@@ -29,7 +29,7 @@ type maxBlockResult struct {
2929func getMaxBlockHandler (w http.ResponseWriter , r * http.Request ) {
3030 logger := getLogger (r )
3131
32- block := & model. Block {}
32+ block := & sqldb. BlockChain {}
3333 found , err := block .GetMaxBlock ()
3434 if err != nil {
3535 logger .WithFields (log.Fields {"type" : consts .DBError , "error" : err }).Error ("getting max block" )
@@ -60,7 +60,7 @@ func getBlockInfoHandler(w http.ResponseWriter, r *http.Request) {
6060 params := mux .Vars (r )
6161
6262 blockID := converter .StrToInt64 (params ["id" ])
63- block := model. Block {}
63+ block := sqldb. BlockChain {}
6464 found , err := block .Get (blockID )
6565 if err != nil {
6666 logger .WithFields (log.Fields {"type" : consts .DBError , "error" : err }).Error ("getting block" )
@@ -117,7 +117,7 @@ func getBlocksTxInfoHandler(w http.ResponseWriter, r *http.Request) {
117117 }
118118 logger := getLogger (r )
119119
120- blocks , err := model .GetBlockchain (form .BlockID , form .BlockID + form .Count , model .OrderASC )
120+ blocks , err := sqldb .GetBlockchain (form .BlockID , form .BlockID + form .Count , sqldb .OrderASC )
121121 if err != nil {
122122 logger .WithFields (log.Fields {"type" : consts .DBError , "error" : err }).Error ("on getting blocks range" )
123123 errorResponse (w , err )
@@ -157,7 +157,7 @@ func getBlocksTxInfoHandler(w http.ResponseWriter, r *http.Request) {
157157
158158 txInfoCollection = append (txInfoCollection , txInfo )
159159
160- logger .WithFields (log.Fields {"block_id" : blockModel .ID , "tx hash" : txInfo .Hash , "contract_name" : txInfo .ContractName , "key_id" : txInfo .KeyID , "params" : txInfoCollection }).Debug ("Block Transactions Information" )
160+ logger .WithFields (log.Fields {"block_id" : blockModel .ID , "tx hash" : txInfo .Hash , "contract_name" : txInfo .ContractName , "key_id" : txInfo .KeyID , "params" : txInfoCollection }).Debug ("BlockChain Transactions Information" )
161161 }
162162
163163 result [blockModel .ID ] = txInfoCollection
@@ -219,7 +219,7 @@ func getBlocksDetailedInfoHandler(w http.ResponseWriter, r *http.Request) {
219219
220220 logger := getLogger (r )
221221
222- blocks , err := model .GetBlockchain (form .BlockID , form .BlockID + form .Count , model .OrderASC )
222+ blocks , err := sqldb .GetBlockchain (form .BlockID , form .BlockID + form .Count , sqldb .OrderASC )
223223 if err != nil {
224224 logger .WithFields (log.Fields {"type" : consts .DBError , "error" : err }).Error ("on getting blocks range" )
225225 errorResponse (w , err )
@@ -257,7 +257,7 @@ func getBlocksDetailedInfoHandler(w http.ResponseWriter, r *http.Request) {
257257
258258 txDetailedInfoCollection = append (txDetailedInfoCollection , txDetailedInfo )
259259
260- logger .WithFields (log.Fields {"block_id" : blockModel .ID , "tx hash" : txDetailedInfo .Hash , "contract_name" : txDetailedInfo .ContractName , "key_id" : txDetailedInfo .KeyID , "time" : txDetailedInfo .Time , "type" : txDetailedInfo .Type , "params" : txDetailedInfoCollection }).Debug ("Block Transactions Information" )
260+ logger .WithFields (log.Fields {"block_id" : blockModel .ID , "tx hash" : txDetailedInfo .Hash , "contract_name" : txDetailedInfo .ContractName , "key_id" : txDetailedInfo .KeyID , "time" : txDetailedInfo .Time , "type" : txDetailedInfo .Type , "params" : txDetailedInfoCollection }).Debug ("BlockChain Transactions Information" )
261261 }
262262
263263 header := BlockHeaderInfo {
0 commit comments