In validator's getScriptAddress, use correct plutus version from preamble.
Proper error message for compilation failure. For exp: compiler silently fails when blueprint json file is empty
New 'getPlutusScript' method in Validator class
Remove Lombok dependency. Generate getter/setter methods in Datum and Redeemer class
Generate "DataImpl" class for both Datum and Redeemer. The new Impl class extends generated Datum/Redeemer and implements Data interface with toPlutusData and fromPlutusData method.
A new annotation @ExtendWith(Clazz) to extend the validator class to additional tx building and submission capabilities like lock, unlock, deploy etc. Example: LockUnlockValidatorExtender
Example: Generate Validator class and extend to LockUnlockValidatorExtender to provide additional functionalities
String address = account.baseAddress();
//validator
HelloWorldValidator validator = new HelloWorldValidator(Networks.testnet())
.withBackendService(backendService);
//Deploy the contract to create reference input
var txResult = validator.deploy(address, SignerProviders.signerFrom(account), (msg) -> System.out.println(msg));
validator.withReferenceTxInput(txResult.getTxHash(), 0);
System.out.println(txResult);
//Datum to lock
var helloWorldDatum = new HelloWorldDatumImpl();
helloWorldDatum.setOwner(account.getBaseAddress().getPaymentCredentialHash().get());
var amounts = List.of(Amount.ada(20));
//Lock the contract
var txResult1 = validator.lock(address, amounts, helloWorldDatum, SignerProviders.signerFrom(account), s -> System.out.println(s));
System.out.println(txResult1);
//Unlock the contract
var receiver = new PubKeyReceiver(account.baseAddress(), Amount.ada(20));
var redeemer = new HelloWorldRedeemerImpl();
redeemer.setMsg("Hello, World!".getBytes(StandardCharsets.UTF_8));
var txResult2 = validator.unlock(List.of(receiver), account.baseAddress(), helloWorldDatum, redeemer,
SignerProviders.signerFrom(account), null, s -> System.out.println(s), account.getBaseAddress());
**TODO**
- [x] Handle parameterized contract
- [x] Generate one copy of a Datum/Redeemer class instead of multiple versions if same datum is used in multiple validators.
- [x] Handle blueprint json without ref schema/definitions
- [x] Handle Enum
- [x] Verify new api classes in Validator impl. PubKeyReceiver, ChangeReceiver etc.
getScriptAddress
, use correct plutus version from preamble.Data
interface withtoPlutusData
andfromPlutusData
method.A new annotation
@ExtendWith(Clazz)
to extend the validator class to additional tx building and submission capabilities like lock, unlock, deploy etc. Example:LockUnlockValidatorExtender
Example: Generate Validator class and extend to LockUnlockValidatorExtender to provide additional functionalities
}