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

Support get libraries with proof #7

Closed
wants to merge 34 commits into from
Closed
Changes from 3 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e87a44a
start refactoring
hacker-volodya Mar 14, 2024
fb434c0
work on request/response TL serialization
hacker-volodya Mar 14, 2024
069f532
work on server
hacker-volodya Mar 20, 2024
fbf7ea7
work on encoding to use with tokio-tower
hacker-volodya Mar 20, 2024
f424142
upd tl
hacker-volodya Mar 25, 2024
b7997d4
Merge branch 'async' of github.com:tonstack/lite-client into async
hacker-volodya Mar 25, 2024
b4434ec
upd
hacker-volodya Mar 25, 2024
4cf3a3f
Merge branch 'async' of github.com:tonstack/lite-client into async
hacker-volodya Mar 25, 2024
0467eab
remove codec
hacker-volodya Mar 25, 2024
cc927de
upd
hacker-volodya Mar 26, 2024
c5b7ed1
update adnl, add layers
hacker-volodya Mar 26, 2024
cc9b971
Update Cargo.toml
hacker-volodya Mar 27, 2024
447cb32
Update Cargo.toml
hacker-volodya Mar 27, 2024
7198625
Add getBlockHeader flags
hacker-volodya Mar 27, 2024
3ca531b
Merge branch 'async' of github.com:tonstack/lite-client into async
hacker-volodya Mar 27, 2024
f5f34cf
Add more logging
hacker-volodya Mar 29, 2024
452ac44
Add tcp.ping message type, make error wrapper work with request/respo…
hacker-volodya Apr 15, 2024
f5ef8f0
int -> uint for all fields which not require negative values
hacker-volodya Apr 24, 2024
9adac48
int -> uint
hacker-volodya Apr 24, 2024
3059856
Add Eq + Hash to BlockIdExt
hacker-volodya May 3, 2024
3d1889b
impl Hash for Int256
hacker-volodya May 3, 2024
2de33a6
Add seqno flag for LookupBlock
hacker-volodya May 3, 2024
18a2eae
Add debug logs
hacker-volodya May 6, 2024
86a7cfa
Add block header modes for LookupBlock
hacker-volodya May 9, 2024
8a93445
Add GetConfigParams, GetConfigAll, ConfigInfo modes
hacker-volodya Jun 21, 2024
8289d25
Merge branch 'async' of github.com:tonstack/lite-client into async
hacker-volodya Jun 21, 2024
c3d8bb6
Update config flags
hacker-volodya Jun 28, 2024
480b758
Add flags for GetBlockProof
hacker-volodya Jul 1, 2024
9bdac8d
Support getLibraries
Aug 21, 2024
42a0342
Update github-ci
Aug 21, 2024
984bcac
Merge pull request #1 from ston-fi/support-get-libraries-method
Aug 21, 2024
b1242da
Support getLibraries method (#6)
Aug 21, 2024
28abef4
Merge branch 'tonstack:async' into async
dbaranovstonfi Aug 23, 2024
c4ab144
support liteServer.getLibrariesWithProof
Aug 29, 2024
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
6 changes: 3 additions & 3 deletions liteapi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -5,12 +5,12 @@ edition = "2021"

[dependencies]
adnl = { git = "https://github.com/tonstack/adnl-rs", branch = "server" }
tl-proto = { version = "0.4.5", features = ["bytes"] }
tl-proto = { version = "0.4", features = ["bytes"] }
derivative = "2.2.0"
log = { version = "0.4.14", features = ["max_level_trace"] }
hex = "0.4.3"
thiserror = "1"
tokio = { version = "1.36", features = ["net", "io-util"] }
tokio = { version = "1", features = ["net", "io-util"] }
tower = { version = "0.4.13", features = ["make", "util", "buffer"] }
tokio-util = { version = "0.7.10" }
tokio-tower = "0.6.0"
@@ -23,4 +23,4 @@ ureq = "2.4.0"
base64 = "0.13.0"
x25519-dalek = { version = "2.0.1", features = ["static_secrets"] }
tokio = { version = "1.36", features = ["full"] }
env_logger = "0.11.3"
env_logger = "0.11.3"

Unchanged files with check annotations Beta

use std::task::{Context, Poll};
use futures::future::{self, BoxFuture};
use futures::FutureExt;

Check failure on line 4 in liteapi/src/layers/mod.rs

GitHub Actions / Clippy

unused import: `futures::FutureExt`

Check warning on line 4 in liteapi/src/layers/mod.rs

GitHub Actions / Check

unused import: `futures::FutureExt`
use tower::{Layer, Service};
use crate::tl::common::Int256;
impl fmt::Display for BlockIdExt {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "({},{:X},{}):{}:{}", self.workchain, self.shard, self.seqno, self.root_hash.to_string(), self.file_hash.to_string())

Check failure on line 95 in liteapi/src/tl/common.rs

GitHub Actions / Clippy

`to_string` applied to a type that implements `Display` in `write!` args

Check failure on line 95 in liteapi/src/tl/common.rs

GitHub Actions / Clippy

`to_string` applied to a type that implements `Display` in `write!` args
}
}
type Error = LiteError;
fn poll_ready(self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<Result<(), Self::Error>> {
self.project().inner.poll_ready(cx).map_err(|e| LiteError::AdnlError(e.into()))

Check failure on line 27 in liteapi/src/peer.rs

GitHub Actions / Clippy

useless conversion to the same type: `adnl::AdnlError`
}
fn start_send(self: std::pin::Pin<&mut Self>, item: Message) -> Result<(), Self::Error> {
log::debug!("Sending TL message: {:?}", item);
let data = tl_proto::serialize(item).into();
self.project().inner.start_send(data).map_err(|e| LiteError::AdnlError(e.into()))

Check failure on line 33 in liteapi/src/peer.rs

GitHub Actions / Clippy

useless conversion to the same type: `adnl::AdnlError`
}
fn poll_flush(self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<Result<(), Self::Error>> {
self.project().inner.poll_flush(cx).map_err(|e| LiteError::AdnlError(e.into()))

Check failure on line 37 in liteapi/src/peer.rs

GitHub Actions / Clippy

useless conversion to the same type: `adnl::AdnlError`
}
fn poll_close(self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<Result<(), Self::Error>> {
self.project().inner.poll_close(cx).map_err(|e| LiteError::AdnlError(e.into()))

Check failure on line 41 in liteapi/src/peer.rs

GitHub Actions / Clippy

useless conversion to the same type: `adnl::AdnlError`
}
}
Poll::Ready(Some(Ok(bytes))) => {
let decoded = tl_proto::deserialize(&bytes);
log::debug!("Received TL message: {:?}", decoded);
Poll::Ready(Some(decoded.map_err(|e| LiteError::TlError(e))))

Check failure on line 54 in liteapi/src/peer.rs

GitHub Actions / Clippy

redundant closure
},
Poll::Ready(Some(Err(e))) => Poll::Ready(Some(Err(LiteError::AdnlError(e.into())))),

Check failure on line 56 in liteapi/src/peer.rs

GitHub Actions / Clippy

useless conversion to the same type: `adnl::AdnlError`
Poll::Ready(None) => Poll::Ready(None),
Poll::Pending => Poll::Pending,
}
use std::error::Error;
use regex::Regex;
use ton_liteapi::tl_types::{Int256, BlockIdExt, AccountId};

Check failure on line 4 in cli/src/arg_parsers.rs

GitHub Actions / Check

unresolved import `ton_liteapi::tl_types`
pub fn parse_block_id_ext(s: &str) -> std::result::Result<BlockIdExt, String> {
let re = Regex::new(r"\(([-]?\d+),([a-fA-F0-9]+),(\d+)\):([^:]+):(.+)").unwrap();
use clap::{Parser, Subcommand};
use adnl::AdnlPublicKey;
use rand::seq::SliceRandom;
use ton_liteapi::tl_types::{BlockIdExt, Int256, AccountId};

Check failure on line 7 in cli/src/main.rs

GitHub Actions / Check

unresolved import `ton_liteapi::tl_types`
use ton_liteapi::LiteClient;

Check failure on line 8 in cli/src/main.rs

GitHub Actions / Check

unresolved import `ton_liteapi::LiteClient`
use pretty_hex::PrettyHex;

Check warning on line 9 in cli/src/main.rs

GitHub Actions / Check

unused import: `pretty_hex::PrettyHex`
use ton_networkconfig::{ConfigGlobal, ConfigLiteServer, ConfigPublicKey};
use std::error::Error;
use std::fs::{read_to_string, File};
}
Commands::GetShardInfo { seqno, workchain } => {
let block = (*client).lookup_block(
ton_liteapi::tl_types::BlockId {

Check failure on line 209 in cli/src/main.rs

GitHub Actions / Check

failed to resolve: could not find `tl_types` in `ton_liteapi`
workchain: -1,
shard: 9223372036854775808,
seqno: *seqno,
}
Commands::GetAllShardsInfo { seqno } => {
let block = (*client).lookup_block(
ton_liteapi::tl_types::BlockId {

Check failure on line 223 in cli/src/main.rs

GitHub Actions / Check

failed to resolve: could not find `tl_types` in `ton_liteapi`
workchain: -1,
shard: 9223372036854775808,
seqno: *seqno,
workchain,
shard,
} => {
let block = ton_liteapi::tl_types::BlockId {

Check failure on line 247 in cli/src/main.rs

GitHub Actions / Check

failed to resolve: could not find `tl_types` in `ton_liteapi`
seqno: if let Some(seqno) = seqno { *seqno } else { 0 },
shard: *shard,
workchain: *workchain,