-
Notifications
You must be signed in to change notification settings - Fork 213
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
First exploration: Jörmungandr NetworkLayer #366
The head ref may contain hidden characters: "anviking/219/j\u00F6rmungandr-network-layer"
Conversation
Sounds like a good idea. Extend the |
Why though ? |
initWallet = Wallet mempty mempty (SlotId 0 0, error "todo: genesisHash") |
Good point. I guess we have our first configuration parameter then 😅 |
blocks `shouldBe` Right [] | ||
|
||
it "should work for the first epoch" $ do | ||
Right blocks <- runExceptT $ nextBlocks network (SlotId 0 0) | ||
Right blocks <- runExceptT $ nextBlocks network (SlotId 0 0, undefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea was more like.. to update the network layer to play nicely with this. Which implies also an update in the http bridge implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to have:
data NetworkLayer t m = NetworkLayer
{ nextBlocks :: BlockHeader -> ExceptT ErrNetworkUnreachable m [Block]
, networkTip :: ExceptT ErrNetworkTip m BlockHeader
And these tests use the NetworkLayer
, not the HttpBridgeLayer
.
Without parametrising over tip
, I don't see how we can avoid supplying undefined
in place of a Hash "BlockHeader"
here.
🤔 Oops, it would be the Originally I believed we would have the |
Well, we don't have the "current" block header either when we initially instantiate the wallet. I wouldn't go for a |
Starting from a clean slate -> #384 |
@@ -461,34 +462,35 @@ newWalletLayer db nw tl = do | |||
restoreSleep wid slot | |||
Right blocks -> do | |||
let next = view #slotId . header . last $ blocks | |||
let nextBlock = BlockId $ view #prevBlockHash. header . last $ blocks -- TODO: WRONG!! THIS IS PARENT!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think nextBlocks nw
should be responsible for returning a new cursor
Issue Number
#219
Overview
Just exploring. WIP.
(SlotId, BlockId)
. Should maybe haveBlockHeader
instead.HasGenesisHash target
or something)Comments
undefined
s we have to pass in the tests are a bit unpleasant.newtype BlockId