Skip to content

Commit

Permalink
Change method name Contract::create_private_key
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamaguchi committed Aug 15, 2024
1 parent fef05af commit 0f7f7c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/chain/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct Contract {

impl Contract {
/// Create private key for Pay-to-Contract
pub fn create_private_key(
pub fn create_pay_to_contract_private_key(
&self,
payment_base_private_key: &PrivateKey,
payment_base: &PublicKey,
Expand Down Expand Up @@ -98,7 +98,7 @@ mod signers_container_tests {
use crate::tapyrus::hashes::hex::FromHex;

#[test]
fn test_create_private_key() {
fn test_create_pay_to_contract_private_key() {
let payment_base_private_key = PrivateKey::from_slice(
&Vec::<u8>::from_hex(
"c5580f6c26f83fb513dd5e0d1b03c36be26fcefa139b1720a7ca7c0dedd439c2",
Expand All @@ -116,7 +116,7 @@ mod signers_container_tests {
spendable: true,
};
let key =
contract.create_private_key(&payment_base_private_key, &payment_base, Network::Dev);
contract.create_pay_to_contract_private_key(&payment_base_private_key, &payment_base, Network::Dev);
assert!(key.is_ok());
assert_eq!(
key.unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion crates/wallet/src/wallet/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ impl SignerWrapper<PrivateKey> {
) -> Option<(SecretKey, PublicKey)> {
sign_options.contracts.iter().find_map(|(_, contract)| {
let p2c_private_key = contract
.create_private_key(&self, pubkey, self.network)
.create_pay_to_contract_private_key(&self, pubkey, self.network)
.ok()?;
let p2c_public_key = p2c_private_key.public_key(secp);
if self.same_pubkey_hash(script_pubkey, &p2c_public_key) {
Expand Down

0 comments on commit 0f7f7c4

Please sign in to comment.