This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d4c1a1
commit fc93edf
Showing
8 changed files
with
109 additions
and
17 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
syntax = "proto3"; | ||
package transaction; | ||
message TezosRawTxIn { | ||
string rawData = 1; | ||
} | ||
|
||
message TezosTxOut { | ||
string signature = 1; | ||
} | ||
|
||
message TezosKeystoreParam { | ||
string keystore = 1; | ||
string password = 2; | ||
string chainType = 3; | ||
bool overwrite = 4; | ||
} | ||
|
||
message ExportTezosKeystoreResult { | ||
string keystore = 1; | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod address; | ||
pub mod signer; | ||
pub mod transaction; | ||
|
||
mod tests { | ||
|
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,28 @@ | ||
//use crate::transaction::{TezosRawTxIn, TezosTxOut}; | ||
//use tcx_chain::Keystore; | ||
//use tcx_constants::Result; | ||
// | ||
//pub(crate) fn hash_unsigned_payload(payload: &[u8]) -> Result<Vec<u8>> { | ||
// if payload.len() > PAYLOAD_HASH_THRESHOLD { | ||
// Ok(blake2_256(&payload).to_vec()) | ||
// } else { | ||
// Ok(payload.to_vec()) | ||
// } | ||
// | ||
// | ||
//impl TraitTransactionSigner<TezosRawTxIn, SubstrateTxOut> for Keystore { | ||
// fn sign_transaction( | ||
// &mut self, | ||
// symbol: &str, | ||
// address: &str, | ||
// tx: &SubstrateRawTxIn, | ||
// ) -> Result<TezosTxOut> { | ||
// let raw_data_bytes = if tx.raw_data.starts_with("0x") { | ||
// tx.raw_data[2..].to_string() | ||
// } else { | ||
// tx.raw_data.clone() | ||
// }; | ||
// let raw_data_bytes = hex::decode(&raw_data_bytes)?; | ||
// let hash = hash_unsigned_payload(&raw_data_bytes)?; | ||
// } | ||
//} |
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 |
---|---|---|
@@ -1 +1,26 @@ | ||
|
||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct TezosRawTxIn { | ||
#[prost(string, tag = "1")] | ||
pub raw_data: std::string::String, | ||
} | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct TezosTxOut { | ||
#[prost(string, tag = "1")] | ||
pub signature: std::string::String, | ||
} | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct TezosKeystoreParam { | ||
#[prost(string, tag = "1")] | ||
pub keystore: std::string::String, | ||
#[prost(string, tag = "2")] | ||
pub password: std::string::String, | ||
#[prost(string, tag = "3")] | ||
pub chain_type: std::string::String, | ||
#[prost(bool, tag = "4")] | ||
pub overwrite: bool, | ||
} | ||
#[derive(Clone, PartialEq, ::prost::Message)] | ||
pub struct ExportTezosKeystoreResult { | ||
#[prost(string, tag = "1")] | ||
pub keystore: std::string::String, | ||
} |