Skip to content

Commit

Permalink
changes is permanent to archived
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Calza <[email protected]>
  • Loading branch information
brunocalza committed Nov 7, 2023
1 parent 378b460 commit 7df8143
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/protocol/schema/definitions.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ struct DealInfo {
cid @0 :Text;
size @1 :UInt32;
created @2 :Text;
isPermament @3 :Bool;
archived @3 :Bool;
}
12 changes: 6 additions & 6 deletions lib/protocol/src/schema/definitions_capnp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ pub mod deal_info {
!self.reader.get_pointer_field(1).is_null()
}
#[inline]
pub fn get_is_permament(self) -> bool {
pub fn get_archived(self) -> bool {
self.reader.get_bool_field(32)
}
}
Expand Down Expand Up @@ -1898,11 +1898,11 @@ pub mod deal_info {
!self.builder.is_pointer_field_null(1)
}
#[inline]
pub fn get_is_permament(self) -> bool {
pub fn get_archived(self) -> bool {
self.builder.get_bool_field(32)
}
#[inline]
pub fn set_is_permament(&mut self, value: bool) {
pub fn set_archived(&mut self, value: bool) {
self.builder.set_bool_field(32, value);
}
}
Expand Down Expand Up @@ -1960,7 +1960,7 @@ pub mod deal_info {
::capnp::word(3, 0, 0, 0, 32, 0, 0, 0),
::capnp::word(0, 0, 1, 0, 3, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(109, 0, 0, 0, 98, 0, 0, 0),
::capnp::word(109, 0, 0, 0, 74, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(108, 0, 0, 0, 3, 0, 1, 0),
::capnp::word(120, 0, 0, 0, 2, 0, 1, 0),
Expand Down Expand Up @@ -1988,8 +1988,8 @@ pub mod deal_info {
::capnp::word(12, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(105, 115, 80, 101, 114, 109, 97, 109),
::capnp::word(101, 110, 116, 0, 0, 0, 0, 0),
::capnp::word(97, 114, 99, 104, 105, 118, 101, 100),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(1, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
::capnp::word(0, 0, 0, 0, 0, 0, 0, 0),
Expand Down
4 changes: 2 additions & 2 deletions lib/worker/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ impl<E: EVMClient + 'static> publications::Server for Publications<E> {
builder.set_cid(status.cid.as_str().into());
builder.set_created(status.created.as_str().into());
builder.set_size(status.dag_size);
builder.set_is_permament(!status.deals.is_empty());
builder.set_archived(!status.deals.is_empty());
}

Ok(())
Expand Down Expand Up @@ -302,7 +302,7 @@ impl<E: EVMClient + 'static> publications::Server for Publications<E> {
builder.set_cid(status.cid.as_str().into());
builder.set_created(status.created.as_str().into());
builder.set_size(status.dag_size);
builder.set_is_permament(!status.deals.is_empty());
builder.set_archived(!status.deals.is_empty());
}

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion lib/worker/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async fn create_publication_and_list_works() {
"2023-10-27T20:08:24.015+00:00",
deals.get(0).get_created().unwrap()
);
assert!(deals.get(0).get_is_permament());
assert!(deals.get(0).get_archived());
assert_eq!(380733, deals.get(0).get_size());

db::drop(pool.clone(), &db_url).await.unwrap();
Expand Down

0 comments on commit 7df8143

Please sign in to comment.