Skip to content

Commit

Permalink
chore: test vector configs
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Oct 29, 2024
1 parent 98bebee commit 65cdabd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions packages/rs-sdk/tests/fetch/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ const DPNS_DASH_TLD_DOCUMENT_ID: [u8; 32] = [
68, 209, 224, 212, 242, 106, 141, 142, 255, 55, 207,
];

// Variables that change every time we regenerate test vectors
const DEFAULT_IDENTITY_ID_BASE58: &str = "9diBT6EQt3BfX5aMm9ryfEDQ4FAdMEWjGWwvM1Wciqei";
const DEFAULT_PROTXHASH_HEX: &str =
"069dcb6e829988af0edb245f30d3b1297a47081854a78c3cdea9fddb8fbd07eb";
pub(crate) const DEFAULT_DATA_CONTRACT_WITH_HISTORY_HEX: &str =
"3013742faada429308e22a83c72e19310b3dc93db1ceefda78fc2e8965b0805a";
#[derive(Debug, Deserialize)]
/// Configuration for dash-platform-sdk.
///
Expand Down Expand Up @@ -224,11 +230,7 @@ impl Config {
// So now I used this manually created identity to populate test vectors.
// Next time we need to do it again and update this value :(. This is terrible.
// We should automate creation of identity for SDK tests when we have time.
Identifier::from_string(
"G5z3hwiLUnRDGrLEgcqM9sX8wWEuNGHQqvioERgdZ2Tq",
Encoding::Base58,
)
.unwrap()
Identifier::from_string(DEFAULT_IDENTITY_ID_BASE58, Encoding::Base58).unwrap()
}

fn default_data_contract_id() -> Identifier {
Expand All @@ -252,7 +254,7 @@ impl Config {
///
/// See documentation of [contested_resource_identity_votes_ok](super::contested_resource_identity_votes::contested_resource_identity_votes_ok).
fn default_protxhash() -> String {
String::from("069dcb6e829988af0edb245f30d3b1297a47081854a78c3cdea9fddb8fbd07eb")
String::from(DEFAULT_PROTXHASH_HEX)
}

/// Return ProTxHash of an existing evo node, or None if not set
Expand Down
2 changes: 1 addition & 1 deletion packages/rs-sdk/tests/fetch/data_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async fn test_data_contracts_2_nx() {
async fn test_data_contract_history_read() {
let cfg = Config::new();
let id = Identifier::from_string(
"eacc9ceb6c11ee1ae82afb5590d78d686f43bc0f0e0cd65de1e23c150e41f97f",
super::config::DEFAULT_DATA_CONTRACT_WITH_HISTORY_HEX,
Encoding::Hex,
)
.unwrap();
Expand Down

0 comments on commit 65cdabd

Please sign in to comment.