Skip to content

Commit

Permalink
Implement KnownParamType for HashMap
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWad3r committed Oct 2, 2023
1 parent dd1befc commit ac1b0f3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion nekoton-abi/src/known_param_type.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::collections::BTreeMap;
use std::collections::{BTreeMap, HashMap};
use std::hash::BuildHasher;

use ton_abi::{Param, ParamType};
use ton_block::{MsgAddrStd, MsgAddress, MsgAddressInt};
Expand Down Expand Up @@ -150,6 +151,17 @@ impl KnownParamType for Vec<u8> {
}
}

impl<K, V, S> KnownParamType for HashMap<K, V, S>
where
K: KnownParamType,
V: KnownParamType,
S: BuildHasher,
{
fn param_type() -> ParamType {
ParamType::Map(Box::new(K::param_type()), Box::new(V::param_type()))
}
}

impl KnownParamType for BuilderData {
fn param_type() -> ParamType {
ParamType::Cell
Expand Down

0 comments on commit ac1b0f3

Please sign in to comment.