Skip to content

Commit

Permalink
Merge pull request #2543 from b-zee/refactor-deprecate-registers
Browse files Browse the repository at this point in the history
refactor(autonomi): deprecate registers
  • Loading branch information
jacderida authored Dec 16, 2024
2 parents 7309291 + d77e31c commit 851a469
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ant-cli/src/commands/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

#![allow(deprecated)]

use crate::utils::collect_upload_summary;
use crate::wallet::load_wallet;
use autonomi::client::registers::RegisterAddress;
Expand Down
3 changes: 3 additions & 0 deletions ant-node/tests/data_with_churn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

// TODO: Remove this once the registers are removed
#![expect(deprecated)]

mod common;

use crate::common::{
Expand Down
3 changes: 3 additions & 0 deletions ant-node/tests/verify_data_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

// TODO: Remove this once the registers are removed
#![expect(deprecated)]
#![allow(clippy::mutable_key_type)]

mod common;

use ant_logging::LogBuilder;
Expand Down
4 changes: 4 additions & 0 deletions autonomi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ let wallet = Wallet::new_from_private_key(EvmNetwork::ArbitrumSepolia, key)?;
let wallet = Wallet::new_from_private_key(EvmNetwork::new_custom("<rpc URL>", "<payment token address>", "<data payment address>"), key)?;
```

# Registers

Registers are deprecated and planned to be replaced by transactions and pointers. Currently, transactions can already be used. For example usage, see [the transaction test](tests/transaction.rs). Pointers are not yet implemented, but will follow soon.

## Running tests

To run the tests, we can run a local network:
Expand Down
10 changes: 10 additions & 0 deletions autonomi/src/client/registers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// KIND, either express or implied. Please review the Licences for the specific language governing
// permissions and limitations relating to use of the SAFE Network Software.

#![allow(deprecated)]

use crate::client::data::PayError;
use crate::client::Client;
use crate::client::ClientEvent;
Expand Down Expand Up @@ -53,6 +55,10 @@ pub enum RegisterError {
PayeesMissing,
}

#[deprecated(
since = "0.2.4",
note = "Use transactions instead (see Client::transaction_put)"
)]
#[derive(Clone, Debug)]
pub struct Register {
signed_reg: SignedRegister,
Expand Down Expand Up @@ -122,6 +128,10 @@ impl Register {
}
}

#[deprecated(
since = "0.2.4",
note = "Use transactions instead (see Client::transaction_put)"
)]
impl Client {
/// Generate a new register key
pub fn register_generate_key() -> RegisterSecretKey {
Expand Down
1 change: 1 addition & 0 deletions autonomi/tests/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// permissions and limitations relating to use of the SAFE Network Software.

#![cfg(feature = "registers")]
#![allow(deprecated)]

use ant_logging::LogBuilder;
use autonomi::Client;
Expand Down

0 comments on commit 851a469

Please sign in to comment.