diff --git a/py/libbolt.py b/py/libbolt.py index 0b3947f..edae1c0 100644 --- a/py/libbolt.py +++ b/py/libbolt.py @@ -58,11 +58,11 @@ class Libbolt(object): self.lib.ffishim_bidirectional_pay_verify_payment_token.argtypes = (c_void_p, c_void_p) self.lib.ffishim_bidirectional_pay_verify_payment_token.restype = c_void_p - self.lib.ffishim_bidirectional_customer_refund.argtypes = (c_void_p, c_void_p) - self.lib.ffishim_bidirectional_customer_refund.restype = c_void_p + self.lib.ffishim_bidirectional_customer_close.argtypes = (c_void_p, c_void_p) + self.lib.ffishim_bidirectional_customer_close.restype = c_void_p - # self.lib.ffishim_bidirectional_merchant_refund.argtypes = (c_void_p, c_void_p, c_void_p, c_void_p, c_void_p, c_void_p) - # self.lib.ffishim_bidirectional_merchant_refund.restype = c_void_p + # self.lib.ffishim_bidirectional_merchant_close.argtypes = (c_void_p, c_void_p, c_void_p, c_void_p, c_void_p, c_void_p) + # self.lib.ffishim_bidirectional_merchant_close.restype = c_void_p # # self.lib.ffishim_bidirectional_resolve.argtypes = (c_void_p, c_void_p, c_void_p, c_void_p, c_void_p) # self.lib.ffishim_bidirectional_resolve.restype = c_void_p @@ -142,8 +142,8 @@ class Libbolt(object): # CLOSE - def bidirectional_customer_refund(self, channel_state, cust_wallet): - output_string = self.lib.ffishim_bidirectional_customer_refund(channel_state.encode(), cust_wallet.encode()) + def bidirectional_customer_close(self, channel_state, cust_wallet): + output_string = self.lib.ffishim_bidirectional_customer_close(channel_state.encode(), cust_wallet.encode()) output_dictionary = ast.literal_eval(ctypes.cast(output_string, ctypes.c_char_p).value.decode('utf-8')) return output_dictionary['cust_close'] @@ -247,6 +247,6 @@ print("Revoke token: ", revoke_token) (pay_token, merch_wallet) = libbolt.bidirectional_pay_verify_revoke_token(revoke_token, merch_wallet) print("Pay token: ", pay_token) -cust_close_msg = libbolt.bidirectional_customer_refund(channel_state, cust_wallet) +cust_close_msg = libbolt.bidirectional_customer_close(channel_state, cust_wallet) print("Cust close msg: ", cust_close_msg) print("<========================================>") diff --git a/src/util.rs b/src/util.rs index e9abc6c..2ae30ab 100644 --- a/src/util.rs +++ b/src/util.rs @@ -201,9 +201,9 @@ pub struct RevokedMessage { } impl RevokedMessage { - pub fn new(_msgtype: String, _wpk: secp256k1::PublicKey) -> RevokedMessage { // _sig: Option<[u8; 64]> + pub fn new(_msgtype: String, _wpk: secp256k1::PublicKey) -> RevokedMessage { RevokedMessage { - msgtype: _msgtype, wpk: _wpk // , sig: _sig + msgtype: _msgtype, wpk: _wpk } } @@ -213,10 +213,6 @@ impl RevokedMessage { input_buf.extend_from_slice(self.msgtype.as_bytes()); v.push(hash_to_fr::(input_buf)); v.push(hash_pubkey_to_fr::(&self.wpk)); - - //if !self.sig.is_none() { - // v.push(hash_buffer_to_fr::(&self.msgtype, &self.sig.unwrap())); - //} return v; }