File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -207,18 +207,17 @@ impl<T> KeyValueAddress<T> {
207207
208208impl < T : DeserializeOwned > KeyValueAddress < T > {
209209 fn read ( & self , host : & Iroha ) -> Result < Option < T > > {
210- let meta = match & self . entity {
210+ let maybe_json = match & self . entity {
211211 KeyValueAddressEntity :: Trigger ( id) => host
212212 . query ( FindTriggers )
213213 . filter_with ( |x| x. id . eq ( id. to_owned ( ) ) )
214- . select_with ( |x| x. action . metadata )
215- . execute_single ( ) ,
214+ . select_with ( |x| x. action . metadata . key ( self . key . to_owned ( ) ) )
215+ . execute_single_opt ( ) ,
216216 _ => todo ! ( ) ,
217217 }
218218 . map_err ( |err| anyhow ! ( "failed query: {err}" ) ) ?;
219219
220- let maybe_value = meta
221- . get ( & self . key )
220+ let maybe_value = maybe_json
222221 . map ( |json| json. try_into_any ( ) . with_context ( || "cannot deserialize" ) )
223222 . transpose ( ) ?;
224223
You can’t perform that action at this time.
0 commit comments