Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ env:
GO111MODULE: on

GO_VERSION: 1.19.x
BITCOIND_VERSION: '22.0'
BITCOIND_IMAGE: 'lightninglabs/bitcoin-core'
BITCOIND_VERSION: "0.21.4"
BITCOIND_IMAGE: "litecoinproject/litecoin-core"

jobs:
########################
Expand All @@ -36,7 +36,7 @@ jobs:
- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: '${{ env.GO_VERSION }}'
go-version: "${{ env.GO_VERSION }}"

- name: run format
run: make fmt
Expand All @@ -61,11 +61,11 @@ jobs:
- unit-race
- unit-cover
steps:
- name: extract bitcoind from docker image
- name: extract litecoind from docker image
run: |-
docker pull ${{ env.BITCOIND_IMAGE }}:${{ env.BITCOIND_VERSION }}
CONTAINER_ID=$(docker create ${{ env.BITCOIND_IMAGE }}:${{ env.BITCOIND_VERSION }})
sudo docker cp $CONTAINER_ID:/opt/bitcoin-${{ env.BITCOIND_VERSION }}/bin/bitcoind /usr/local/bin/bitcoind
sudo docker cp $CONTAINER_ID:/opt/litecoin-${{ env.BITCOIND_VERSION }}/bin/litecoind /usr/local/bin/litecoind
docker rm $CONTAINER_ID

- name: git checkout
Expand All @@ -85,7 +85,7 @@ jobs:
- name: setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: '${{ env.GO_VERSION }}'
go-version: "${{ env.GO_VERSION }}"

- name: run ${{ matrix.unit_type }}
run: make ${{ matrix.unit_type }}
Expand Down
12 changes: 6 additions & 6 deletions waddrmgr/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3067,7 +3067,7 @@ func TestTaprootPubKeyDerivation(t *testing.T) {
t, db, func(ns walletdb.ReadWriteBucket) (ManagedAddress, error) {
return scopedMgr.DeriveFromKeyPath(ns, externalPath)
},
"ltc1puht8rk95c53q3u9w3pf9h3jfcutcrl9lxc7rqsdthjrse4k6sn7q9tuqm9",
"ltc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxq4arnzx",
scopedMgr,
)
assertAddressDerivation(
Expand All @@ -3078,21 +3078,21 @@ func TestTaprootPubKeyDerivation(t *testing.T) {
}
return addrs[0], nil
},
"ltc1puht8rk95c53q3u9w3pf9h3jfcutcrl9lxc7rqsdthjrse4k6sn7q9tuqm9",
"ltc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxq4arnzx",
scopedMgr,
)
assertAddressDerivation(
t, db, func(ns walletdb.ReadWriteBucket) (ManagedAddress, error) {
return scopedMgr.LastExternalAddress(ns, 0)
},
"ltc1puht8rk95c53q3u9w3pf9h3jfcutcrl9lxc7rqsdthjrse4k6sn7q9tuqm9",
"ltc1p5cyxnuxmeuwuvkwfem96lqzszd02n6xdcjrs20cac6yqjjwudpxq4arnzx",
scopedMgr,
)
assertAddressDerivation(
t, db, func(ns walletdb.ReadWriteBucket) (ManagedAddress, error) {
return scopedMgr.DeriveFromKeyPath(ns, internalPath)
},
"ltc1pehskafcqerg3hqvx005ywevqta7r0q980xgnencjgez0fyf7lt7s8r36hx",
"ltc1p3qkhfews2uk44qtvauqyr2ttdsw7svhkl9nkm9s9c3x4ax5h60wqd8j8vm",
scopedMgr,
)
assertAddressDerivation(
Expand All @@ -3103,14 +3103,14 @@ func TestTaprootPubKeyDerivation(t *testing.T) {
}
return addrs[0], nil
},
"ltc1pehskafcqerg3hqvx005ywevqta7r0q980xgnencjgez0fyf7lt7s8r36hx",
"ltc1p3qkhfews2uk44qtvauqyr2ttdsw7svhkl9nkm9s9c3x4ax5h60wqd8j8vm",
scopedMgr,
)
assertAddressDerivation(
t, db, func(ns walletdb.ReadWriteBucket) (ManagedAddress, error) {
return scopedMgr.LastInternalAddress(ns, 0)
},
"ltc1pehskafcqerg3hqvx005ywevqta7r0q980xgnencjgez0fyf7lt7s8r36hx",
"ltc1p3qkhfews2uk44qtvauqyr2ttdsw7svhkl9nkm9s9c3x4ax5h60wqd8j8vm",
scopedMgr,
)
}
Expand Down
12 changes: 9 additions & 3 deletions wallet/psbt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/ltcsuite/ltcd/ltcutil"
"github.com/ltcsuite/ltcd/ltcutil/mweb"
"github.com/ltcsuite/ltcd/ltcutil/psbt"
"github.com/ltcsuite/ltcd/txscript"
"github.com/ltcsuite/ltcd/wire"
Expand Down Expand Up @@ -342,7 +343,6 @@ func TestFundPsbt(t *testing.T) {
// The third item should be the branch and should belong
// to a change output.
require.EqualValues(t, 1, b32d.Bip32Path[3])

assertChangeOutputScope(
t, changeTxOut.PkScript, tc.changeKeyScope,
)
Expand Down Expand Up @@ -402,7 +402,11 @@ func assertChangeOutputScope(t *testing.T, pkScript []byte,
// By default (changeScope == nil), the script should
// be a pay-to-taproot one.
switch changeScope {
case nil, &waddrmgr.KeyScopeBIP0086:
// LITECOIN: default change goes to witness pk
case nil:
require.True(t, txscript.IsPayToWitnessPubKeyHash(pkScript))

case &waddrmgr.KeyScopeBIP0086:
require.True(t, txscript.IsPayToTaproot(pkScript))

case &waddrmgr.KeyScopeBIP0049Plus, &waddrmgr.KeyScopeBIP0084:
Expand Down Expand Up @@ -498,8 +502,10 @@ func TestFinalizePsbt(t *testing.T) {
Outputs: []psbt.POutput{{}, {}, {}},
}

var mwebKeychain *mweb.Keychain

// Finalize it to add all witness data then extract the final TX.
err = w.FinalizePsbt(nil, 0, packet)
err = w.FinalizePsbt(nil, 0, mwebKeychain, packet)
if err != nil {
t.Fatalf("error finalizing PSBT packet: %v", err)
}
Expand Down
Loading