Skip to content

Commit

Permalink
Add isDeleted for EntityBaseProtocol (#271)
Browse files Browse the repository at this point in the history
* wip

* bump
  • Loading branch information
danvleju-rdx authored Nov 19, 2024
1 parent b2b2f2a commit 46d12e5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions apple/Sources/Sargon/Protocols/EntityProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ extension EntityBaseProtocol {
public var id: ID { address }
public var networkID: NetworkID { networkId }

public var isDeleted: Bool {
flags.contains(.tombstonedByUser)
}

public var isHidden: Bool {
flags.contains(.hiddenByUser)
}
Expand Down
4 changes: 4 additions & 0 deletions apple/Tests/Utils/EntityProtocolTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class EntityBaseTest<SUT_: EntityBaseProtocol>: Test<SUT_> {
func test_is_hidden() {
XCTAssertFalse(SUT.sample.isHidden)
}

func test_is_deleted() {
XCTAssertFalse(SUT.sample.isDeleted)
}

func test_hasAuthenticationSigningKey() {
eachSample { sut in
Expand Down
2 changes: 1 addition & 1 deletion crates/sargon-uniffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sargon-uniffi"
# Don't forget to update version in crates/sargon/Cargo.toml
version = "1.1.54"
version = "1.1.55"
edition = "2021"
build = "build.rs"

Expand Down
2 changes: 1 addition & 1 deletion crates/sargon/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "sargon"
# Don't forget to update version in crates/sargon-uniffi/Cargo.toml
version = "1.1.54"
version = "1.1.55"
edition = "2021"
build = "build.rs"

Expand Down

0 comments on commit 46d12e5

Please sign in to comment.