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

Implement Jörmungandr Transaction-message decoder #273

Merged
merged 2 commits into from
May 17, 2019

Conversation

Anviking
Copy link
Collaborator

@Anviking Anviking commented May 16, 2019

Issue Number

#218

Overview

  • Implemented Transaction message
  • Tested through the existing single unit-test

Comments

  • The second commit is for replacing Discrimination with Network

@Anviking Anviking self-assigned this May 16, 2019
@Anviking Anviking force-pushed the anviking/218/jörmungandr-tx branch from 64e46d6 to 23213e1 Compare May 16, 2019 15:07

2 -> isolate 64 $ do
_sig <- Hash <$> getByteString 64
error "unimplemented: New address witness scheme"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to implement as little as possible for now…

@Anviking Anviking force-pushed the anviking/218/jörmungandr-tx branch 2 times, most recently from 17b6622 to 8b4dfec Compare May 16, 2019 15:20
@Anviking Anviking force-pushed the anviking/218/jörmungandr-tx branch from 8b4dfec to 58dfa56 Compare May 16, 2019 15:23
@Anviking Anviking requested review from KtorZ and rvl May 16, 2019 17:01
@KtorZ KtorZ mentioned this pull request May 16, 2019
5 tasks
Copy link
Member

@KtorZ KtorZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@@ -70,8 +80,9 @@ data TODO = TODO
data SignedVote = SignedVote
deriving (Eq, Show)

-- Do-notation is favoured over applicative syntax for readability:
{-# ANN module ("HLint: ignore Use <$>" :: String) #-}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

, outputs =
[ TxOut
{ address = Address "3$\195xi\193\"h\154\&5\145}\245:O\"\148\163\165/h^\ENQ\245\248\229;\135\231\234E/"
, coin = Coin 14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coin 14 sounds like something I've could have put in the genesis block indeed 😂

@KtorZ KtorZ merged commit 904fe2f into master May 17, 2019
@akegalj akegalj deleted the anviking/218/jörmungandr-tx branch May 17, 2019 09:55
Copy link
Contributor

@akegalj akegalj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are two points that are confusing to me - maybe I am missing something


getTokenTransfer :: Get ([TxIn], [TxOut])
getTokenTransfer = do
inCount <- fromIntegral <$> getWord8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works this way 🤷‍♂ (+ I guess I followed the rust-decoder)

let _discrimination = discriminationValue headerByte
case kind of
-- Single Address
0x3 -> Address <$> getByteString 32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

None yet

3 participants