diff --git a/CHANGELOG.md b/CHANGELOG.md index 04d4b19c..bf75833f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,15 @@ Those changes in added, changed or breaking changes, should include usage exampl ### Added 🎉 +* Added new method `update_avs_metadata_uri` in `avsregistry/writer` in [#344](https://github.com/Layr-Labs/eigensdk-rs/pull/344). + + ```rust + let tx_hash = avs_writer + .update_avs_metadata_uri(new_metadata) + .await + .unwrap(); + ``` + * Added new method `register_operator_with_churn` in `avsregistry/writer` in [#354](https://github.com/Layr-Labs/eigensdk-rs/pull/354). ```rust @@ -63,10 +72,13 @@ Those changes in added, changed or breaking changes, should include usage exampl ### Documentation 📚 ### Other Changes + * fix: missing block while waiting for operator state history in [#290](https://github.com/Layr-Labs/eigensdk-rs/pull/290). ## [0.3.0] - 2025-02-11 + ### Added + * Added new method `set_slashable_stake_lookahead` in `avsregistry/writer` in [#278](https://github.com/Layr-Labs/eigensdk-rs/pull/278). ```rust @@ -99,6 +111,7 @@ Those changes in added, changed or breaking changes, should include usage exampl .await .unwrap(); ``` + * Added new method `get_restakeable_strategies` in `avsregistry/reader` in [#349](https://github.com/Layr-Labs/eigensdk-rs/pull/349). ```rust @@ -122,7 +135,6 @@ Those changes in added, changed or breaking changes, should include usage exampl .status(); // tx_status should be true ``` -<<<<<<< HEAD * Added `get_operator_restaked_strategies` in `avsregistry/reader` in [#348](https://github.com/Layr-Labs/eigensdk-rs/pull/348). @@ -134,8 +146,6 @@ Those changes in added, changed or breaking changes, should include usage exampl ``` * Added custom configuration for release-plz in [#281](https://github.com/Layr-Labs/eigensdk-rs/pull/281). -======= ->>>>>>> dev * Added Rewards2.1 support in [#323](https://github.com/Layr-Labs/eigensdk-rs/pull/323). * Set an operator's split on an operator set. @@ -183,6 +193,7 @@ Those changes in added, changed or breaking changes, should include usage exampl ``` * Added new method `create_total_delegated_stake_quorum` in `avsregistry/writer` in [#342](https://github.com/Layr-Labs/eigensdk-rs/pull/342). + ```rust let operator_set_params = OperatorSetParam { maxOperatorCount: 10, @@ -267,7 +278,8 @@ Those changes in added, changed or breaking changes, should include usage exampl ```rust let operator_set_quourm = avs_reader.is_operator_set_quorum(0).await.unwrap(); ``` -* Added version explicitly in crates in [#322](https://github.com/Layr-Labs/eigensdk-rs/pull/322). + +* Added version explicitly in crates in [#322](https://github.com/Layr-Labs/eigensdk-rs/pull/322). * Added new method `set_account_identifier` in `avsregistry/writer` in [#329](https://github.com/Layr-Labs/eigensdk-rs/pull/329). ```rust @@ -276,6 +288,7 @@ Those changes in added, changed or breaking changes, should include usage exampl .await .unwrap(); ``` + * Added missing StakeRegistry writer functions in [#343](https://github.com/Layr-Labs/eigensdk-rs/pull/343). * `set_minimum_stake_for_quorum` @@ -317,6 +330,7 @@ Those changes in added, changed or breaking changes, should include usage exampl .await .unwrap(); ``` + * Added missing stake registry view methods in `avsregistry/reader` in [#347](https://github.com/Layr-Labs/eigensdk-rs/pull/347). * `weight_of_operator_for_quorum` @@ -363,6 +377,7 @@ Those changes in added, changed or breaking changes, should include usage exampl .await .unwrap(); ``` + * `get_latest_stake_update` ```rust @@ -371,6 +386,7 @@ Those changes in added, changed or breaking changes, should include usage exampl .await .unwrap(); ``` + * `get_stake_update_at_index` ```rust @@ -781,4 +797,4 @@ Those changes in added, changed or breaking changes, should include usage exampl ## Previous versions This changelog was introduced in-between v0.1.2 and v0.1.3. -For changes from previous releases, you can check on our GitHub repo's releases page: [github.com/Layr-Labs/eigensdk-rs/releases](https://github.com/Layr-Labs/eigensdk-rs/releases) \ No newline at end of file +For changes from previous releases, you can check on our GitHub repo's releases page: [github.com/Layr-Labs/eigensdk-rs/releases](https://github.com/Layr-Labs/eigensdk-rs/releases) diff --git a/crates/chainio/clients/avsregistry/src/writer.rs b/crates/chainio/clients/avsregistry/src/writer.rs index 60497d08..6d1980fa 100644 --- a/crates/chainio/clients/avsregistry/src/writer.rs +++ b/crates/chainio/clients/avsregistry/src/writer.rs @@ -642,6 +642,33 @@ impl AvsRegistryChainWriter { Ok(*tx.tx_hash()) } + /// Update the AVS metadata URI. + /// + /// This function updates the AVS metadata URI of the AVS's RegistryCoordinator. + /// + /// # Arguments + /// + /// * `avs_metadata_uri` - The new AVS metadata URI. + /// + /// # Returns + /// + /// * `TxHash` - hash of the sent transaction. + pub async fn update_avs_metadata_uri( + &self, + avs_metadata_uri: &str, + ) -> Result { + info!("updating the AVS metadata URI of the AVS's registry coordinator"); + let provider = get_signer(&self.signer.clone(), &self.provider); + + ServiceManagerBase::new(self.service_manager_addr, provider) + .updateAVSMetadataURI(avs_metadata_uri.to_string()) + .send() + .await + .inspect(|tx| info!(tx_hash = ?tx, "successfully updated AVS metadata URI")) + .map_err(AvsRegistryError::AlloyContractError) + .map(|tx| *tx.tx_hash()) + } + /// Sets the minimum stake for the quorum /// /// Can only be called by the registry coordinator's owner. @@ -1154,6 +1181,28 @@ mod tests { assert_eq!(stream_event.socket, new_socket_addr); } + #[tokio::test] + async fn test_update_avs_metadata_uri() { + let (_container, http_endpoint, _ws_endpoint) = start_anvil_container().await; + let avs_writer = + build_avs_registry_chain_writer(http_endpoint.clone(), FIRST_PRIVATE_KEY.to_string()) + .await; + + let new_metadata = "https://avs-metadata-uri.com"; + + let tx_hash = avs_writer + .update_avs_metadata_uri(new_metadata) + .await + .unwrap(); + + let tx_status = wait_transaction(&http_endpoint, tx_hash) + .await + .unwrap() + .status(); + + assert!(tx_status); + } + #[tokio::test] async fn test_set_churn_approver() { let (_container, http_endpoint, _ws_endpoint) = start_anvil_container().await;