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 #11

Merged
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
13 changes: 13 additions & 0 deletions liteapi/src/tl/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ pub struct GetLibraries {
pub library_list: Vec<Int256>,
}

#[derive(TlRead, TlWrite, Derivative)]
#[derivative(Debug, Clone, PartialEq)]
pub struct GetLibrariesWithProof {
pub id: BlockIdExt,
#[tl(flags)]
pub mode: (),
pub library_list: Vec<Int256>,
}

#[derive(TlRead, TlWrite, Derivative)]
#[derivative(Debug, Clone, PartialEq)]
#[tl(boxed)]
Expand Down Expand Up @@ -349,4 +358,8 @@ pub enum Request {
/// liteServer.getLibraries library_list:(vector int256) = liteServer.LibraryResult;
#[tl(id = 0xd122b662)]
GetLibraries(GetLibraries),

/// liteServer.getLibrariesWithProof id:tonNode.blockIdExt mode:# library_list:(vector int256) = liteServer.LibraryResultWithProof;
#[tl(id = 0xd97693bd)]
GetLibrariesWithProof(GetLibrariesWithProof),
}
15 changes: 15 additions & 0 deletions liteapi/src/tl/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,17 @@ pub struct LibraryResult {
pub result: Vec<LibraryEntry>,
}

#[derive(TlRead, TlWrite, Derivative)]
#[derivative(Debug, Clone, PartialEq)]
pub struct LibraryResultWithProof {
pub id: BlockIdExt,
#[tl(flags)]
pub mode: (),
pub result: Vec<LibraryEntry>,
pub state_proof: Vec<u8>,
pub data_proof: Vec<u8>,
}

#[derive(TlRead, TlWrite, Derivative)]
#[derivative(Debug, Clone, PartialEq)]
pub struct Error {
Expand Down Expand Up @@ -356,6 +367,10 @@ pub enum Response {
#[tl(id = 0x117ab96b)]
LibraryResult(LibraryResult),

/// liteServer.libraryResult result:(vector liteServer.libraryEntry) = liteServer.LibraryResult;
#[tl(id = 0x10a927bf)]
LibraryResultWithProof(LibraryResultWithProof),

/// liteServer.error code:int message:string = liteServer.Error;
#[tl(id = 0xbba9e148)]
Error(Error),
Expand Down
Loading