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

maybe use ics18 relayer to send tx #69

Open
DaviRain-Su opened this issue Oct 21, 2022 · 0 comments
Open

maybe use ics18 relayer to send tx #69

DaviRain-Su opened this issue Oct 21, 2022 · 0 comments

Comments

@DaviRain-Su
Copy link
Contributor


impl<T: Config> Ics18Context for Context<T> {
	fn query_latest_height(&self) -> Height {
		let revision_height = host_height::<T>();
		Height::new(REVISION_NUMBER, revision_height).expect(&REVISION_NUMBER.to_string())
	}

	fn query_client_full_state(&self, client_id: &ClientId) -> Option<Box<dyn ClientState>> {
		// Forward call to Ics2.
		ClientReader::client_state(self, client_id).ok()
	}

	fn query_latest_header(&self) -> Option<Box<dyn Header>> {
		todo!()
	}

	fn send(&mut self, msgs: Vec<Any>) -> Result<Vec<IbcEvent>, ICS18Error> {
		// Forward call to Ics26 delivery method.
		let mut all_events = vec![];
		for msg in msgs {
			let MsgReceipt { mut events, .. } =
				deliver(self, msg).map_err(ICS18Error::transaction_failed)?;
			all_events.append(&mut events);
		}
		Ok(all_events)
	}

	fn signer(&self) -> Signer {
		"0CDA3F47EF3C4906693B170EF650EB968C5F4B2C".parse().unwrap()
	}
}

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

No branches or pull requests

1 participant