1
1
package api
2
2
3
3
import (
4
- "bytes"
5
4
"fmt"
6
5
"math/big"
7
6
@@ -12,7 +11,6 @@ import (
12
11
"github.com/vitelabs/go-vite/v2/ledger/chain"
13
12
chain_plugins "github.com/vitelabs/go-vite/v2/ledger/chain/plugins"
14
13
"github.com/vitelabs/go-vite/v2/vm"
15
- "github.com/vitelabs/go-vite/v2/vm/contracts/abi"
16
14
"github.com/vitelabs/go-vite/v2/vm/contracts/dex"
17
15
"github.com/vitelabs/go-vite/v2/vm/quota"
18
16
"github.com/vitelabs/go-vite/v2/vm/util"
@@ -139,7 +137,7 @@ func (l *LedgerApi) GetAccountBlocksByAddress(addr types.Address, index int, cou
139
137
140
138
// GetAccountBlocksByHeightRange [start,end] sorted by height desc
141
139
func (l * LedgerApi ) GetAccountBlocksByHeightRange (addr types.Address , start uint64 , end uint64 ) ([]* AccountBlock , error ) {
142
- if end - start > 1000 {
140
+ if end - start > 1000 {
143
141
return nil , fmt .Errorf ("height range must be less than 1000" )
144
142
}
145
143
@@ -274,27 +272,6 @@ func (l *LedgerApi) SendRawTransaction(block *AccountBlock) error {
274
272
return err
275
273
}
276
274
277
- { // @todo delete it
278
- if lb .ToAddress == types .AddressDexFund {
279
- abiContract := abi .ABIDexFund
280
- data := result .AccountBlock .Data
281
-
282
- method := abiContract .Methods [abi .MethodNameDexFundPlaceOrder ]
283
- for _ , method := range abiContract .Methods {
284
- method .Id ()
285
- }
286
- if bytes .Equal (method .Id (), data [:4 ]) {
287
- param := new (dex.ParamPlaceOrder )
288
- if err = abiContract .UnpackMethod (param , abi .MethodNameDexFundPlaceOrder , data ); err != nil {
289
- return err
290
- }
291
- if param .OrderType != 0 {
292
- return fmt .Errorf ("error order params" )
293
- }
294
- }
295
- }
296
- }
297
-
298
275
if result != nil {
299
276
return l .vite .Pool ().AddDirectAccountBlock (result .AccountBlock .AccountAddress , result )
300
277
} else {
@@ -726,12 +703,12 @@ func (l *LedgerApi) GetChunksV2(startHeight interface{}, endHeight interface{})
726
703
if err != nil {
727
704
return nil , err
728
705
}
729
-
706
+
730
707
if startHeightUint64 > endHeightUint64 {
731
708
return nil , fmt .Errorf ("startHeight must be less than endHeight" )
732
709
}
733
710
734
- if endHeightUint64 - startHeightUint64 > 1000 {
711
+ if endHeightUint64 - startHeightUint64 > 1000 {
735
712
return nil , fmt .Errorf ("height range must be less than 1000" )
736
713
}
737
714
0 commit comments