Skip to content
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

privatePaymentKeyToFile and privatePaymentKeyFromFile do not compose to identity #1601

Open
Renegatto opened this issue Mar 6, 2024 · 0 comments

Comments

@Renegatto
Copy link
Collaborator

Bug report

Description

Given the example

Contract.Wallet.KeyFile.privatePaymentKeyToFile path key
key' <- Contract.Wallet.KeyFile.privatePaymentKeyFromFile path

Expected behavior

key is equal to key'.

Actual behavior

key is different from key'.

Details

privatePaymentKeyFromTextEnvelope

privatePaymentKeyFromTextEnvelope . decodeTextEnvelope gives the same result as privatePaymentKeyFromFile.

Stable state

privatePaymentKeyFromFile drops half (?) of a CBOR on the first read and does not do it any more.
So in this code:

let
  f key = do
     Contract.Wallet.KeyFile.privatePaymentKeyToFile "temp" key
     Contract.Wallet.KeyFile.privatePaymentKeyFromFile "temp"
key0 <- f key
key1 <- f key0
key2 <- f key1
...

key0 /= key1
but
key1 = key2 = key3 ... keyn

Revision

4e3a69c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant