-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(pactus): add compiler and signer tests
- Loading branch information
Showing
10 changed files
with
279 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ | |
mod pactus_address; | ||
mod pactus_compile; | ||
mod pactus_sign; | ||
mod pactus_transaction_util; | ||
mod test_cases; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
rust/tw_tests/tests/chains/pactus/pactus_transaction_util.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use tw_any_coin::test_utils::transaction_calc_tx_hash_utils::TransactionUtilHelper; | ||
use tw_coin_registry::coin_type::CoinType; | ||
|
||
use crate::chains::pactus::test_cases::transfer_1::{ | ||
TRANSACTION_NOT_SIGNED_DATA, TRANSACTION_SIGNED_DATA, TX_ID, | ||
}; | ||
|
||
#[test] | ||
fn test_pactus_transaction_util_calc_tx_hash_signed() { | ||
let encoded_tx = TRANSACTION_SIGNED_DATA; | ||
let tx_hash = TransactionUtilHelper::calc_tx_hash(CoinType::Pactus, encoded_tx); | ||
|
||
assert_eq!(tx_hash, TX_ID); | ||
} | ||
|
||
#[test] | ||
fn test_pactus_transaction_util_calc_tx_hash_not_signed() { | ||
let encoded_tx = TRANSACTION_NOT_SIGNED_DATA; | ||
let tx_hash = TransactionUtilHelper::calc_tx_hash(CoinType::Pactus, encoded_tx); | ||
|
||
assert_eq!(tx_hash, TX_ID); | ||
} |
Oops, something went wrong.