@@ -3,16 +3,12 @@ package lending_test
3
3
// Path: x/btcbridge/genesis_test.go
4
4
5
5
import (
6
- "bytes"
7
- "encoding/hex"
8
6
"testing"
9
7
10
- "github.com/btcsuite/btcd/btcutil"
11
- "github.com/btcsuite/btcd/wire"
12
8
keepertest "github.com/sideprotocol/side/testutil/keeper"
13
9
"github.com/sideprotocol/side/testutil/nullify"
14
- btcbridge "github.com/sideprotocol/side/x/btcbridge /module"
15
- "github.com/sideprotocol/side/x/btcbridge /types"
10
+ lending "github.com/sideprotocol/side/x/lending /module"
11
+ "github.com/sideprotocol/side/x/lending /types"
16
12
"github.com/stretchr/testify/require"
17
13
)
18
14
@@ -26,57 +22,13 @@ func TestGenesis(t *testing.T) {
26
22
// this line is used by starport scaffolding # genesis/test/state
27
23
}
28
24
29
- k , ctx := keepertest .BtcBridgeKeeper (t )
30
- btcbridge .InitGenesis (ctx , * k , genesisState )
31
- got := btcbridge .ExportGenesis (ctx , * k )
25
+ k , ctx := keepertest .LendingKeeper (t )
26
+ lending .InitGenesis (ctx , k , genesisState )
27
+ got := lending .ExportGenesis (ctx , k )
32
28
require .NotNil (t , got )
33
29
34
30
nullify .Fill (& genesisState )
35
31
nullify .Fill (got )
36
32
37
33
// this line is used by starport scaffolding # genesis/test/assert
38
34
}
39
-
40
- // TestSubmitTx tests the SubmitTx function
41
- // func TestSubmitTx(t *testing.T) {
42
-
43
- // // test tx: https://blockchain.info/tx/b657e22827039461a9493ede7bdf55b01579254c1630b0bfc9185ec564fc05ab?format=json
44
-
45
- // k, ctx := keepertest.BtcbridgeClientKeeper(t)
46
-
47
- // txHex := "02000000000101e5df234dbeff74d6da14754ebeea8ab0e2f60b1884566846cf6b36e8ceb5f5350100000000fdffffff02f0490200000000001600142ac13073e8d491428790481321a636696d00107681d7e205000000001600142bf3aa186cbdcbe88b70a67edcd5a32ce5e8e6d8024730440220081ee61d749ce8cedcf6eedde885579af2eb65ca67d29e6ae2c37109d81cbbb202203a1891ce45f91f159ccf04348ef37a3d1a12d89e5e01426e061326057e6c128d012103036bbdd77c9a932f37bd66175967c7fb7eb75ece06b87c1ad1716770cb3ca4ee79fc2a00"
48
- // prevTxHex := "0200000000010183372652f2af9ab34b3a003efada6b054c75583185ac130de72599dfdf4e462b0100000000fdffffff02f0490200000000001600142ac13073e8d491428790481321a636696d001076a64ee50500000000160014a03614eef338681373de94a2dc2574de55da1980024730440220274250f6036bea0947daf4455ab4976f81721257d163fd952fb5b0c70470edc602202fba816be260219bbc40a8983c459cf05cf2209bf1e62e7ccbf78aec54db607f0121031cee21ef69fe68b240c3032616fa310c6a60a856c0a7e0c1298815c92fb2c61788fb2a00"
49
-
50
- // msg := &types.MsgSubmitTransactionRequest{
51
- // Sender: "",
52
- // Blockhash: "000000000d73ecf25d3bf8e6ae65c35aa2a90e3271edff8bab90d87ed875f13b",
53
- // TxBytes: "0100000001b3f7",
54
- // PrevTxBytes: "0100000001b3f7",
55
- // Proof: []string{"0100000001b3f7"},
56
- // }
57
- // // this line is used by starport scaffolding # handler/test/submit
58
- // err := k.ProcessBitcoinDepositTransaction(ctx, msg)
59
- // require.NoError(t, err)
60
- // }
61
-
62
- // Decode transaction
63
- func TestDecodeTransaction (t * testing.T ) {
64
- hexStr := "02000000000101e5df234dbeff74d6da14754ebeea8ab0e2f60b1884566846cf6b36e8ceb5f5350100000000fdffffff02f0490200000000001600142ac13073e8d491428790481321a636696d00107681d7e205000000001600142bf3aa186cbdcbe88b70a67edcd5a32ce5e8e6d8024730440220081ee61d749ce8cedcf6eedde885579af2eb65ca67d29e6ae2c37109d81cbbb202203a1891ce45f91f159ccf04348ef37a3d1a12d89e5e01426e061326057e6c128d012103036bbdd77c9a932f37bd66175967c7fb7eb75ece06b87c1ad1716770cb3ca4ee79fc2a00"
65
-
66
- // Decode the hex string to transaction
67
- txBytes , err := hex .DecodeString (hexStr )
68
- require .NoError (t , err )
69
-
70
- // Create a new transaction
71
- var tx wire.MsgTx
72
- err = tx .Deserialize (bytes .NewReader (txBytes ))
73
- require .NoError (t , err )
74
-
75
- uTx := btcutil .NewTx (& tx )
76
-
77
- for _ , input := range uTx .MsgTx ().TxIn {
78
- t .Log (input .PreviousOutPoint .String ())
79
- }
80
-
81
- require .GreaterOrEqual (t , len (uTx .MsgTx ().TxIn ), 1 )
82
- }
0 commit comments