Skip to content

Commit

Permalink
[ABW-3926] Delete account manifest (#259)
Browse files Browse the repository at this point in the history
* WIP

* version bump

* remove fee_payer

* WIP

* WIP

* cannot flatten an eum

* format

* clean up

* export via UniFFI

* clean up

* add some tests

* WIP

* move load all pages into GatewayClient and add tests for it

* extract to be usable without AccountPageRequests

* use LedgerState & LedgerStateSelector

* fetch gateway status to get intial LedgerState

* take optional recipeint_account_address

* WIP

* send initial values

* add non fungible models & extend fungible

* comment

* wip

* WIP (need to check if correct)

* unified transfers

* consider transfer weight to reject TX if there are over 100 transfers

* tests to fetch resources

* bump RET and Scrypto to version  (#262)

Fix bug caused by typo `PUSH_TO_AUTHZONE` -> `PUSH_TO_AUTH_ZONE` by bumping RET and Scrypto (fixed breaking changes renaming ChildSubintent -> ChildSubintentSpecifier)

* rename files

* add missing tests

* Bump ret RET and Scrypto (#263)

* bump RET and Scrypto

* remove commented lines on lib.rs

* bump version

* finish test

* bump version

* one more test

* clippy

* deny all deposits to deleted account

* Tombstone accounts functionality and sync (#266)

* Tombstone flag

* Update account flags from sargon os

* Implement sync method for accounts deletion

* Fixes

* Add sargon os method

* Remove comment

* Handle PR comments

* Change logic that decides what account is deleted

* Add tests

* Remove unused EntityFlag

* Resolve comments

* Return error when tombstoning unknown account and not when updating the profile

* Fix ios tests

* Pre-validate accounts to update

* bump version

* Delete account classification (#265)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix

* use reserved convention

* Allow deleting virtual accounts (#268)

* Allow creating Manifest for virtual accounts

* move interception one level above

* fmt

* Export sync methods

---------

Co-authored-by: Alexander Cyon <[email protected]>
Co-authored-by: micbakos-rdx <[email protected]>
Co-authored-by: Ghenadie <[email protected]>
Co-authored-by: micbakos-rdx <[email protected]>
  • Loading branch information
5 people authored Nov 18, 2024
1 parent 42006ba commit da9ecc2
Show file tree
Hide file tree
Showing 140 changed files with 4,239 additions and 397 deletions.
99 changes: 75 additions & 24 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion apple/Sources/Sargon/Protocols/EntityProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension EntityBaseProtocol {
public var networkID: NetworkID { networkId }

public var isHidden: Bool {
flags.contains(.deletedByUser)
flags.contains(.hiddenByUser)
}

public var virtualHierarchicalDeterministicFactorInstances: Set<HierarchicalDeterministicFactorInstance> {
Expand Down
2 changes: 1 addition & 1 deletion apple/Tests/TestCases/Profile/Account/AccountTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class AccountTests: EntityProtocolTest<Account> {

func test_hidden() {
let sut = SUT.sampleStokenetOlivia.flags
XCTAssertEqual(sut, [.deletedByUser])
XCTAssertEqual(sut, [.hiddenByUser])
}

func test_appearance_id() {
Expand Down
2 changes: 1 addition & 1 deletion apple/Tests/TestCases/Profile/Persona/PersonaTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class PersonaTests: EntityProtocolTest<Persona> {

func test_hidden() {
let sut = SUT.sampleMainnetTuring.flags
XCTAssertEqual(sut, [.deletedByUser])
XCTAssertEqual(sut, [.hiddenByUser])
}

func test_new() {
Expand Down
2 changes: 1 addition & 1 deletion apple/Tests/Utils/EntityProtocolTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class EntityBaseTest<SUT_: EntityBaseProtocol>: Test<SUT_> {
XCTAssertTrue(
SUT.sampleValues.flatMap(
\.flags
).contains(.deletedByUser)
).contains(.hiddenByUser)
)
}
}
6 changes: 3 additions & 3 deletions 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.52"
version = "1.1.53"
edition = "2021"
build = "build.rs"

Expand All @@ -19,9 +19,9 @@ required-features = ["build-binary"]
[dependencies]

sargon = { path = "../sargon" }
sargon-uniffi-conversion-macros = { path = "../sargon-uniffi-conversion-macros" }
sargon-uniffi-conversion-macros = { path = "../sargon-uniffi-conversion-macros" }

radix-engine-toolkit = { git = "https://github.com/radixdlt/radix-engine-toolkit", rev = "263bc81f497f686b7327ffcc45fbaad6e04df85a" }
radix-engine-toolkit = { git = "https://github.com/radixdlt/radix-engine-toolkit", rev = "9f58ddfc6e0edb06cb35f8422044522bc0387d14" }

# zeroize = "1.7.0"
zeroize = { git = "https://github.com/RustCrypto/utils", rev = "df6d2f48a5e8afe8eef04ba32e2af55bacb41375", features = [
Expand Down
13 changes: 11 additions & 2 deletions crates/sargon-uniffi/src/core/error/common_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ pub enum CommonError {
)]
InvalidNotarizedIntentFailedToEncode { underlying: String } = 10111,

#[error("Networking response bad code")]
NetworkResponseBadCode = 10112,
#[error("Networking response bad code: {code}")]
NetworkResponseBadCode { code: u16 } = 10112,

#[error("Networking response body was empty")]
NetworkResponseEmptyBody = 10113,
Expand Down Expand Up @@ -731,6 +731,15 @@ pub enum CommonError {

#[error("Subintent has already expired")]
SubintentExpired = 10206,

#[error("Unexpected collection item aggregation")]
UnexpectedCollectionItemAggregation = 10207,

#[error("Unable to make {amount} transfers in one single transaction")]
MaxTransfersPerTransactionReached { amount: u64 } = 10208,

#[error("Transaction Manifest class is reserved: {class}")]
ReservedManifestClass { class: DetailedManifestClass } = 10209,
}

#[uniffi::export]
Expand Down
Loading

0 comments on commit da9ecc2

Please sign in to comment.