Skip to content

Commit

Permalink
Merge pull request #33 from radianceteam/1.26.0
Browse files Browse the repository at this point in the history
1.26.0 Update
  • Loading branch information
Paprikas authored Nov 28, 2021
2 parents 89dff23 + f85addc commit bcb7959
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 7 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

all the changes are always according to the ones of the main TON SDK library; and on top on that, there may be additional ones

1.26.0
-----
* Changes `1.26.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1260--2021-11-25

1.25.0
-----
* Changes `1.25.0` (https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1250--2021-11-08);
* Changes `1.25.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1250--2021-11-08

1.24.0
-----
* Changes `1.24.0` (https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1240--2021-10-18);
* Changes `1.24.0` https://github.com/tonlabs/TON-SDK/blob/master/CHANGELOG.md#1240--2021-10-18
* **BREAKING CHANGE** All Params now require keyword arguments

1.20.x
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TON SDK client in Ruby and for Ruby

[![Gem Version](https://badge.fury.io/rb/ton_sdk_client.svg)](https://rubygems.org/gems/ton_sdk_client)
[![TON SDK version](https://img.shields.io/badge/TON%20SDK%20version-1.25.0-green)](https://github.com/tonlabs/TON-SDK/tree/1.25.0)
[![TON SDK version](https://img.shields.io/badge/TON%20SDK%20version-1.26.0-green)](https://github.com/tonlabs/TON-SDK/tree/1.26.0)

Ruby gem-client bindings for [TON SDK](https://github.com/tonlabs/TON-SDK) which allows one to communicate with [FreeTON](https://freeton.org) blockchain in Ruby.

Expand Down
14 changes: 14 additions & 0 deletions lib/ton_sdk_client/proofs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ module ErrorCode

ParamsOfProofTransactionData = KwStruct.new(:transaction)

ParamsOfProofMessageData = KwStruct.new(:message)

#
# functions
#
Expand Down Expand Up @@ -43,5 +45,17 @@ def self.proof_transaction_data(ctx, params)
end
end
end

def self.proof_message_data(ctx, params)
Interop::request_to_native_lib(ctx, "proofs.proof_message_data", params) do |resp|
if resp.success?
yield NativeLibResponseResult.new(
result: ""
)
else
yield resp
end
end
end
end
end
4 changes: 2 additions & 2 deletions lib/ton_sdk_client/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module TonSdk
VERSION = "1.25.0"
NATIVE_SDK_VERSION = "1.25.0"
VERSION = "1.26.0"
NATIVE_SDK_VERSION = "1.26.0"
end
1 change: 1 addition & 0 deletions spec/data/proofs/message.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"id":"4a9389e2fa34a83db0c814674bc4c7569fd3e92042289e2b2d4802231ecabec9","block_id":null,"boc":"te6ccgEBAQEAWAAAq2n+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE/zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzTRXH8gAAAACXRU6lZgMMmpVZA","body":null,"body_hash":null,"bounce":true,"bounced":false,"chain_order":"5c0317am00","code":null,"code_hash":null,"created_at":1637044907,"created_at_string":"2021-11-16 06:41:47.000","created_lt":"0x12e8a9d4acc0","data":null,"data_hash":null,"dst":"-1:3333333333333333333333333333333333333333333333333333333333333333","dst_workchain_id":-1,"fwd_fee":"0x0","ihr_disabled":true,"ihr_fee":"0x0","import_fee":null,"library":null,"library_hash":null,"msg_type":0,"msg_type_name":"Internal","proof":null,"split_depth":null,"src":"-1:0000000000000000000000000000000000000000000000000000000000000000","src_workchain_id":-1,"status":5,"status_name":"Finalized","tick":null,"tock":null,"value":"0xd15c7f20","value_other":null}
35 changes: 33 additions & 2 deletions spec/proofs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def load_json(file_name)
)
end

it "proof_block_data_test" do
it "test_proof_block_data" do
block_json = load_json("block")
response = test_client.request(
"proofs.proof_block_data",
Expand Down Expand Up @@ -48,7 +48,7 @@ def load_json(file_name)
expect(response).to eq('Data differs from the proven: field `blocks.id`: expected String("8bde590a572437332977e68bace66fa00f9cebac6baa57f6bf2d2f1276db2848"), actual String("8ade590a572437332977e68bace66fa00f9cebac6baa57f6bf2d2f1276db2848")')
end

it "proof_transaction_data_test" do
it "test_proof_transaction_data" do
transaction_json = load_json("transaction")
response = test_client.request(
"proofs.proof_transaction_data",
Expand Down Expand Up @@ -78,4 +78,35 @@ def load_json(file_name)

expect(response).to eq('Data differs from the proven: field `transactions.id`: expected String("0c7e395e8eb14c173d2dde7189200f28787a05df1fa188b19224f6e19a439dc6"), actual String("1c7e395e8eb14c173d2dde7189200f28787a05df1fa188b19224f6e19a439dc6")')
end

it "test_proof_message_data" do
message = load_json("message")
response = test_client.request(
"proofs.proof_message_data",
TonSdk::Proofs::ParamsOfProofMessageData.new(
message: message
)
)

expect(response).to eq(nil)

response = test_client.request(
"proofs.proof_message_data",
TonSdk::Proofs::ParamsOfProofMessageData.new(
message: nil
)
)

expect(response).to eq("Invalid data: Message's `boc` or `id` are required")

message["id"] = "1a9389e2fa34a83db0c814674bc4c7569fd3e92042289e2b2d4802231ecabec9"
response = test_client.request(
"proofs.proof_message_data",
TonSdk::Proofs::ParamsOfProofMessageData.new(
message: message
)
)

expect(response).to eq("Proof check failed: Unable to download message data from DApp server")
end
end

0 comments on commit bcb7959

Please sign in to comment.