Skip to content

Commit

Permalink
network response cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Jun 18, 2024
1 parent e72c677 commit 0282f58
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions framework/snippets/src/network_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ pub fn parse_tx_response(tx: TransactionOnNetwork) -> TxResponse {
};
}

let mut response = TxResponse::default();
process(&mut response, &tx);
response
process_success(&tx)
}

fn process_signal_error(tx: &TransactionOnNetwork) -> TxResponseStatus {
Expand All @@ -41,10 +39,13 @@ fn process_signal_error(tx: &TransactionOnNetwork) -> TxResponseStatus {
TxResponseStatus::default()
}

fn process(tx_response: &mut TxResponse, tx: &TransactionOnNetwork) {
tx_response.out = process_out(tx);
tx_response.new_deployed_address = process_new_deployed_address(tx);
tx_response.new_issued_token_identifier = process_new_issued_token_identifier(tx);
fn process_success(tx: &TransactionOnNetwork) -> TxResponse {
TxResponse {
out: process_out(tx),
new_deployed_address: process_new_deployed_address(tx),
new_issued_token_identifier: process_new_issued_token_identifier(tx),
..Default::default()
}
}

fn process_out(tx: &TransactionOnNetwork) -> Vec<Vec<u8>> {
Expand Down

0 comments on commit 0282f58

Please sign in to comment.