Skip to content

Slight modification ExtendedSigningKey creation from HDWallet #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 67 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
0b6a569
incorporate split change logic
Feb 20, 2022
182f780
incorporate split change logic
Feb 20, 2022
7fdb334
incorporate split change logic
Feb 20, 2022
3c8ced2
minor modification to change combine logic
Feb 20, 2022
c2772e8
minor modification to change combine logic
Feb 20, 2022
d303a02
minor modification to change combine logic
Feb 20, 2022
2b0cd17
Merge branch 'cffls:main' into main
henryyuanheng-wang Feb 28, 2022
a008ed3
Merge branch 'cffls:main' into main
henryyuanheng-wang Mar 7, 2022
e8f37fa
integrate diff changes
Mar 7, 2022
4c7ba76
integrate diff changes and remove unused functions
Mar 7, 2022
415b3a6
Merge branch 'cffls:main' into main
henryyuanheng-wang Mar 13, 2022
d80063c
add change split test case. Modify txbuilder logic in handeling splits.
Mar 13, 2022
ee36493
add unit tests for change split logic
Mar 13, 2022
ca3b3f2
Bump pytest from 7.0.1 to 7.1.1
dependabot[bot] Mar 21, 2022
21e1b3f
Merge pull request #2 from henryyuanheng-wang/dependabot/pip/pytest-7…
henryyuanheng-wang Mar 27, 2022
8a38224
merge with original main
Mar 27, 2022
6d86610
Merge branch 'cffls-main'
Mar 27, 2022
cf788fe
Merge branch 'main' of https://github.com/henryyuanheng-wang/pycardano
Mar 27, 2022
86d588f
merge with main
Apr 12, 2022
89535d6
Merge branch 'cffls-main'
Apr 12, 2022
68cc134
replace max fee with more accurately estimated fees
Apr 19, 2022
e4eefd3
replace max fee with more precise fee estimation
Apr 20, 2022
0e6758b
remove max fee import
Apr 20, 2022
c713360
modify format to be consistent with code base
Apr 21, 2022
71d93e3
supports utxo queries using kupo
May 17, 2022
6ce979c
merge with main branch
May 17, 2022
1f2c081
Merge branch 'cffls-main'
May 17, 2022
dffeff4
support utxo query with Kupo
May 18, 2022
d514d3d
reformat
May 18, 2022
7122dcb
query utxo with Kupo when kupo url is provided
May 26, 2022
a666882
resolve merging conflict
May 26, 2022
fa7d14d
Merge branch 'cffls-main'
May 26, 2022
902d410
remove the hardcoded genesis utxo in test_all file
May 27, 2022
2de54da
pull latest from main
Jun 5, 2022
d58c537
Merge branch 'cffls-main'
Jun 5, 2022
d5b857a
Create usage guides for Plutus and fix hyperlinks
Jun 6, 2022
0e4b0ad
Merge branch 'cffls:main' into main
henryyuanheng-wang Jun 6, 2022
8af6486
create separate section for datum/redeemer serialiation
Jun 14, 2022
4a12d13
add -f flag to try to clean up the build if it exists
Jun 14, 2022
605400f
Merge branch 'main' of https://github.com/henryyuanheng-wang/pycardano
Jun 14, 2022
5c2c025
Create usage guides for Plutus and fix hyperlinks
Jun 6, 2022
bdf88c0
create separate section for datum/redeemer serialiation
Jun 14, 2022
7840dea
add -f flag to try to clean up the build if it exists
Jun 14, 2022
1190c9f
Merge branch 'cffls:main' into main
henryyuanheng-wang Jun 22, 2022
dd1b199
Merge branch 'cffls:main' into main
henryyuanheng-wang Jul 4, 2022
8cc6ab7
Merge branch 'cffls:main' into main
henryyuanheng-wang Jul 9, 2022
09c8607
Merge branch 'cffls:main' into main
henryyuanheng-wang Jul 17, 2022
54a20ef
Merge branch 'main' of https://github.com/henryyuanheng-wang/pycardano
Jul 17, 2022
e194656
Merge branch 'cffls:main' into main
henryyuanheng-wang Sep 17, 2022
ee4d330
hdwallet implementation and unit test
Sep 17, 2022
37f76ad
adjust poetry files
Sep 17, 2022
436a80a
modify poetry
Sep 17, 2022
be58baf
modify poetry file
Sep 18, 2022
6c428b9
modify poetry lock
Sep 18, 2022
4877fd4
Merge branch 'cffls:main' into main
henryyuanheng-wang Oct 5, 2022
80b4373
made changes to hdwallet and incorporated into bip32
Oct 5, 2022
d62e2a1
remove commented code block
Oct 5, 2022
65b659e
Merge remote-tracking branch 'origin/main' into main
henryyuanheng-wang Oct 30, 2022
1e8d8ec
support utxo query with kupo
henryyuanheng-wang Nov 3, 2022
c73d194
Merge branch 'main' of https://github.com/henryyuanheng-wang/pycardan…
henryyuanheng-wang Nov 3, 2022
24b5de8
move test_bip32
henryyuanheng-wang Nov 3, 2022
d4168ab
update utxo query with kupo
henryyuanheng-wang Nov 4, 2022
1b3c2df
update plutus guide with vasil
henryyuanheng-wang Nov 4, 2022
c763b47
Merge branch 'main' of https://github.com/henryyuanheng-wang/pycardan…
henryyuanheng-wang Nov 4, 2022
79848b4
Merge branch 'Python-Cardano:main' into main
henryyuanheng-wang Nov 19, 2022
a77430d
fixing ExtendedSigning key from_hdwallet func
Nov 19, 2022
1613ebe
Fix ExtendedSigning key generation from HDWallet
Nov 19, 2022
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
4 changes: 3 additions & 1 deletion pycardano/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ def from_hdwallet(cls, hdwallet: HDWallet) -> ExtendedSigningKey:
"The hdwallet doesn't contain extended private key or chain code info."
)

return ExtendedSigningKey(
return cls(
payload=hdwallet.xprivate_key + hdwallet.public_key + hdwallet.chain_code,
key_type="PaymentExtendedSigningKeyShelley_ed25519_bip32",
description="Payment Signing Key",
)


Expand Down
27 changes: 26 additions & 1 deletion test/pycardano/crypto/test_bip32.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pycardano.address import Address, PointerAddress
from pycardano.crypto.bip32 import HDWallet
from pycardano.key import PaymentVerificationKey
from pycardano.key import ExtendedSigningKey, PaymentVerificationKey
from pycardano.network import Network

# Tests copied from: https://github.com/Emurgo/cardano-serialization-lib/blob/master/rust/src/address.rs
Expand Down Expand Up @@ -284,6 +284,31 @@ def test_payment_address_24_base():
)


def test_payment_address_24_base_2():
hdwallet = HDWallet.from_mnemonic(MNEMONIC_24)
hdwallet_spend = hdwallet.derive_from_path("m/1852'/1815'/0'/0/0")
spend_extended_sk = ExtendedSigningKey.from_hdwallet(hdwallet_spend)
spend_extended_vk = spend_extended_sk.to_verification_key()

hdwallet_stake = hdwallet.derive_from_path("m/1852'/1815'/0'/2/0")
stake_extended_sk = ExtendedSigningKey.from_hdwallet(hdwallet_stake)
stake_extended_vk = stake_extended_sk.to_verification_key()

assert (
Address(
spend_extended_vk.hash(), stake_extended_vk.hash(), network=Network.TESTNET
).encode()
== "addr_test1qqy6nhfyks7wdu3dudslys37v252w2nwhv0fw2nfawemmn8k8ttq8f3gag0h89aepvx3xf69g0l9pf80tqv7cve0l33sw96paj"
)

assert (
Address(
spend_extended_vk.hash(), stake_extended_vk.hash(), network=Network.MAINNET
).encode()
== "addr1qyy6nhfyks7wdu3dudslys37v252w2nwhv0fw2nfawemmn8k8ttq8f3gag0h89aepvx3xf69g0l9pf80tqv7cve0l33sdn8p3d"
)


def test_payment_address_24_enterprise():
hdwallet = HDWallet.from_mnemonic(MNEMONIC_24)
hdwallet_spend = hdwallet.derive_from_path("m/1852'/1815'/0'/0/0")
Expand Down