add test for borsh serialize
@@ -196,4 +196,13 @@ mod tests {
let key = AccountId::try_from("alice.near").unwrap();
assert_eq!(key.as_ref(), &"alice.near".to_string());
}
+
+ #[test]
+ fn borsh_serialize_impl() {
+ let id = "test.near";
+ let account_id = AccountId::new_unchecked(id.to_string());
+
+ // Test to make sure the account ID is serialized as a string through borsh
+ assert_eq!(str::try_to_vec(&id).unwrap(), account_id.try_to_vec().unwrap());
+ }
}
