Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for "fauceting" test/example transaction via local active address #1473

Conversation

wulfraem
Copy link
Contributor

@wulfraem wulfraem commented Dec 3, 2024

Description of change

PR adds support to fund transactions with active address of local IOTA client.

This allows to run tests to be run against environments with a faucet with stricter rules than on localnet or against an environment without a faucet.

Running tests/examples with env variable IOTA_IDENTITY_FUND_WITH_ACTIVE_ADDRESSset totruewill use the local active address to send funds to new test/example accounts. For detail seeidentity_iota_core/README.md`.

Another env variable to configure IOTA API endpoint has been added as well: API_ENDPOINT. Defaults to local test environment if unset.

Links to any relevant issues

#1469

Type of change

Add an x to the boxes that are relevant to your changes.

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

How the change has been tested

Tested against local network and devnet.

Change checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

- add `API_ENDPOINT` env variable for tests and examples
- add `IOTA_IDENTITY_FUND_WITH_ACTIVE_ADDRESS` env variable to toggle funding via active address
@wulfraem wulfraem added Rust Related to the core Rust code. Becomes part of the Rust changelog. Patch Change without affecting the API that requires a patch release. Part of "Patch" section in changelog labels Dec 3, 2024
@wulfraem wulfraem requested a review from a team as a code owner December 3, 2024 09:49
@wulfraem wulfraem self-assigned this Dec 3, 2024
@@ -32,6 +32,7 @@ use secret_storage::Signer;
use serde_json::Value;

pub const TEST_GAS_BUDGET: u64 = 50_000_000;
const DEFAULT_API_ENDPOINT: &str = "http://127.0.0.1:9000";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use the iota_sdk exported constant IOTA_LOCAL_NETWORK_URL.

@@ -50,6 +50,7 @@ static PACKAGE_ID: OnceCell<ObjectID> = OnceCell::const_new();
static CLIENT: OnceCell<TestClient> = OnceCell::const_new();
const SCRIPT_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/scripts/");
const CACHED_PKG_ID: &str = "/tmp/iota_identity_pkg_id.txt";
const DEFAULT_API_ENDPOINT: &str = "http://127.0.0.1:9000";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well let's just use iota_sdk::IOTA_LOCAL_NETWORK_URL.

- now using `IOTA_LOCAL_NETWORK_URL` from `iota` create
@wulfraem wulfraem requested a review from UMR1352 December 3, 2024 14:53
@wulfraem wulfraem merged commit 2092b7c into feat/identity-rebased-alpha Dec 3, 2024
1 check passed
@UMR1352 UMR1352 deleted the feat/add-support-for-active-address-funding branch December 3, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Patch Change without affecting the API that requires a patch release. Part of "Patch" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants