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

Cannot deserialize a LND macaroon admin.macaroon file #4

Open
sezaru opened this issue Mar 26, 2018 · 3 comments
Open

Cannot deserialize a LND macaroon admin.macaroon file #4

sezaru opened this issue Mar 26, 2018 · 3 comments

Comments

@sezaru
Copy link

sezaru commented Mar 26, 2018

Hello,

I'm trying to use your library inside an Elixir project to deserialize a LND macaroon admin.macaroon file.

I'm using this code inside the REPL:

{:ok, file} = File.read "admin.macaroon"
encoded = Base.encode64(file)
{:ok, mac} = :macaroon.deserialize(encoded)

which will give me the error:

** (MatchError) no match of right hand side value: {:error, :macaroon_invalid}

Testing the same file with pythons pymacaroons works, so it seems a specific deserialization problem with the library.

Since I cannot paste here the binary data from admin.macaroon I will post a link to the file directly and also the base64 with it:
admin.macaroon

AgEDbG5kArsBAwoQ5TMSJjie992RIEsCGCuq5xIBMBoWCgdhZGRyZXNzEgRyZWFkEgV3cml0ZRoTCgRpbmZvEgRyZWFkEgV3cml0ZRoXCghpbnZvaWNlcxIEcmVhZBIFd3JpdGUaFgoHbWVzc2FnZRIEcmVhZBIFd3JpdGUaFwoIb2ZmY2hhaW4SBHJlYWQSBXdyaXRlGhYKB29uY2hhaW4SBHJlYWQSBXdyaXRlGhQKBXBlZXJzEgRyZWFkEgV3cml0ZQAABiBoyNHs3jlsGlXIZEV8HtJuIiCh+vA56AFg9poHdCG6zA==

@kzemek
Copy link
Owner

kzemek commented Mar 27, 2018

Thanks for the report, I'll look into it shortly

@kzemek
Copy link
Owner

kzemek commented Mar 27, 2018

@sezaru can you try branch v2-serialization?

@sezaru
Copy link
Author

sezaru commented Mar 30, 2018

Very nice! It works like a charm with the v2-serialization.

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

2 participants