Skip to content

Commit

Permalink
support liteServer.getLibrariesWithProof
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitrii Korchagin committed Aug 29, 2024
1 parent 28abef4 commit c4ab144
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
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 @@ -231,6 +231,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 @@ -323,6 +334,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

0 comments on commit c4ab144

Please sign in to comment.