github.com/Bytom/bytom@v1.1.2-0.20210127130405-ae40204c0b09/blockchain/query/transactions.go (about) 1 package query 2 3 import ( 4 "github.com/bytom/bytom/blockchain/query/filter" 5 "github.com/bytom/bytom/errors" 6 ) 7 8 var filterTable = filter.Table{ 9 Name: "annotated_txs", 10 Alias: "txs", 11 Columns: map[string]*filter.Column{ 12 "asset_id": {Name: "assetid", Type: filter.String}, 13 "amount_lower_limit": {Name: "amountlower", Type: filter.Integer}, 14 "amount_upper_limit": {Name: "amountupper", Type: filter.Integer}, 15 "trans_type": {Name: "transtype", Type: filter.String}, 16 }, 17 } 18 19 var ( 20 //ErrBadAfter means malformed pagination parameter. 21 ErrBadAfter = errors.New("malformed pagination parameter after") 22 //ErrParameterCountMismatch means wrong number of parameters to query. 23 ErrParameterCountMismatch = errors.New("wrong number of parameters to query") 24 ) 25 26 //ValidateTransactionFilter verify txfeed filter validity. 27 func ValidateTransactionFilter(filt string) error { 28 _, err := filter.Parse(filt, &filterTable, nil) 29 return err 30 }