Extend e2e membership smoke flow for assurance metadata
This commit is contained in:
parent
7300612b71
commit
bdbc931dcd
@ -65,6 +65,12 @@ Copy `.env.example` values into your shell/session before deploy:
|
|||||||
If no offer override JSON is provided, deploy script seeds default offers at `OFFER_PRICE_ATOMIC`.
|
If no offer override JSON is provided, deploy script seeds default offers at `OFFER_PRICE_ATOMIC`.
|
||||||
Use `deploy/offers.template.json` to define per-offer prices and policy flags.
|
Use `deploy/offers.template.json` to define per-offer prices and policy flags.
|
||||||
|
|
||||||
|
Smoke flow optional vars:
|
||||||
|
|
||||||
|
1. `E2E_IDENTITY_ASSURANCE_LEVEL`
|
||||||
|
2. `E2E_IDENTITY_ATTESTED_BY`
|
||||||
|
3. `E2E_IDENTITY_ATTESTATION_ID`
|
||||||
|
|
||||||
Example (Sepolia):
|
Example (Sepolia):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@ -7,6 +7,9 @@ const CHAIN_ID = Number((process.env.SECRET_API_CHAIN_ID || "84532").trim());
|
|||||||
const PRIVATE_KEY = (process.env.DEPLOYER_PRIVATE_KEY || "").trim();
|
const PRIVATE_KEY = (process.env.DEPLOYER_PRIVATE_KEY || "").trim();
|
||||||
const RPC_URL = (process.env.BASE_SEPOLIA_RPC_URL || "").trim();
|
const RPC_URL = (process.env.BASE_SEPOLIA_RPC_URL || "").trim();
|
||||||
const GAS_PRICE_WEI = (process.env.E2E_GAS_PRICE_WEI || "").trim();
|
const GAS_PRICE_WEI = (process.env.E2E_GAS_PRICE_WEI || "").trim();
|
||||||
|
const IDENTITY_ASSURANCE = (process.env.E2E_IDENTITY_ASSURANCE_LEVEL || "").trim();
|
||||||
|
const IDENTITY_ATTESTED_BY = (process.env.E2E_IDENTITY_ATTESTED_BY || "").trim();
|
||||||
|
const IDENTITY_ATTESTATION_ID = (process.env.E2E_IDENTITY_ATTESTATION_ID || "").trim();
|
||||||
|
|
||||||
function required(name, value) {
|
function required(name, value) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
@ -153,19 +156,36 @@ async function main() {
|
|||||||
await tx.wait(1);
|
await tx.wait(1);
|
||||||
console.log("mined_tx:", tx.hash);
|
console.log("mined_tx:", tx.hash);
|
||||||
|
|
||||||
const confirm = await postJSON("/secret/membership/confirm", {
|
const confirmPayload = {
|
||||||
designation_code: intent.designation_code,
|
designation_code: intent.designation_code,
|
||||||
quote_id: quote.quote_id,
|
quote_id: quote.quote_id,
|
||||||
tx_hash: tx.hash,
|
tx_hash: tx.hash,
|
||||||
address,
|
address,
|
||||||
chain_id: CHAIN_ID,
|
chain_id: CHAIN_ID,
|
||||||
});
|
};
|
||||||
|
if (IDENTITY_ASSURANCE) {
|
||||||
|
confirmPayload.identity_assurance_level = IDENTITY_ASSURANCE;
|
||||||
|
}
|
||||||
|
if (IDENTITY_ATTESTED_BY) {
|
||||||
|
confirmPayload.identity_attested_by = IDENTITY_ATTESTED_BY;
|
||||||
|
}
|
||||||
|
if (IDENTITY_ATTESTATION_ID) {
|
||||||
|
confirmPayload.identity_attestation_id = IDENTITY_ATTESTATION_ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirm = await postJSON("/secret/membership/confirm", confirmPayload);
|
||||||
console.log("confirm_status:", confirm.status);
|
console.log("confirm_status:", confirm.status);
|
||||||
|
if (confirm.identity_assurance_level) {
|
||||||
|
console.log("identity_assurance:", confirm.identity_assurance_level);
|
||||||
|
}
|
||||||
|
|
||||||
const status = await getJSON(
|
const status = await getJSON(
|
||||||
`/secret/membership/status?wallet=${encodeURIComponent(address)}`
|
`/secret/membership/status?wallet=${encodeURIComponent(address)}`
|
||||||
);
|
);
|
||||||
console.log("membership_status:", status.status);
|
console.log("membership_status:", status.status);
|
||||||
|
if (status.identity_assurance_level) {
|
||||||
|
console.log("membership_assurance:", status.identity_assurance_level);
|
||||||
|
}
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
@ -176,6 +196,7 @@ async function main() {
|
|||||||
tx_hash: tx.hash,
|
tx_hash: tx.hash,
|
||||||
confirm_status: confirm.status,
|
confirm_status: confirm.status,
|
||||||
membership_status: status.status,
|
membership_status: status.status,
|
||||||
|
identity_assurance_level: status.identity_assurance_level || null,
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
2
|
2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user