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

fix(wallet/grpc): add transaction id, template_address to template_reg response #4788

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion applications/tari_app_grpc/proto/wallet.proto
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ message CreateTemplateRegistrationRequest {
uint64 fee_per_gram = 2;
}

message CreateTemplateRegistrationResponse { }
message CreateTemplateRegistrationResponse {
uint64 tx_id = 1;
bytes template_address = 2;
}

message CancelTransactionRequest {
uint64 tx_id = 1;
Expand Down
15 changes: 13 additions & 2 deletions applications/tari_console_wallet/src/grpc/wallet_grpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,12 +922,23 @@ impl wallet_server::Wallet for WalletGrpcServer {
"Template registration transaction: {:?}", transaction
);

let _ = transaction_service
let reg_output = transaction
.body
.outputs()
.iter()
.find(|o| o.features.output_type == OutputType::CodeTemplateRegistration)
.unwrap();
let template_address = reg_output.hash();

transaction_service
.submit_transaction(tx_id, transaction, 0.into(), message)
.await
.map_err(|e| Status::internal(e.to_string()))?;

Ok(Response::new(CreateTemplateRegistrationResponse {}))
Ok(Response::new(CreateTemplateRegistrationResponse {
tx_id: tx_id.as_u64(),
template_address: template_address.to_vec(),
}))
}

async fn register_validator_node(
Expand Down