Skip to content

Commit

Permalink
Fixed integration tests (#483)
Browse files Browse the repository at this point in the history
* Fixed integration tests

* Bump version for next beta release
  • Loading branch information
satran004 authored Jan 7, 2025
1 parent 7b77856 commit 6fb5988
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ void testGetLatestProtocolParameters() throws ApiException {

assertThat(protocolParams.getCostModels().get("PlutusV1").size(), is(166));
assertThat(protocolParams.getCostModels().get("PlutusV2").size(), is(175));
assertThat(protocolParams.getCostModels().get("PlutusV3").size(), is(251));
assertThat(protocolParams.getCostModels().get("PlutusV3").size(), greaterThan(251));
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group = com.bloxbean.cardano
artifactId = cardano-client-lib
version = 0.6.4-SNAPSHOT
version = 0.7.0-beta1
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,11 @@ void customDatumCustomRedeemerGuessContractAndSumContract() throws CborSerializa

TxSigner signer = SignerProviders.signerFrom(sender);

var txContext = TxBuilderContext.init(utxoSupplier, protocolParams);
Transaction transaction = TxBuilderContext.init(utxoSupplier, protocolParams)
.withSerializationEra(Era.Babbage)
.build(builder);
Transaction signedTxn = signer.sign(transaction);
Transaction signedTxn = signer.sign(txContext, transaction);

//Or build and sign in one call
// Transaction signedTxn = TxBuilderContext.init(backendService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void testStakeDelegation_addressKeyAsStakeKey() throws ApiException, CborSeriali
.andThen(adjustChangeOutput(senderAddr1, 2));

TxSigner signer = SignerProviders.signerFrom(senderAccount1)
.andThen(transaction -> senderAccount1.signWithStakeKey(transaction));
.andThen((context, transaction) -> senderAccount1.signWithStakeKey(transaction));

Transaction signedTransaction = TxBuilderContext.init(new DefaultUtxoSupplier(getBackendService().getUtxoService()), protocolParams)
.buildAndSign(builder, signer);
Expand Down Expand Up @@ -268,7 +268,7 @@ void testStakeDeRegistration_addressKeyAsStakeKey() throws ApiException, CborSer
.andThen(adjustChangeOutput(senderAddr3, 2));

TxSigner signer = SignerProviders.signerFrom(senderAccount3)
.andThen(transaction -> TransactionSigner.INSTANCE.sign(transaction, stakeHdKeyPair));
.andThen((context,transaction) -> TransactionSigner.INSTANCE.sign(transaction, stakeHdKeyPair));

Transaction signedTransaction = TxBuilderContext.init(new DefaultUtxoSupplier(getBackendService().getUtxoService()), protocolParams)
.buildAndSign(builder, signer);
Expand Down Expand Up @@ -319,7 +319,7 @@ void testStakeDelegationAnotherAccount() throws ApiException, CborSerializationE
.andThen(adjustChangeOutput(senderAddr4, 2));

TxSigner signer = SignerProviders.signerFrom(senderAccount4)
.andThen(transaction -> senderAccount4.signWithStakeKey(transaction));
.andThen((context,transaction) -> senderAccount4.signWithStakeKey(transaction));

Transaction signedTransaction = TxBuilderContext.init(new DefaultUtxoSupplier(getBackendService().getUtxoService()), protocolParams)
.buildAndSign(builder, signer);
Expand Down Expand Up @@ -365,8 +365,8 @@ void testWithdrawal() throws ApiException, CborSerializationException {
.andThen(adjustChangeOutput(senderAddr5, 3));

TxSigner signer = SignerProviders.signerFrom(senderAccount5)
.andThen(transaction -> senderAccount5.signWithStakeKey(transaction))
.andThen(transaction -> senderAccount6.signWithStakeKey(transaction));
.andThen((context, transaction) -> senderAccount5.signWithStakeKey(transaction))
.andThen((context,transaction) -> senderAccount6.signWithStakeKey(transaction));

Transaction signedTransaction = TxBuilderContext.init(new DefaultUtxoSupplier(getBackendService().getUtxoService()), protocolParams)
.buildAndSign(builder, signer);
Expand Down Expand Up @@ -471,8 +471,8 @@ void testStakeDelegation_scriptHashAsStakeKey() throws Exception {
.andThen(adjustChangeOutput(delegationFeePaymentAddress, 3));

TxSigner signer = SignerProviders.signerFrom(delegationFeePaymentAccount)
.andThen(transaction -> TransactionSigner.INSTANCE.sign(transaction, policy.getPolicyKeys().get(0)))
.andThen(transaction -> TransactionSigner.INSTANCE.sign(transaction, policy.getPolicyKeys().get(1)));
.andThen((context, transaction) -> TransactionSigner.INSTANCE.sign(transaction, policy.getPolicyKeys().get(0)))
.andThen((context,transaction) -> TransactionSigner.INSTANCE.sign(transaction, policy.getPolicyKeys().get(1)));

Transaction signedTransaction = TxBuilderContext.init(new DefaultUtxoSupplier(getBackendService().getUtxoService()), protocolParams)
.buildAndSign(builder, signer);
Expand Down Expand Up @@ -525,8 +525,8 @@ void testStakeDeRegistration_scriptHashAsStakeKey() throws ApiException, CborSer
.andThen(adjustChangeOutput(senderAddr9, 3));

TxSigner signer = SignerProviders.signerFrom(senderAccount9)
.andThen(transaction -> TransactionSigner.INSTANCE.sign(transaction, policy.getPolicyKeys().get(0)))
.andThen(transaction -> TransactionSigner.INSTANCE.sign(transaction, policy.getPolicyKeys().get(1)));
.andThen((context, transaction) -> TransactionSigner.INSTANCE.sign(transaction, policy.getPolicyKeys().get(0)))
.andThen((context,transaction) -> TransactionSigner.INSTANCE.sign(transaction, policy.getPolicyKeys().get(1)));

Transaction signedTransaction = TxBuilderContext.init(new DefaultUtxoSupplier(getBackendService().getUtxoService()), protocolParams)
.buildAndSign(builder, signer);
Expand Down

0 comments on commit 6fb5988

Please sign in to comment.