Enforce version 2+ for DEPLOY_AT

This commit is contained in:
catbref 2020-05-19 08:35:25 +01:00
parent b4284515e7
commit 74f89af841

View File

@ -137,10 +137,12 @@ public class DeployAtTransaction extends Transaction {
return ValidationResult.NO_BALANCE;
}
// Check version from creation bytes
if (this.getVersion() < 2)
return ValidationResult.INVALID_CREATION_BYTES;
// Check creation bytes are valid (for v2+)
if (this.getVersion() >= 2) {
// Do actual validation
ensureATAddress();
this.ensureATAddress();
// Just enough AT data to allow API to query initial balances, etc.
String atAddress = this.deployATTransactionData.getAtAddress();
@ -160,9 +162,6 @@ public class DeployAtTransaction extends Transaction {
// Not valid
return ValidationResult.INVALID_CREATION_BYTES;
}
} else {
// Skip validation for old, dead ATs
}
return ValidationResult.OK;
}