Улучшить UI регистрации и связанные сценарии

This commit is contained in:
AidarKC
2026-11-08 18:04:06 +03:00
parent 9405f28525
commit 4068465ee6
66 changed files with 842 additions and 221 deletions
@@ -39,8 +39,15 @@ fn namespace_pdas_and_binaries_match_vectors() {
assert_eq!(bump.to_string(),fixture(&format!("namespace_{name}_bump")));
assert_eq!(encode_hex(hash(format!("namespace={name}").as_bytes()).as_ref()),fixture(&format!("namespace_{name}_seed")));
let registrar=if typ==2 {Some(Pubkey::new_from_array(decode_hex(&fixture("registrar_pubkey_hex")).try_into().unwrap()))}else{None};
let state=NamespaceState {namespace_type:typ,min_localpart_len:3,namespace:name.to_string(),registration_fee:fee,registrar_pubkey:registrar,server_login:if typ==2{Some("registrar@shine".to_string())}else{None}};
assert_eq!(encode_hex(&serialize_namespace(&state)),fixture(&format!("namespace_{name}_bytes_hex")));
let state=NamespaceState {namespace_type:typ,min_localpart_len:3,namespace:name.to_string(),registration_fee:fee,currency_code:1,registrar_pubkey:registrar,server_login:if typ==2{Some("registrar@shine".to_string())}else{None}};
let encoded=serialize_namespace(&state);
assert_eq!(encoded[0..2], [1,1]);
assert_eq!(encoded[5+name.len()+8], 1); // код валюты после u64 fee
// Исторические 1.0 векторы отличаются только версией и отсутствующим байтом валюты.
let mut legacy=encoded.clone();
legacy[1]=0;
legacy.remove(5+name.len()+8);
assert_eq!(encode_hex(&legacy),fixture(&format!("namespace_{name}_bytes_hex")));
}
}
#[test]