Skip to content

Commit 98a207f

Browse files
add unit test
1 parent 24c1593 commit 98a207f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/test/app/ConfidentialTransfer_test.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,36 @@ class ConfidentialTransfer_test : public beast::unit_test::suite
459459
.issuerPubKey = mptAlice.getPubKey(alice),
460460
.err = tecNO_PERMISSION});
461461
}
462+
463+
// issuer sets public key and then sets auditor public key
464+
{
465+
Env env{*this, features};
466+
Account const alice("alice");
467+
Account const bob("bob");
468+
Account const auditor("auditor");
469+
MPTTester mptAlice(
470+
env, alice, {.holders = {bob}, .auditor = auditor});
471+
472+
mptAlice.create(
473+
{.ownerCount = 1,
474+
.flags = tfMPTCanTransfer | tfMPTCanLock | tfMPTCanPrivacy});
475+
476+
mptAlice.authorize({.account = bob});
477+
mptAlice.pay(alice, bob, 100);
478+
479+
mptAlice.generateKeyPair(alice);
480+
mptAlice.generateKeyPair(bob);
481+
mptAlice.generateKeyPair(auditor);
482+
483+
mptAlice.set(
484+
{.account = alice, .issuerPubKey = mptAlice.getPubKey(alice)});
485+
486+
mptAlice.set(
487+
{.account = alice,
488+
.issuerPubKey = mptAlice.getPubKey(alice),
489+
.auditorPubKey = mptAlice.getPubKey(auditor),
490+
.err = tecNO_PERMISSION});
491+
}
462492
}
463493

464494
void

0 commit comments

Comments
 (0)