@@ -429,64 +429,55 @@ class ConfidentialTransfer_test : public beast::unit_test::suite
429429 .auditorPubKey = mptAlice.getPubKey (alice),
430430 .err = temMALFORMED});
431431
432- // Cannot set Holder and Keys in the same transaction
432+ // Cannot set Holder and issuer Keys in the same transaction
433433 mptAlice.set (
434434 {.account = alice,
435435 .holder = bob,
436436 .issuerPubKey = mptAlice.getPubKey (alice),
437437 .err = temMALFORMED});
438- }
439-
440- // issuance has disabled confidential transfer
441- {
442- Env env{*this , features};
443- Account const alice (" alice" );
444- Account const bob (" bob" );
445- MPTTester mptAlice (env, alice, {.holders = {bob}});
446438
447- // no tfMPTCanPrivacy flag enabled
448- mptAlice.create (
449- {.ownerCount = 1 , . flags = tfMPTCanTransfer | tfMPTCanLock});
450-
451- mptAlice. authorize ({. account = bob});
452- mptAlice. pay (alice, bob, 100 );
439+ // Cannot set Holder and auditor Keys in the same transaction
440+ mptAlice.set (
441+ {.account = alice,
442+ . holder = bob,
443+ . auditorPubKey = mptAlice. getPubKey (alice),
444+ . err = temMALFORMED} );
453445
454- mptAlice.generateKeyPair (alice);
455- mptAlice.generateKeyPair (bob);
446+ // Cannot set self as holder
447+ mptAlice.set (
448+ {.account = alice, .holder = alice, .err = temMALFORMED});
456449
450+ // Cannot Lock and Unlock simultaneously
457451 mptAlice.set (
458452 {.account = alice,
459- .issuerPubKey = mptAlice.getPubKey (alice),
460- .err = tecNO_PERMISSION});
453+ .holder = bob,
454+ .flags = tfMPTLock | tfMPTUnlock,
455+ .err = temINVALID_FLAG});
456+
457+ // Transaction does nothing
458+ mptAlice.set ({.account = alice, .err = temMALFORMED});
461459 }
462460
463- // issuer sets public key and then sets auditor public key
461+ // issuance has disabled confidential transfer
464462 {
465463 Env env{*this , features};
466464 Account const alice (" alice" );
467465 Account const bob (" bob" );
468- Account const auditor (" auditor" );
469- MPTTester mptAlice (
470- env, alice, {.holders = {bob}, .auditor = auditor});
466+ MPTTester mptAlice (env, alice, {.holders = {bob}});
471467
468+ // no tfMPTCanPrivacy flag enabled
472469 mptAlice.create (
473- {.ownerCount = 1 ,
474- .flags = tfMPTCanTransfer | tfMPTCanLock | tfMPTCanPrivacy});
470+ {.ownerCount = 1 , .flags = tfMPTCanTransfer | tfMPTCanLock});
475471
476472 mptAlice.authorize ({.account = bob});
477473 mptAlice.pay (alice, bob, 100 );
478474
479475 mptAlice.generateKeyPair (alice);
480476 mptAlice.generateKeyPair (bob);
481- mptAlice.generateKeyPair (auditor);
482-
483- mptAlice.set (
484- {.account = alice, .issuerPubKey = mptAlice.getPubKey (alice)});
485477
486478 mptAlice.set (
487479 {.account = alice,
488480 .issuerPubKey = mptAlice.getPubKey (alice),
489- .auditorPubKey = mptAlice.getPubKey (auditor),
490481 .err = tecNO_PERMISSION});
491482 }
492483 }
@@ -1246,7 +1237,6 @@ class ConfidentialTransfer_test : public beast::unit_test::suite
12461237 .issuerEncryptedAmt =
12471238 Buffer (ripple::ecGamalEncryptedTotalLength),
12481239 .err = temBAD_CIPHERTEXT});
1249-
12501240 // dest encrypted amount wrong length
12511241 mptAlice.send (
12521242 {.account = bob,
@@ -1258,7 +1248,6 @@ class ConfidentialTransfer_test : public beast::unit_test::suite
12581248 .issuerEncryptedAmt =
12591249 Buffer (ripple::ecGamalEncryptedTotalLength),
12601250 .err = temBAD_CIPHERTEXT});
1261-
12621251 // issuer encrypted amount wrong length
12631252 mptAlice.send (
12641253 {.account = bob,
@@ -1272,7 +1261,6 @@ class ConfidentialTransfer_test : public beast::unit_test::suite
12721261 .err = temBAD_CIPHERTEXT});
12731262
12741263 // auto const ciphertextHex = generatePlaceholderCiphertext();
1275-
12761264 // sender encrypted amount malformed
12771265 mptAlice.send (
12781266 {.account = bob,
@@ -1281,7 +1269,6 @@ class ConfidentialTransfer_test : public beast::unit_test::suite
12811269 .senderEncryptedAmt =
12821270 Buffer (ripple::ecGamalEncryptedTotalLength),
12831271 .err = temBAD_CIPHERTEXT});
1284-
12851272 // dest encrypted amount malformed
12861273 mptAlice.send (
12871274 {.account = bob,
@@ -1290,7 +1277,6 @@ class ConfidentialTransfer_test : public beast::unit_test::suite
12901277 .destEncryptedAmt =
12911278 Buffer (ripple::ecGamalEncryptedTotalLength),
12921279 .err = temBAD_CIPHERTEXT});
1293-
12941280 // issuer encrypted amount malformed
12951281 mptAlice.send (
12961282 {.account = bob,
@@ -2211,34 +2197,34 @@ class ConfidentialTransfer_test : public beast::unit_test::suite
22112197 Account const alice (" alice" );
22122198 Account const bob (" bob" );
22132199 Account const auditor (" auditor" );
2214- MPTTester mpt (env, alice, {.holders = {bob}, .auditor = auditor});
2200+ MPTTester mptAlice (
2201+ env, alice, {.holders = {bob}, .auditor = auditor});
22152202
2216- mpt .create (
2203+ mptAlice .create (
22172204 {.flags = tfMPTCanTransfer | tfMPTCanLock | tfMPTCanPrivacy});
2218- mpt .authorize ({.account = bob});
2219- mpt .pay (alice, bob, 100 );
2205+ mptAlice .authorize ({.account = bob});
2206+ mptAlice .pay (alice, bob, 100 );
22202207
2221- mpt .generateKeyPair (alice);
2222- mpt .generateKeyPair (bob);
2223- mpt .generateKeyPair (auditor);
2224- mpt .set (
2208+ mptAlice .generateKeyPair (alice);
2209+ mptAlice .generateKeyPair (bob);
2210+ mptAlice .generateKeyPair (auditor);
2211+ mptAlice .set (
22252212 {.account = alice,
2226- .issuerPubKey = mpt .getPubKey (alice),
2227- .auditorPubKey = mpt .getPubKey (auditor)});
2213+ .issuerPubKey = mptAlice .getPubKey (alice),
2214+ .auditorPubKey = mptAlice .getPubKey (auditor)});
22282215
22292216 // Convert funds so Bob has a balance
2230- mpt .convert ({
2217+ mptAlice .convert ({
22312218 .account = bob,
22322219 .amt = 50 ,
2233- .holderPubKey = mpt .getPubKey (bob),
2220+ .holderPubKey = mptAlice .getPubKey (bob),
22342221 });
2235- mpt .mergeInbox ({.account = bob});
2222+ mptAlice .mergeInbox ({.account = bob});
22362223
22372224 // ConvertBack WITHOUT auditorEncryptedAmt
2238- mpt .convertBack ({
2225+ mptAlice .convertBack ({
22392226 .account = bob,
22402227 .amt = 10 ,
2241- // we omit .auditorEncryptedAmt.
22422228 .fillAuditorEncryptedAmt = false ,
22432229 .err = tecNO_PERMISSION,
22442230 });
0 commit comments