Skip to content

Commit

Permalink
Merge pull request #149 from tonlabs/0.25.2-rc
Browse files Browse the repository at this point in the history
Version 0.25.2
  • Loading branch information
diserere authored Jul 29, 2020
2 parents 5ce2fd9 + f52d079 commit c9a51c2
Show file tree
Hide file tree
Showing 20 changed files with 256 additions and 119 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Release Notes
All notable changes to this project will be documented in this file.

## 0.25.2 Jul 29, 2020
### New
- `error.data` object extended with fields `address`, `function_name`, `account_balance`,
`account_address`, `query_url`, `config_server` for appropriate errors

## 0.25.0 Jul 8, 2020
### New
- supports for core context in all platforms
Expand Down
2 changes: 1 addition & 1 deletion graphite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name = "graphite"
crate-type = ["rlib"]

[dependencies]
websocket = "0.22.4"
websocket = "0.26.2"
serde_json = "1.0.41"
futures = "0.3.4"
reqwest = "0.10.4"
Expand Down
8 changes: 8 additions & 0 deletions graphite/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,12 @@ impl GqlClient {
request,
&self.graphql_socket_host)?)
}

pub fn queries_server(&self) -> &str {
&self.graphql_host
}

pub fn subscriptions_server(&self) -> &str {
&self.graphql_socket_host
}
}
2 changes: 1 addition & 1 deletion ton_client/client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ton_client"
version = "0.25.0"
version = "0.25.2"
authors = ["Michael Vlasov"]
edition = "2018"
license = "Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions ton_client/client/src/contracts/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub(crate) async fn deploy(context: &mut ClientContext, params: ParamsOfDeploy)
trace!("-> -> deploy transaction: {}", tr.parsed.id());

trace!("<-");
super::run::check_transaction_status(&tr.parsed, true, &account_id)?;
super::run::check_transaction_status(&tr.parsed, true, &account_id, None)?;
Ok(ResultOfDeploy {
address: account_encode(&account_id),
already_deployed: false,
Expand Down Expand Up @@ -301,14 +301,14 @@ async fn deploy_contract(client: &NodeClient, params: ParamsOfDeploy, image: Con
workchain,
Some(client.timeouts()),
Some(try_index))
.map_err(|err| ApiError::contracts_create_run_message_failed(err))?;
.map_err(|err| ApiError::contracts_create_deploy_message_failed(err))?;

let result = Contract::process_message(client, &msg, true).await;

match result {
Err(err) =>
Err(resolve_msg_sdk_error(
client, err, &msg.serialized_message, ApiError::contracts_deploy_failed).await?),
client, err, &msg, ApiError::contracts_deploy_failed).await?),
Ok(tr) => Ok(tr)
}
}
Expand Down
4 changes: 2 additions & 2 deletions ton_client/client/src/contracts/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const EMPTY_RESULT: LoadResult = LoadResult {

fn make_result(contract: Contract) -> ApiResult<LoadResult> {
Ok(LoadResult {
id: contract.id().map(|id| id.to_hex_string()).ok(),
balance_grams: contract.balance_grams().map(|balance| balance.to_string()).ok(),
id: Some(contract.id().to_hex_string()),
balance_grams: Some(contract.balance_grams().to_string()),
})
}
13 changes: 8 additions & 5 deletions ton_client/client/src/contracts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ pub(crate) fn encode_message_with_sign(_context: &mut ClientContext, params: Par

pub(crate) fn get_function_id(_context: &mut ClientContext, params: ParamsOfGetFunctionId) -> ApiResult<ResultOfGetFunctionId> {
let contract = AbiContract::load(params.abi.to_string().as_bytes())
.map_err(|err|ApiError::contracts_get_function_id_failed(err))?;
.map_err(|err|ApiError::contracts_get_function_id_failed(err, &params.function))?;

let function = contract.function(&params.function)
.map_err(|err|ApiError::contracts_get_function_id_failed(err))?;
.map_err(|err|ApiError::contracts_get_function_id_failed(err, &params.function))?;

Ok(ResultOfGetFunctionId {
id: if params.input { function.get_input_id() } else { function.get_input_id() }
Expand Down Expand Up @@ -296,7 +296,7 @@ pub(crate) async fn process_message(context: &mut ClientContext, params: ParamsO
let transaction = match result {
Err(err) =>
return Err(run::resolve_msg_sdk_error(
client, err, &msg.serialized_message, ApiError::contracts_process_message_failed
client, err, &msg, ApiError::contracts_process_message_failed
).await?),
Ok(tr) => tr
};
Expand All @@ -307,6 +307,7 @@ pub(crate) async fn process_message(context: &mut ClientContext, params: ParamsO
params.abi,
params.function_name,
&msg.address,
None,
true)
}

Expand All @@ -318,7 +319,8 @@ pub(crate) fn process_transaction(
let transaction = serde_json::from_value(params.transaction.clone())
.map_err(|err| ApiError::invalid_params(&params.transaction.to_string(), err))?;

run::process_transaction(transaction, params.transaction, params.abi, params.function_name, &address, true)
run::process_transaction(
transaction, params.transaction, params.abi, params.function_name, &address, None, true)
}

pub(crate) fn parse_message(_context: &mut ClientContext, params: InputBoc) -> ApiResult<serde_json::Value> {
Expand Down Expand Up @@ -366,7 +368,7 @@ pub(crate) async fn wait_transaction(context: &mut ClientContext, params: Params
let transaction = match result {
Err(err) =>
return Err(run::resolve_msg_sdk_error(
client, err, &msg.serialized_message, ApiError::contracts_process_message_failed
client, err, &msg, ApiError::contracts_process_message_failed
).await?),
Ok(tr) => tr
};
Expand All @@ -377,6 +379,7 @@ pub(crate) async fn wait_transaction(context: &mut ClientContext, params: Params
params.abi,
params.function_name,
&msg.address,
None,
true)
}

Expand Down
Loading

0 comments on commit c9a51c2

Please sign in to comment.