From 7e8fe11a634e203e21d652f0996eb0f2e84a7f4e Mon Sep 17 00:00:00 2001 From: Stan Bondi Date: Fri, 14 Feb 2025 15:31:52 +0400 Subject: [PATCH] fix!: remove json_results conversion from transaction results (#1292) Description --- fix!: remove json_results conversion from transaction results Motivation and Context --- When a component returns a map that does not have string keys (e.g. `indexMap<(u32, u32), MyVal>`) the indexer errors because it cannot convert it to the "special" json format. I have not been able to find any usage of this format so I have removed it in the PR. How Has This Been Tested? --- Manually, CI What process can a PR reviewer use to test or verify this change? --- N/A Breaking Changes --- - [ ] None - [ ] Requires data directory to be deleted - [x] Other - Please specify BREAKING CHANGE: Indexer and wallet results no longer have the `json_result` field --- Cargo.lock | 3 - .../tari_dan_app_utilities/Cargo.toml | 2 - .../src/json_encoding.rs | 192 ------------------ .../tari_dan_app_utilities/src/lib.rs | 1 - .../src/handlers/transaction.rs | 18 -- .../src/indexer_jrpc_impl.rs | 2 - .../tari_dan_wallet_web_ui/package-lock.json | 4 +- .../tari_indexer/src/json_rpc/handlers.rs | 48 ++--- .../tari_indexer_web_ui/package-lock.json | 2 +- .../package-lock.json | 2 +- .../IndexerTransactionFinalizedResult.d.ts | 1 - .../TransactionGetResultResponse.d.ts | 1 - .../TransactionSubmitDryRunResponse.d.ts | 1 - .../TransactionWaitResultResponse.d.ts | 1 - bindings/package.json | 2 +- .../IndexerTransactionFinalizedResult.ts | 1 - .../TransactionGetResultResponse.ts | 1 - .../TransactionSubmitDryRunResponse.ts | 1 - .../TransactionWaitResultResponse.ts | 1 - .../wallet_daemon_client/package.json | 2 +- clients/tari_indexer_client/src/types.rs | 3 - clients/wallet_daemon_client/src/types.rs | 6 - dan_layer/wallet/sdk/Cargo.toml | 1 - dan_layer/wallet/sdk/src/network.rs | 2 - 24 files changed, 21 insertions(+), 277 deletions(-) delete mode 100644 applications/tari_dan_app_utilities/src/json_encoding.rs diff --git a/Cargo.lock b/Cargo.lock index 51ac4efd85..27dc6fa8ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9614,7 +9614,6 @@ dependencies = [ "rand", "reqwest", "serde", - "serde_json", "tari_base_node_client", "tari_bor", "tari_common", @@ -9635,7 +9634,6 @@ dependencies = [ "tari_template_lib", "tari_template_manager", "tari_transaction", - "tari_validator_node_rpc", "thiserror 1.0.68", "tokio", "url", @@ -9879,7 +9877,6 @@ dependencies = [ "jsonwebtoken", "log", "serde", - "serde_json", "tari_bor", "tari_common", "tari_common_types", diff --git a/applications/tari_dan_app_utilities/Cargo.toml b/applications/tari_dan_app_utilities/Cargo.toml index ad767289d0..a02007e753 100644 --- a/applications/tari_dan_app_utilities/Cargo.toml +++ b/applications/tari_dan_app_utilities/Cargo.toml @@ -27,7 +27,6 @@ tari_transaction = { workspace = true } tari_bor = { workspace = true, default-features = true } tari_indexer_lib = { workspace = true } tari_networking = { workspace = true } -tari_validator_node_rpc = { workspace = true } anyhow = { workspace = true } async-trait = { workspace = true } @@ -39,7 +38,6 @@ multiaddr = { workspace = true } rand = { workspace = true } reqwest = { workspace = true } serde = { workspace = true, features = ["default", "derive"] } -serde_json = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = [ "default", diff --git a/applications/tari_dan_app_utilities/src/json_encoding.rs b/applications/tari_dan_app_utilities/src/json_encoding.rs deleted file mode 100644 index f04488fa21..0000000000 --- a/applications/tari_dan_app_utilities/src/json_encoding.rs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2023 The Tari Project -// SPDX-License-Identifier: BSD-3-Clause - -use serde_json as json; -use tari_engine_types::{ - commit_result::FinalizeResult, - component::ComponentHeader, - non_fungible::NonFungibleContainer, - substate::{Substate, SubstateValue}, -}; -use tari_validator_node_rpc::client::FinalizedResult; - -type JsonObject = json::Map; -type CborValue = tari_bor::Value; - -#[derive(Debug, thiserror::Error)] -pub enum JsonEncodingError { - #[error("Could not decode the substate: {0}")] - BinaryEncoding(#[from] tari_bor::BorError), - #[error("Serde error: {0}")] - Serde(#[from] serde_json::Error), - #[error("Unexpected error: {0}")] - Unexpected(String), -} - -pub fn encode_finalized_result_into_json(result: &FinalizedResult) -> Result, JsonEncodingError> { - match &result.execute_result { - Some(res) => encode_finalize_result_into_json(&res.finalize), - None => Ok(vec![]), - } -} - -pub fn encode_finalize_result_into_json(finalize: &FinalizeResult) -> Result, JsonEncodingError> { - finalize - .execution_results - .iter() - .map(|r| serde_json::to_value(r.indexed.value()).map_err(JsonEncodingError::Serde)) - .collect() -} - -pub fn encode_substate_into_json(substate: &Substate) -> Result { - let substate_cbor = tari_bor::to_value(&substate)?; - let substate_cbor = fix_invalid_object_keys(&substate_cbor); - let mut result = json::to_value(substate_cbor)?; - - let substate_field = get_mut_json_field(&mut result, "substate")?; - match substate.substate_value() { - SubstateValue::NonFungible(nf_container) => { - encode_non_fungible_into_json(nf_container, substate_field)?; - }, - SubstateValue::Component(header) => { - encode_component_into_json(header, substate_field)?; - }, - _ => {}, - } - - Ok(result) -} - -fn get_mut_json_field<'a>( - value: &'a mut json::Value, - field_name: &str, -) -> Result<&'a mut json::Value, JsonEncodingError> { - let json_field = json_value_as_object(value)? - .get_mut(field_name) - .ok_or(JsonEncodingError::Unexpected("field does not exist".to_owned()))?; - - Ok(json_field) -} - -fn json_value_as_object(value: &mut json::Value) -> Result<&mut JsonObject, JsonEncodingError> { - let json_object = value - .as_object_mut() - .ok_or(JsonEncodingError::Unexpected("invalid object".to_owned()))?; - - Ok(json_object) -} - -fn encode_non_fungible_into_json( - nf_container: &NonFungibleContainer, - substate_json_field: &mut json::Value, -) -> Result<(), JsonEncodingError> { - if let Some(nf) = nf_container.contents() { - let non_fungible_field = get_mut_json_field(substate_json_field, "NonFungible")?; - let non_fungible_object = json_value_as_object(non_fungible_field)?; - - fix_cbor_value_for_json(nf.data(), non_fungible_object, "data")?; - fix_cbor_value_for_json(nf.mutable_data(), non_fungible_object, "mutable_data")?; - } - - Ok(()) -} - -fn fix_cbor_value_for_json( - cbor_value: &tari_bor::Value, - parent_object: &mut JsonObject, - field_name: &str, -) -> Result<(), JsonEncodingError> { - let cbor_value = fix_invalid_object_keys(cbor_value); - let json_value = serde_json::to_value(cbor_value)?; - parent_object.insert(field_name.to_owned(), json_value); - - Ok(()) -} - -fn encode_component_into_json( - header: &ComponentHeader, - substate_json_field: &mut json::Value, -) -> Result<(), JsonEncodingError> { - let component_field = get_mut_json_field(substate_json_field, "Component")?; - let component_object = json_value_as_object(component_field)?; - fix_cbor_value_for_json(header.state(), component_object, "state")?; - - Ok(()) -} - -/// In JSON, all object keys must be string values. -/// But ciborium sometimes will use other types (e.g. Tags) as keys, -/// so in that case we transform the object into an array so it can be safely converted to JSON -/// AND we need to to it recursively -fn fix_invalid_object_keys(value: &CborValue) -> CborValue { - match value { - CborValue::Tag(tag, content) => { - let fixed_content = fix_invalid_object_keys(content); - CborValue::Tag(*tag, Box::new(fixed_content)) - }, - CborValue::Array(arr) => { - let fixed_items = arr.iter().map(fix_invalid_object_keys).collect(); - CborValue::Array(fixed_items) - }, - CborValue::Map(map) => { - let has_invalid_keys = map.iter().any(|(k, _)| !k.is_text()); - - if has_invalid_keys { - let map_entries_as_arrays = map - .iter() - .map(|(k, v)| { - let fixed_key = fix_invalid_object_keys(k); - let fixed_value = fix_invalid_object_keys(v); - CborValue::Array(vec![fixed_key, fixed_value]) - }) - .collect(); - return CborValue::Array(map_entries_as_arrays); - } - - let fixed_entries = map - .iter() - .map(|(k, v)| { - let fixed_value = fix_invalid_object_keys(v); - (k.clone(), fixed_value) - }) - .collect(); - CborValue::Map(fixed_entries) - }, - // other types are atomic and do not cause problems, so we just return them directly - _ => value.to_owned(), - } -} - -#[cfg(test)] -mod tests { - use tari_common_types::types::Commitment; - use tari_engine_types::{confidential::ConfidentialOutput, resource_container::ResourceContainer, vault::Vault}; - use tari_template_lib::models::{Amount, EncryptedData, ResourceAddress}; - - use super::*; - - #[test] - fn it_encodes_confidential_vaults() { - let address = ResourceAddress::new(Default::default()); - - let commitment = Commitment::default(); - let confidential_output = ConfidentialOutput { - commitment: commitment.clone(), - stealth_public_nonce: commitment.as_public_key().clone(), - encrypted_data: EncryptedData::try_from(vec![0; EncryptedData::min_size()]).unwrap(), - minimum_value_promise: 0, - viewable_balance: None, - }; - let commitment = Some((commitment, confidential_output)); - - let revealed_amount = Amount::zero(); - let container = ResourceContainer::confidential(address, commitment, revealed_amount); - - let vault = Vault::new(container); - - let substate_value = SubstateValue::Vault(vault); - let substate = Substate::new(0, substate_value); - - assert!(encode_substate_into_json(&substate).is_ok()); - } -} diff --git a/applications/tari_dan_app_utilities/src/lib.rs b/applications/tari_dan_app_utilities/src/lib.rs index 8c63c68e27..0c51a0961f 100644 --- a/applications/tari_dan_app_utilities/src/lib.rs +++ b/applications/tari_dan_app_utilities/src/lib.rs @@ -23,7 +23,6 @@ pub mod base_layer_scanner; pub mod common; pub mod configuration; -pub mod json_encoding; pub mod keypair; pub mod p2p_config; pub mod seed_peer; diff --git a/applications/tari_dan_wallet_daemon/src/handlers/transaction.rs b/applications/tari_dan_wallet_daemon/src/handlers/transaction.rs index 7d7634ddde..db9dd9e3f6 100644 --- a/applications/tari_dan_wallet_daemon/src/handlers/transaction.rs +++ b/applications/tari_dan_wallet_daemon/src/handlers/transaction.rs @@ -6,7 +6,6 @@ use anyhow::anyhow; use axum_jrpc::error::{JsonRpcError, JsonRpcErrorReason}; use futures::{future, future::Either}; use log::*; -use tari_dan_app_utilities::json_encoding; use tari_dan_common_types::{optional::Optional, Epoch}; use tari_dan_wallet_sdk::apis::{jwt::JrpcPermission, key_manager}; use tari_template_lib::{args, models::Amount}; @@ -226,12 +225,9 @@ pub async fn handle_submit_dry_run( .submit_dry_run_transaction(transaction, autofill_inputs) .await?; - let json_result = json_encoding::encode_finalize_result_into_json(&exec_result.finalize)?; - Ok(TransactionSubmitDryRunResponse { transaction_id: exec_result.finalize.transaction_hash.into_array().into(), result: exec_result, - json_result, }) } @@ -296,17 +292,10 @@ pub async fn handle_get_result( .optional()? .ok_or(HandlerError::NotFound)?; - let json_result = transaction - .finalize - .as_ref() - .map(json_encoding::encode_finalize_result_into_json) - .transpose()?; - Ok(TransactionGetResultResponse { transaction_id: req.transaction_id, result: transaction.finalize, status: transaction.status, - json_result, }) } @@ -328,15 +317,12 @@ pub async fn handle_wait_result( .ok_or(HandlerError::NotFound)?; if let Some(result) = transaction.finalize { - let json_result = json_encoding::encode_finalize_result_into_json(&result)?; - return Ok(TransactionWaitResultResponse { transaction_id: req.transaction_id, result: Some(result), status: transaction.status, final_fee: transaction.final_fee.unwrap_or_default(), timed_out: false, - json_result: Some(json_result), }); } @@ -359,14 +345,12 @@ pub async fn handle_wait_result( match evt_or_timeout { Some(WalletEvent::TransactionFinalized(event)) if event.transaction_id == req.transaction_id => { - let json_result = json_encoding::encode_finalize_result_into_json(&event.finalize)?; return Ok(TransactionWaitResultResponse { transaction_id: req.transaction_id, result: Some(event.finalize), status: event.status, final_fee: event.final_fee, timed_out: false, - json_result: Some(json_result), }); }, Some(WalletEvent::TransactionInvalid(event)) if event.transaction_id == req.transaction_id => { @@ -376,7 +360,6 @@ pub async fn handle_wait_result( status: event.status, final_fee: event.final_fee.unwrap_or_default(), timed_out: false, - json_result: None, }); }, Some(_) => continue, @@ -387,7 +370,6 @@ pub async fn handle_wait_result( status: transaction.status, final_fee: Amount::zero(), timed_out: true, - json_result: None, }); }, }; diff --git a/applications/tari_dan_wallet_daemon/src/indexer_jrpc_impl.rs b/applications/tari_dan_wallet_daemon/src/indexer_jrpc_impl.rs index a0931ccfe0..96f56e9b6b 100644 --- a/applications/tari_dan_wallet_daemon/src/indexer_jrpc_impl.rs +++ b/applications/tari_dan_wallet_daemon/src/indexer_jrpc_impl.rs @@ -221,14 +221,12 @@ fn convert_indexer_result_to_wallet_result(result: IndexerTransactionFinalizedRe finalized_time, execution_time, abort_details, - json_results, } => TransactionFinalizedResult::Finalized { final_decision, execution_result, execution_time, finalized_time, abort_details, - json_results, }, } } diff --git a/applications/tari_dan_wallet_web_ui/package-lock.json b/applications/tari_dan_wallet_web_ui/package-lock.json index 6fa004b20f..967259f87f 100644 --- a/applications/tari_dan_wallet_web_ui/package-lock.json +++ b/applications/tari_dan_wallet_web_ui/package-lock.json @@ -41,7 +41,7 @@ }, "../../bindings": { "name": "@tari-project/typescript-bindings", - "version": "1.4.1", + "version": "1.5.0", "license": "ISC", "devDependencies": { "shx": "^0.3.4", @@ -53,7 +53,7 @@ "version": "1.4.1", "license": "ISC", "dependencies": { - "@tari-project/typescript-bindings": "^1.4.1" + "@tari-project/typescript-bindings": "^1.5.0" }, "devDependencies": { "typescript": "^5.3.3" diff --git a/applications/tari_indexer/src/json_rpc/handlers.rs b/applications/tari_indexer/src/json_rpc/handlers.rs index e121b8b711..b1665ee963 100644 --- a/applications/tari_indexer/src/json_rpc/handlers.rs +++ b/applications/tari_indexer/src/json_rpc/handlers.rs @@ -33,11 +33,7 @@ use log::{info, warn}; use serde_json::{self as json, json, Value}; use tari_base_node_client::{grpc::GrpcBaseNodeClient, types::BaseLayerConsensusConstants, BaseNodeClient}; use tari_crypto::tari_utilities::hex::to_hex; -use tari_dan_app_utilities::{ - json_encoding::{encode_finalize_result_into_json, encode_finalized_result_into_json}, - keypair::RistrettoKeypair, - substate_file_cache::SubstateFileCache, -}; +use tari_dan_app_utilities::{keypair::RistrettoKeypair, substate_file_cache::SubstateFileCache}; use tari_dan_common_types::{optional::Optional, public_key_to_peer_id, PeerAddress, SubstateRequirement}; use tari_dan_engine::{template::TemplateModuleLoader, wasm::WasmModule}; use tari_dan_p2p::TariMessagingSpec; @@ -481,9 +477,6 @@ impl JsonRpcHandlers { .await .map_err(|e| Self::internal_error(answer_id, e))?; - let json_results = encode_finalize_result_into_json(&exec_result.finalize) - .map_err(|e| Self::internal_error(answer_id, e))?; - return Ok(JsonRpcResponse::success(answer_id, SubmitTransactionResponse { result: IndexerTransactionFinalizedResult::Finalized { execution_result: Some(Box::new(exec_result)), @@ -491,7 +484,6 @@ impl JsonRpcHandlers { abort_details: None, finalized_time: Default::default(), execution_time: Default::default(), - json_results, }, transaction_id, })); @@ -642,19 +634,14 @@ impl JsonRpcHandlers { TransactionResultStatus::Pending => GetTransactionResultResponse { result: IndexerTransactionFinalizedResult::Pending, }, - TransactionResultStatus::Finalized(finalized) => { - let json_results = - encode_finalized_result_into_json(&finalized).map_err(|e| Self::internal_error(answer_id, e))?; - GetTransactionResultResponse { - result: IndexerTransactionFinalizedResult::Finalized { - final_decision: finalized.final_decision, - execution_result: finalized.execute_result.map(Box::new), - execution_time: finalized.execution_time, - finalized_time: finalized.finalized_time, - abort_details: finalized.abort_details, - json_results, - }, - } + TransactionResultStatus::Finalized(finalized) => GetTransactionResultResponse { + result: IndexerTransactionFinalizedResult::Finalized { + final_decision: finalized.final_decision, + execution_result: finalized.execute_result.map(Box::new), + execution_time: finalized.execution_time, + finalized_time: finalized.finalized_time, + abort_details: finalized.abort_details, + }, }, }; @@ -700,17 +687,12 @@ impl JsonRpcHandlers { let indexer_transaction_result = match transaction_result { TransactionResultStatus::Pending => IndexerTransactionFinalizedResult::Pending, - TransactionResultStatus::Finalized(finalized) => { - let json_results = encode_finalized_result_into_json(&finalized) - .map_err(|e| Self::internal_error(answer_id, e))?; - IndexerTransactionFinalizedResult::Finalized { - final_decision: finalized.final_decision, - execution_result: finalized.execute_result.map(Box::new), - execution_time: finalized.execution_time, - finalized_time: finalized.finalized_time, - abort_details: finalized.abort_details, - json_results, - } + TransactionResultStatus::Finalized(finalized) => IndexerTransactionFinalizedResult::Finalized { + final_decision: finalized.final_decision, + execution_result: finalized.execute_result.map(Box::new), + execution_time: finalized.execution_time, + finalized_time: finalized.finalized_time, + abort_details: finalized.abort_details, }, }; diff --git a/applications/tari_indexer_web_ui/package-lock.json b/applications/tari_indexer_web_ui/package-lock.json index 0d93bbada8..bd1c5553c8 100644 --- a/applications/tari_indexer_web_ui/package-lock.json +++ b/applications/tari_indexer_web_ui/package-lock.json @@ -37,7 +37,7 @@ }, "../../bindings": { "name": "@tari-project/typescript-bindings", - "version": "1.4.0", + "version": "1.4.1", "license": "ISC", "devDependencies": { "shx": "^0.3.4", diff --git a/applications/tari_validator_node_web_ui/package-lock.json b/applications/tari_validator_node_web_ui/package-lock.json index 178922ea6e..94718282c6 100644 --- a/applications/tari_validator_node_web_ui/package-lock.json +++ b/applications/tari_validator_node_web_ui/package-lock.json @@ -38,7 +38,7 @@ }, "../../bindings": { "name": "@tari-project/typescript-bindings", - "version": "1.4.1", + "version": "1.5.0", "license": "ISC", "devDependencies": { "shx": "^0.3.4", diff --git a/bindings/dist/types/tari-indexer-client/IndexerTransactionFinalizedResult.d.ts b/bindings/dist/types/tari-indexer-client/IndexerTransactionFinalizedResult.d.ts index e8d85aef39..a1d5d4bc51 100644 --- a/bindings/dist/types/tari-indexer-client/IndexerTransactionFinalizedResult.d.ts +++ b/bindings/dist/types/tari-indexer-client/IndexerTransactionFinalizedResult.d.ts @@ -13,6 +13,5 @@ export type IndexerTransactionFinalizedResult = "Pending" | { nanos: number; }; abort_details: string | null; - json_results: Array; }; }; diff --git a/bindings/dist/types/wallet-daemon-client/TransactionGetResultResponse.d.ts b/bindings/dist/types/wallet-daemon-client/TransactionGetResultResponse.d.ts index 5f8f5f3005..02751d203b 100644 --- a/bindings/dist/types/wallet-daemon-client/TransactionGetResultResponse.d.ts +++ b/bindings/dist/types/wallet-daemon-client/TransactionGetResultResponse.d.ts @@ -4,5 +4,4 @@ export interface TransactionGetResultResponse { transaction_id: string; status: TransactionStatus; result: FinalizeResult | null; - json_result: Array | null; } diff --git a/bindings/dist/types/wallet-daemon-client/TransactionSubmitDryRunResponse.d.ts b/bindings/dist/types/wallet-daemon-client/TransactionSubmitDryRunResponse.d.ts index b2232efcca..6b161ff411 100644 --- a/bindings/dist/types/wallet-daemon-client/TransactionSubmitDryRunResponse.d.ts +++ b/bindings/dist/types/wallet-daemon-client/TransactionSubmitDryRunResponse.d.ts @@ -2,5 +2,4 @@ import type { ExecuteResult } from "../ExecuteResult"; export interface TransactionSubmitDryRunResponse { transaction_id: string; result: ExecuteResult; - json_result: Array; } diff --git a/bindings/dist/types/wallet-daemon-client/TransactionWaitResultResponse.d.ts b/bindings/dist/types/wallet-daemon-client/TransactionWaitResultResponse.d.ts index 61bf1b16d7..c09b8ce7a1 100644 --- a/bindings/dist/types/wallet-daemon-client/TransactionWaitResultResponse.d.ts +++ b/bindings/dist/types/wallet-daemon-client/TransactionWaitResultResponse.d.ts @@ -4,7 +4,6 @@ import type { TransactionStatus } from "../TransactionStatus"; export interface TransactionWaitResultResponse { transaction_id: string; result: FinalizeResult | null; - json_result: Array | null; status: TransactionStatus; final_fee: Amount; timed_out: boolean; diff --git a/bindings/package.json b/bindings/package.json index e39fdd65af..9b79e5e112 100644 --- a/bindings/package.json +++ b/bindings/package.json @@ -1,6 +1,6 @@ { "name": "@tari-project/typescript-bindings", - "version": "1.4.1", + "version": "1.5.0", "description": "TypeScript types synchronized to the Tari Ootle Rust codebase", "homepage": "https://github.com/tari-project/tari-dan#readme", "bugs": { diff --git a/bindings/src/types/tari-indexer-client/IndexerTransactionFinalizedResult.ts b/bindings/src/types/tari-indexer-client/IndexerTransactionFinalizedResult.ts index d1fcfdca7e..e4befaac32 100644 --- a/bindings/src/types/tari-indexer-client/IndexerTransactionFinalizedResult.ts +++ b/bindings/src/types/tari-indexer-client/IndexerTransactionFinalizedResult.ts @@ -11,6 +11,5 @@ export type IndexerTransactionFinalizedResult = execution_time: { secs: number; nanos: number }; finalized_time: { secs: number; nanos: number }; abort_details: string | null; - json_results: Array; }; }; diff --git a/bindings/src/types/wallet-daemon-client/TransactionGetResultResponse.ts b/bindings/src/types/wallet-daemon-client/TransactionGetResultResponse.ts index cbac0032c9..1295d19886 100644 --- a/bindings/src/types/wallet-daemon-client/TransactionGetResultResponse.ts +++ b/bindings/src/types/wallet-daemon-client/TransactionGetResultResponse.ts @@ -6,5 +6,4 @@ export interface TransactionGetResultResponse { transaction_id: string; status: TransactionStatus; result: FinalizeResult | null; - json_result: Array | null; } diff --git a/bindings/src/types/wallet-daemon-client/TransactionSubmitDryRunResponse.ts b/bindings/src/types/wallet-daemon-client/TransactionSubmitDryRunResponse.ts index 39090a6922..d44b46c451 100644 --- a/bindings/src/types/wallet-daemon-client/TransactionSubmitDryRunResponse.ts +++ b/bindings/src/types/wallet-daemon-client/TransactionSubmitDryRunResponse.ts @@ -4,5 +4,4 @@ import type { ExecuteResult } from "../ExecuteResult"; export interface TransactionSubmitDryRunResponse { transaction_id: string; result: ExecuteResult; - json_result: Array; } diff --git a/bindings/src/types/wallet-daemon-client/TransactionWaitResultResponse.ts b/bindings/src/types/wallet-daemon-client/TransactionWaitResultResponse.ts index 4d7135bbcb..c25775cdc7 100644 --- a/bindings/src/types/wallet-daemon-client/TransactionWaitResultResponse.ts +++ b/bindings/src/types/wallet-daemon-client/TransactionWaitResultResponse.ts @@ -6,7 +6,6 @@ import type { TransactionStatus } from "../TransactionStatus"; export interface TransactionWaitResultResponse { transaction_id: string; result: FinalizeResult | null; - json_result: Array | null; status: TransactionStatus; final_fee: Amount; timed_out: boolean; diff --git a/clients/javascript/wallet_daemon_client/package.json b/clients/javascript/wallet_daemon_client/package.json index 6ef9779688..e51b99ee1f 100644 --- a/clients/javascript/wallet_daemon_client/package.json +++ b/clients/javascript/wallet_daemon_client/package.json @@ -25,7 +25,7 @@ "author": "", "license": "ISC", "dependencies": { - "@tari-project/typescript-bindings": "^1.4.1" + "@tari-project/typescript-bindings": "^1.5.0" }, "devDependencies": { "typescript": "^5.3.3" diff --git a/clients/tari_indexer_client/src/types.rs b/clients/tari_indexer_client/src/types.rs index 7014f502a3..3dd6ba5a3c 100644 --- a/clients/tari_indexer_client/src/types.rs +++ b/clients/tari_indexer_client/src/types.rs @@ -5,7 +5,6 @@ use std::time::Duration; use multiaddr::Multiaddr; use serde::{Deserialize, Serialize}; -use serde_json::Value as JsonValue; use tari_base_node_client::types::BaseLayerValidatorNode; use tari_common_types::types::{FixedHash, PublicKey}; use tari_dan_common_types::{substate_type::SubstateType, Epoch, SubstateRequirement}; @@ -234,8 +233,6 @@ pub enum IndexerTransactionFinalizedResult { #[cfg_attr(feature = "ts", ts(type = "{secs: number, nanos: number}"))] finalized_time: Duration, abort_details: Option, - #[cfg_attr(feature = "ts", ts(type = "Array"))] - json_results: Vec, }, } diff --git a/clients/wallet_daemon_client/src/types.rs b/clients/wallet_daemon_client/src/types.rs index 7a3c2c5f54..303821aa7c 100644 --- a/clients/wallet_daemon_client/src/types.rs +++ b/clients/wallet_daemon_client/src/types.rs @@ -157,8 +157,6 @@ pub struct TransactionSubmitDryRunResponse { #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, pub result: ExecuteResult, - #[cfg_attr(feature = "ts", ts(type = "Array"))] - pub json_result: Vec, } #[derive(Debug, Clone, Deserialize, Serialize)] @@ -260,8 +258,6 @@ pub struct TransactionGetResultResponse { pub transaction_id: TransactionId, pub status: TransactionStatus, pub result: Option, - #[cfg_attr(feature = "ts", ts(type = "Array | null"))] - pub json_result: Option>, } #[derive(Debug, Clone, Deserialize, Serialize)] @@ -287,8 +283,6 @@ pub struct TransactionWaitResultResponse { #[cfg_attr(feature = "ts", ts(type = "string"))] pub transaction_id: TransactionId, pub result: Option, - #[cfg_attr(feature = "ts", ts(type = "Array | null"))] - pub json_result: Option>, pub status: TransactionStatus, pub final_fee: Amount, pub timed_out: bool, diff --git a/dan_layer/wallet/sdk/Cargo.toml b/dan_layer/wallet/sdk/Cargo.toml index 63ea46306d..dac0b671ba 100644 --- a/dan_layer/wallet/sdk/Cargo.toml +++ b/dan_layer/wallet/sdk/Cargo.toml @@ -31,7 +31,6 @@ digest = { workspace = true } jsonwebtoken = { workspace = true } log = { workspace = true } serde = { workspace = true, default-features = true } -serde_json = { workspace = true } thiserror = { workspace = true } ts-rs = { workspace = true, optional = true } diff --git a/dan_layer/wallet/sdk/src/network.rs b/dan_layer/wallet/sdk/src/network.rs index 6b29869e2b..73b2cbc082 100644 --- a/dan_layer/wallet/sdk/src/network.rs +++ b/dan_layer/wallet/sdk/src/network.rs @@ -5,7 +5,6 @@ use std::time::Duration; use async_trait::async_trait; use serde::{Deserialize, Serialize}; -use serde_json::Value; use tari_dan_common_types::{substate_type::SubstateType, SubstateRequirement}; use tari_dan_storage::consensus_models::Decision; use tari_engine_types::{ @@ -92,7 +91,6 @@ pub enum TransactionFinalizedResult { execution_time: Duration, finalized_time: Duration, abort_details: Option, - json_results: Vec, }, }