mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
MakerTxSanityCheckTests: Add checkFeeAmountMissingVinPreVoutValue test
This commit is contained in:
parent
3a7a67d7ca
commit
49725689ca
@ -172,6 +172,25 @@ public class MakerTxValidatorSanityCheckTests {
|
|||||||
assertThat(txValidator1.getStatus(), is(FeeValidationStatus.NACK_JSON_ERROR));
|
assertThat(txValidator1.getStatus(), is(FeeValidationStatus.NACK_JSON_ERROR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void checkFeeAmountMissingVinPreVoutValue() {
|
||||||
|
JsonObject json = MakerTxValidatorSanityCheckTests.getValidBtcMakerFeeMempoolJsonResponse();
|
||||||
|
JsonObject firstInput = json.get("vin").getAsJsonArray().get(0).getAsJsonObject();
|
||||||
|
firstInput.getAsJsonObject("prevout").remove("value");
|
||||||
|
|
||||||
|
boolean hasPreVout = json.get("vin").getAsJsonArray()
|
||||||
|
.get(0).getAsJsonObject()
|
||||||
|
.getAsJsonObject("prevout")
|
||||||
|
.has("value");
|
||||||
|
assertThat(hasPreVout, is(false));
|
||||||
|
|
||||||
|
String jsonContent = new Gson().toJson(json);
|
||||||
|
TxValidator txValidator1 = txValidator.parseJsonValidateMakerFeeTx(jsonContent,
|
||||||
|
MakerTxValidatorSanityCheckTests.FEE_RECEIVER_ADDRESSES);
|
||||||
|
|
||||||
|
assertThat(txValidator1.getStatus(), is(FeeValidationStatus.NACK_JSON_ERROR));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void responseHasDifferentTxId() {
|
void responseHasDifferentTxId() {
|
||||||
String differentTxId = "abcde971ead7d03619e3a9eeaa771ed5adba14c448839e0299f857f7bb4ec07";
|
String differentTxId = "abcde971ead7d03619e3a9eeaa771ed5adba14c448839e0299f857f7bb4ec07";
|
||||||
|
Loading…
Reference in New Issue
Block a user