Skip to content

Commit

Permalink
fix eth and matic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocampos-ssa committed Jun 4, 2024
1 parent f81ee4a commit 6cff74d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/kos-sdk/src/chains/ethereum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ mod tests {

assert_eq!(
tx.hash.to_string(),
"8fa67a23aa532d7a844abe36f028a87b897cb3a3e53c66c7402ad4c766cd49d8"
"fa2b84b45d28888c43c0bda80000e4a4d2040017f3b6e4a31e7d8a4ace27db29"
);

let eth_tx = match tx.data.clone() {
Expand All @@ -587,13 +587,13 @@ mod tests {
};

assert_eq!(eth_tx.value.to_string(), "0");
assert_eq!(hex::encode(eth_tx.data), "23b872dd0000000000000000000000009858effd232b4033e47d90003d41ec34ecaeda940000000000000000000000006fac4d18c912343bf86fa7049364dd4e424ab9c000000000000000000000000000000000000000000000000000000000000003e8");
assert_eq!(hex::encode(eth_tx.data), "a9059cbb0000000000000000000000006fac4d18c912343bf86fa7049364dd4e424ab9c000000000000000000000000000000000000000000000000000000000000003e8");

let signed = ETH::sign(tx, &get_default_secret());
assert!(signed.is_ok());
assert_eq!(
signed.unwrap().hash.to_string(),
"df35692c5d74f0d0cdc29f6c0067e32294902f414b7b8a08992557f05794470c"
"f4c27caf4a9e3718d217f315e8fed3f9b739fa61c78e5ab43a7ca7d4fd1c010f"
);
}

Expand Down
7 changes: 3 additions & 4 deletions packages/kos-sdk/src/chains/polygon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,9 @@ mod tests {
None,
))
.unwrap();

assert_eq!(
tx.hash.to_string(),
"99851c74c0bd74345c5361b46ac128a3d37c3af1998af53f8c91740f3b90d6e8"
"531d345f8aa0a5ff3625d758e53ff601fa8e2a060bc7a3a1b83e50e927fbb5f5"
);

let polygon_tx = match tx.data.clone() {
Expand All @@ -319,13 +318,13 @@ mod tests {
};

assert_eq!(polygon_tx.eth.value.to_string(), "0");
assert_eq!(hex::encode(polygon_tx.eth.data), "23b872dd0000000000000000000000009858effd232b4033e47d90003d41ec34ecaeda940000000000000000000000006fac4d18c912343bf86fa7049364dd4e424ab9c000000000000000000000000000000000000000000000000000000000000003e8");
assert_eq!(hex::encode(polygon_tx.eth.data), "a9059cbb0000000000000000000000006fac4d18c912343bf86fa7049364dd4e424ab9c000000000000000000000000000000000000000000000000000000000000003e8");

let signed = MATIC::sign(tx, &get_default_secret());
assert!(signed.is_ok());
assert_eq!(
signed.unwrap().hash.to_string(),
"af025f06a080ce062313f662a67adb34ccf700777ef1120f9f8d44ed269e83e0"
"1b570ed15ef11db9860618fce69ac0a6b50cef5403cefa94c86483103ae2bde3"
);
}

Expand Down

0 comments on commit 6cff74d

Please sign in to comment.