From 0705f59902891f58d7049c54f3059b03b6801d75 Mon Sep 17 00:00:00 2001 From: Fusee Date: Sat, 11 Nov 2023 18:51:47 +0100 Subject: [PATCH] implemented QueryExecutor for String --- executor/src/network/query.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/executor/src/network/query.rs b/executor/src/network/query.rs index bcde1c1..2c47c2e 100644 --- a/executor/src/network/query.rs +++ b/executor/src/network/query.rs @@ -87,4 +87,15 @@ impl QueryExecutor for &str { async fn execute(&self, request: &ScCallStep) -> Result where OutputManaged: TopDecodeMulti + NativeConvertible + Send + Sync { ProxyQueryExecutor::new(self).execute::(request).await } +} + +#[async_trait] +impl QueryExecutor for String { + /// Allows using a string representing the gateway URL to execute a query on the real blockchain environment. + /// + /// This implementation creates a new `ProxyQueryExecutor` instance using the string as the gateway URL, + /// and delegates the query execution to it. + async fn execute(&self, request: &ScCallStep) -> Result where OutputManaged: TopDecodeMulti + NativeConvertible + Send + Sync { + self.as_str().execute::(request).await + } } \ No newline at end of file