MCPcopy Create free account
hub / github.com/dfinity/orbit / create_icp_account

Function create_icp_account

tests/integration/src/utils.rs:655–693  ·  view source on GitHub ↗
(env: &PocketIc, station_id: Principal, user_id: UuidDTO)

Source from the content-addressed store, hash-verified

653}
654
655pub fn create_icp_account(env: &PocketIc, station_id: Principal, user_id: UuidDTO) -> AccountDTO {
656 let icp = get_icp_asset(env, station_id, WALLET_ADMIN_USER);
657
658 // create account
659 let create_account_args = AddAccountOperationInput {
660 name: "test".to_string(),
661 assets: vec![icp.id.clone()],
662 read_permission: AllowDTO {
663 auth_scope: station_api::AuthScopeDTO::Restricted,
664 user_groups: vec![],
665 users: vec![user_id.clone()],
666 },
667 configs_permission: AllowDTO {
668 auth_scope: station_api::AuthScopeDTO::Restricted,
669 user_groups: vec![],
670 users: vec![user_id.clone()],
671 },
672 transfer_permission: AllowDTO {
673 auth_scope: station_api::AuthScopeDTO::Restricted,
674 user_groups: vec![],
675 users: vec![user_id.clone()],
676 },
677 transfer_request_policy: Some(RequestPolicyRuleDTO::QuorumPercentage(
678 QuorumPercentageDTO {
679 approvers: UserSpecifierDTO::Id(vec![user_id.clone()]),
680 min_approved: 100,
681 },
682 )),
683 configs_request_policy: Some(RequestPolicyRuleDTO::QuorumPercentage(
684 QuorumPercentageDTO {
685 approvers: UserSpecifierDTO::Id(vec![user_id.clone()]),
686 min_approved: 100,
687 },
688 )),
689 metadata: vec![],
690 };
691
692 create_account(env, station_id, WALLET_ADMIN_USER, create_account_args)
693}
694
695pub fn create_account(
696 env: &PocketIc,

Callers 1

Calls 3

get_icp_assetFunction · 0.85
create_accountFunction · 0.70
QuorumPercentageInterface · 0.50

Tested by 1