Skip to content

Commit

Permalink
🔧 Fix dispenser test (#319)
Browse files Browse the repository at this point in the history
## What?
- Fix dispenser test in integration-tests

## How?
- Add CID to the jwt
  • Loading branch information
JuaniRios authored Jun 11, 2024
1 parent cb1b6e4 commit ffeb875
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions integration-tests/src/tests/credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
use crate::*;
use frame_support::{assert_err, assert_ok, dispatch::GetDispatchInfo, traits::tokens::currency::VestingSchedule};
use macros::generate_accounts;
use polimec_common::credentials::InvestorType;
use polimec_common_test_utils::{get_fake_jwt, get_test_jwt};
use polimec_common::credentials::{Did, InvestorType};
use polimec_common_test_utils::{get_fake_jwt, get_mock_jwt_with_cid, get_test_jwt};
use polimec_runtime::PLMC;
use sp_runtime::{
bounded_vec,
generic::Era,
traits::SignedExtension,
transaction_validity::{InvalidTransaction::Payment, TransactionValidityError},
AccountId32, DispatchError,
AccountId32, BoundedVec, DispatchError,
};
use tests::defaults::*;

Expand Down Expand Up @@ -102,7 +103,15 @@ fn dispenser_signed_extensions_pass_for_new_account() {
fn dispenser_works_with_runtime_values() {
PolitestNet::execute_with(|| {
let who = PolitestAccountId::from(EMPTY_ACCOUNT);
let jwt = get_test_jwt(who.clone(), InvestorType::Retail);
let did = "kilt:did:tz:tz1K7fCz9QJtXv3J8Ud3Zvz7eQ6";
let bytes_did = did.as_bytes().to_vec();
let bounded_did: Did = bytes_did.try_into().unwrap();
let jwt = get_mock_jwt_with_cid(
who.clone(),
InvestorType::Retail,
bounded_did,
politest_runtime::DispenserWhitelistedPolicy::get(),
);
PolitestBalances::force_set_balance(
PolitestOrigin::root(),
PolitestDispenser::dispense_account().into(),
Expand Down

0 comments on commit ffeb875

Please sign in to comment.