@@ -1058,6 +1058,43 @@ struct Credentials_test : public beast::unit_test::suite
1058
1058
}
1059
1059
}
1060
1060
1061
+ void
1062
+ testFlags (FeatureBitset features)
1063
+ {
1064
+ using namespace test ::jtx;
1065
+
1066
+ bool const enabled = features[fixInvalidTxFlags];
1067
+ testcase (
1068
+ std::string (" Test flag, fix " ) +
1069
+ (enabled ? " enabled" : " disabled" ));
1070
+
1071
+ const char credType[] = " abcde" ;
1072
+ Account const issuer{" issuer" };
1073
+ Account const subject{" subject" };
1074
+
1075
+ {
1076
+ using namespace jtx ;
1077
+ Env env{*this , features};
1078
+
1079
+ env.fund (XRP (5000 ), subject, issuer);
1080
+ env.close ();
1081
+
1082
+ {
1083
+ ter const expected (
1084
+ enabled ? TER (temINVALID_FLAG) : TER (tesSUCCESS));
1085
+ env (credentials::create (subject, issuer, credType),
1086
+ txflags (tfTransferable),
1087
+ expected);
1088
+ env (credentials::accept (subject, issuer, credType),
1089
+ txflags (tfSellNFToken),
1090
+ expected);
1091
+ env (credentials::deleteCred (subject, subject, issuer, credType),
1092
+ txflags (tfPassive),
1093
+ expected);
1094
+ }
1095
+ }
1096
+ }
1097
+
1061
1098
void
1062
1099
run () override
1063
1100
{
@@ -1069,6 +1106,8 @@ struct Credentials_test : public beast::unit_test::suite
1069
1106
testAcceptFailed (all);
1070
1107
testDeleteFailed (all);
1071
1108
testFeatureFailed (all - featureCredentials);
1109
+ testFlags (all - fixInvalidTxFlags);
1110
+ testFlags (all);
1072
1111
testRPC ();
1073
1112
}
1074
1113
};
0 commit comments