forked from madara-alliance/madara-orchestrator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(aptos_settlement_client): add update_state, state_block_number u…
…nit test
- Loading branch information
1 parent
41e1c33
commit feb56fd
Showing
6 changed files
with
246 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
use dotenvy::dotenv; | ||
use settlement_client_interface::SettlementConfig; | ||
use utils::env_utils::get_env_var_or_panic; | ||
|
||
pub struct AptosSettlementConfig { | ||
pub node_url: String, | ||
pub private_key: String, | ||
pub account_address: String, | ||
pub module_address: String, | ||
pub chain_id: String, | ||
} | ||
|
||
impl SettlementConfig for AptosSettlementConfig { | ||
fn new_from_env() -> Self { | ||
Self { | ||
node_url: get_env_var_or_panic("APTOS_NODE_URL"), | ||
private_key: get_env_var_or_panic("PRIVATE_KEY"), | ||
account_address: get_env_var_or_panic("ADDRESS"), | ||
} | ||
dotenv().expect("Failed to load .env file"); | ||
let node_url = get_env_var_or_panic("APTOS_NODE_URL"); | ||
let private_key = get_env_var_or_panic("APTOS_PRIVATE_KEY"); | ||
let account_address = get_env_var_or_panic("APTOS_ACCOUNT_ADDRESS"); | ||
let module_address = get_env_var_or_panic("APTOS_MODULE_ADDRESS"); | ||
let chain_id = get_env_var_or_panic("CHAIN_ID"); | ||
AptosSettlementConfig { chain_id, node_url, private_key, account_address, module_address } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.