-
Notifications
You must be signed in to change notification settings - Fork 12
Send and relay packet #250
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
27e18e5
Add more information in the packet sequence error message
majecty d3bb917
Flatten RLP serialization format of the Sequence type
majecty a41c0bd
Flatten RLP serialization format of Acknowledgement, AcknowledgementH…
majecty 9696664
Flatten JSON serialization formats of Sequene, PacketCommitmentHash, …
majecty 4e76c79
Receive block_number in the query_latest_send_packet and query_latest…
majecty 95e1e90
Use different path when save a packet according to the situation
majecty f5d6b8a
Call remove_packet only when there is a packet
majecty 66c04a5
Extract prompt code to functions in the scenario script
majecty 2aae19e
Reduce timeout in the IBC test scenario
majecty 8cb6fa3
Add datagrams about packet
majecty ca195db
Send packet in the scenario script
majecty 4771791
Check packet state in the scenario script
majecty 80c03ba
Relay packets
majecty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { Packet } from "."; | ||
|
|
||
| const RLP = require("rlp"); | ||
|
|
||
| export class AcknowledgePacketDatagram { | ||
| private packet: Packet; | ||
| private ack: Buffer; | ||
| private proof: Buffer; | ||
| private proofHeight: number; | ||
|
|
||
| public constructor({ | ||
| packet, | ||
| ack, | ||
| proof, | ||
| proofHeight | ||
| }: { | ||
| packet: Packet; | ||
| ack: Buffer; | ||
| proof: Buffer; | ||
| proofHeight: number; | ||
| }) { | ||
| this.packet = packet; | ||
| this.ack = ack; | ||
| this.proof = proof; | ||
| this.proofHeight = proofHeight; | ||
| } | ||
|
|
||
| public rlpBytes(): Buffer { | ||
| return RLP.encode(this.toEncodeObject()); | ||
| } | ||
|
|
||
| public toEncodeObject(): any[] { | ||
| return [ | ||
| 15, | ||
| this.packet.toEncodeObject(), | ||
| this.ack, | ||
| this.proof, | ||
| this.proofHeight | ||
| ]; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { Packet } from "."; | ||
|
|
||
| const RLP = require("rlp"); | ||
|
|
||
| export class RecvPacketDatagram { | ||
| private packet: Packet; | ||
| private proof: Buffer; | ||
| private proofHeight: number; | ||
| private ack: Buffer; | ||
|
|
||
| public constructor({ | ||
| packet, | ||
| proof, | ||
| proofHeight, | ||
| ack | ||
| }: { | ||
| packet: Packet; | ||
| proof: Buffer; | ||
| proofHeight: number; | ||
| ack: Buffer; | ||
| }) { | ||
| this.packet = packet; | ||
| this.proof = proof; | ||
| this.proofHeight = proofHeight; | ||
| this.ack = ack; | ||
| } | ||
|
|
||
| public rlpBytes(): Buffer { | ||
| return RLP.encode(this.toEncodeObject()); | ||
| } | ||
|
|
||
| public toEncodeObject(): any[] { | ||
| return [ | ||
| 14, | ||
| this.packet.toEncodeObject(), | ||
| this.proof, | ||
| this.proofHeight, | ||
| this.ack | ||
| ]; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Typo in the commit message 'remove_pcket'
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 fixed it. Thanks!