-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added copying for metablocks too #27
base: feat/hyperblock
Are you sure you want to change the base?
Conversation
process/outportBlockConverter.go
Outdated
return nil, nil | ||
} | ||
if len(outportTxPool.Transactions) == 0 { | ||
return nil, nil |
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 don't think it is fine to return here nil, nil
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.
maybe at least an empty TransactionPool
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.
removed
process/outportBlockConverter.go
Outdated
}, nil | ||
} | ||
|
||
func (o *outportBlockConverter) handleTransactionPoolV2(outportTxPool *outport.TransactionPool) (*hyperOutportBlocks.TransactionPoolV2, error) { |
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.
same in this func
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.
removed
process/outportBlockConverter.go
Outdated
@@ -535,7 +674,71 @@ func (o *outportBlockConverter) HandleShardOutportBlock(outportBlock *outport.Ou | |||
return shardOutportBlock, nil | |||
} | |||
|
|||
func (o *outportBlockConverter) copyTransactions(sourceTxs map[string]*outport.TxInfo, transactionPool *hyperOutportBlocks.TransactionPoolV2) error { | |||
func (o *outportBlockConverter) copyTransactions(sourceTxs map[string]*outport.TxInfo) (map[string]*hyperOutportBlocks.TxInfo, error) { |
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.
for copyTransactions
we return txs and for copyTransactionsV2
we pass the map and modify it, can we have the same approach?
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.
replaced.
process/outportBlockConverter.go
Outdated
return txInfo, nil | ||
} | ||
|
||
func (o *outportBlockConverter) copyTransactionsV2(sourceTxs map[string]*outport.TxInfo, transactionPool *hyperOutportBlocks.TransactionPoolV2) error { |
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.
why do we still need copyTransactions v1 and v2?
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.
same for other copies
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.
metaoutportblock is using TxInfoV1. I could switch that as well, and therefore removed the whole versioning.
process/outportBlockConverter.go
Outdated
}, nil | ||
} | ||
|
||
// HandleShardOutportBlock will convert an outport.OutportBlock to hyperOutportBlocks.ShardOutportBlockV2 |
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.
update comment here, without v2
Added whole copying mechanism similar to the one in shard blocks due to a serialization issue of hashes in proto.