Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for additional extensions on output/input tx #36

Open
Jovonni opened this issue Mar 7, 2021 · 0 comments
Open

Add support for additional extensions on output/input tx #36

Jovonni opened this issue Mar 7, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Jovonni
Copy link
Contributor

Jovonni commented Mar 7, 2021

For example, since components of each tx are referenced directly, we can add checks for additional data, and run error-handled computation before/after main tx execution process:

let tx_sections: Vec<&str> = decoded.split(" ").collect::<Vec<_>>();
let partner_tx_sender: String = String::from(tx_sections[0]);
let tx_partner_hash: String = String::from(tx_sections[1]);
let tx_signature: String = String::from(tx_sections[2]);
let tx_public_key: String = String::from(tx_sections[3]);
// id state has the sender key
if state_as_json.has_key( &(format!("{}", tx_partner_hash).to_string()) ) {
let partner_tx: Option<&str> = state_as_json[ tx_partner_hash ].as_str();
// if partner hash exists
if partner_tx.clone().is_some() {
println!("INPUT: partner tx: {}", partner_tx.unwrap());
//let b64_decoded_partner: Result<String, String> = Encoder::decode_base64($tx_data);
let b64_decoded_partner: String = Encoder::decode_base64( String::from( partner_tx.clone().unwrap() ) ).unwrap();
println!("INPUT: b64_decoded_partner: {}", b64_decoded_partner);
let partner_tx_sections: Vec<&str> = b64_decoded_partner.split(" ").collect::<Vec<_>>();
// let partner_tx_sender: String = String::from(partner_tx_sections[0]);
let public_key_hash_section: String = String::from(partner_tx_sections[0]);
let partner_amount_section: String = String::from(partner_tx_sections[1]);

@Jovonni Jovonni added the enhancement New feature or request label Mar 7, 2021
@Jovonni Jovonni self-assigned this Mar 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant