-
Notifications
You must be signed in to change notification settings - Fork 12
Fix relayer to update each chain's light client successfully #231
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
Changes from all commits
7c7976d
b67cb6d
5a77ac1
a2a581d
02095c0
fa51eb3
004f660
c41a974
3692890
8831e61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ use ibc::client_02 as ibc_client; | |
| use ibc::connection_03 as ibc_connection; | ||
| use ibc::context as ibc_context; | ||
| use rlp::{Decodable, Rlp}; | ||
| use rustc_hex::ToHex; | ||
|
|
||
| pub fn execute( | ||
| bytes: &[u8], | ||
|
|
@@ -58,8 +59,9 @@ pub fn execute( | |
| id, | ||
| header, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make the UpdateClient function use the correnct method name in log |
||
| } => { | ||
| cdebug!(IBC, "Update client {} {}", id, header.to_hex()); | ||
| let mut client_manager = ibc_client::Manager::new(&mut context); | ||
| client_manager.update(&id, header).map_err(|err| RuntimeError::IBC(format!("CreateClient: {:?}", err)))?; | ||
| client_manager.update(&id, header).map_err(|err| RuntimeError::IBC(format!("UpdateClient: {:?}", err)))?; | ||
| Ok(()) | ||
| } | ||
| Datagram::ConnOpenInit { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,17 +54,34 @@ export class Chain { | |
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we send transactions without waiting for inclusion, Foundy can |
||
|
|
||
| public async submitDatagram(datagram: Datagram): Promise<void> { | ||
| const ibcAction = new IBC(this.sdk.networkId, datagram.rlpBytes()); | ||
| await this.submitDatagrams([datagram]); | ||
| } | ||
|
|
||
| public async submitDatagrams(datagrams: Datagram[]): Promise<void> { | ||
| const txHashes = []; | ||
| const seq = await this.sdk.rpc.chain.getSeq(this.faucetAddress); | ||
| const signedTx = await this.sdk.key.signTransaction(ibcAction, { | ||
| account: this.faucetAddress, | ||
| fee: 100, | ||
| seq | ||
| }); | ||
|
|
||
| const txHash = await this.sdk.rpc.chain.sendSignedTransaction(signedTx); | ||
| await waitForTx(this.sdk, txHash); | ||
| for (let i = 0; i < datagrams.length; i += 1) { | ||
| const datagram = datagrams[i]; | ||
| const ibcAction = new IBC(this.sdk.networkId, datagram.rlpBytes()); | ||
|
|
||
| const signedTx = await this.sdk.key.signTransaction(ibcAction, { | ||
| account: this.faucetAddress, | ||
| fee: 100, | ||
| seq: seq + i | ||
| }); | ||
|
|
||
| debug(`Send tx with seq ${seq + i}`); | ||
| const txHash = await this.sdk.rpc.chain.sendSignedTransaction( | ||
| signedTx | ||
| ); | ||
| txHashes.push(txHash); | ||
| } | ||
|
|
||
| for (const txHash of txHashes) { | ||
| debug(`Wait for tx ${txHash}`); | ||
| await waitForTx(this.sdk, txHash); | ||
| } | ||
| } | ||
|
|
||
| public async latestHeight(): Promise<number> { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.