Skip to content

Commit de455e5

Browse files
authored
Merge pull request #90 from kryptokrauts/dev
Release of v2.1.0
2 parents 5268083 + 9270eeb commit de455e5

25 files changed

+541
-134
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
AETERNITY_TAG=v5.0.1
22
SOPHIA_COMPILER_TAG=v4.0.0
3-
AETERNAL_TAG=latest
3+
AETERNAL_TAG=0.11.1
44
NGINX_TAG=1.13.8

api/swagger_aeternal.yml

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ paths:
221221
description: ''
222222
headers: {}
223223
schema:
224-
type: object
224+
$ref: '#/definitions/ActiveNames'
225225
"/names/{name}":
226226
get:
227227
description: Search for a name
@@ -240,7 +240,7 @@ paths:
240240
description: ''
241241
headers: {}
242242
schema:
243-
type: object
243+
$ref: '#/definitions/ActiveNames'
244244
"/names/active":
245245
get:
246246
description: Get a list of all the active names
@@ -271,7 +271,7 @@ paths:
271271
description: ''
272272
headers: {}
273273
schema:
274-
type: object
274+
$ref: '#/definitions/ActiveNames'
275275
"/names/auctions/active":
276276
get:
277277
description: Get a list of all the active name auctions
@@ -314,7 +314,7 @@ paths:
314314
description: ''
315315
headers: {}
316316
schema:
317-
$ref: '#/definitions/ActiveAuctions'
317+
$ref: '#/definitions/ActiveNameAuctions'
318318
"/names/auctions/active/count":
319319
get:
320320
description: Get a count of all the active name auctions
@@ -357,7 +357,7 @@ paths:
357357
description: ''
358358
headers: {}
359359
schema:
360-
type: object
360+
$ref: '#/definitions/ActiveNameAuctionsCount'
361361
"/names/auctions/bids/account/{account}":
362362
get:
363363
description: Get bids made by a given account
@@ -737,12 +737,48 @@ definitions:
737737
UInt:
738738
type: integer
739739
minimum: 0
740+
EncodedHash:
741+
# Base58Check encoded 32-byte hash (key block hash, micro block hash,
742+
# root hash, etc)
743+
# pattern: "^(kh|mh|bf|bx|bs|th)_[1-9A-HJ-NP-Za-km-z]*$"
744+
description: 'Base58Check encoded tagged hash'
745+
type: string
740746
EncodedPubkey:
741747
# Base58Check encoded 32-byte pubkey (account, contract, oracle, etc)
742748
# pattern: "^(ak|ok|ct|ch|pp)_[1-9A-HJ-NP-Za-km-z]*$"
743749
description: 'Base58Check encoded tagged pubkey'
744750
type: string
745-
ActiveAuction:
751+
EncodedValue:
752+
# Base58Check encoded 32/64-byte value (signature, oracle query id, etc)
753+
# pattern: "^(oq|sg|cm|st|nm)_[1-9A-HJ-NP-Za-km-z]*$"
754+
description: 'Base58Check encoded tagged value'
755+
type: string
756+
EncodedByteArray:
757+
# Base64Check encoded byte array
758+
# pattern: "^(cb|tx|ck|cv|ba|ov|or|pi|ss|cs)_[0-9A-Za-z+/=]*$"
759+
description: 'Base64Check encoded tagged byte array'
760+
type: string
761+
NamePointer:
762+
type: object
763+
properties:
764+
key:
765+
type: string
766+
id:
767+
$ref: '#/definitions/EncodedPubkey'
768+
required:
769+
- key
770+
- id
771+
ActiveNameAuctionsCount:
772+
type: object
773+
properties:
774+
count:
775+
$ref: '#/definitions/UInt'
776+
result:
777+
type: string
778+
required:
779+
- count
780+
- result
781+
ActiveNameAuction:
746782
type: object
747783
properties:
748784
name:
@@ -753,7 +789,44 @@ definitions:
753789
$ref: '#/definitions/UInt'
754790
winning_bidder:
755791
$ref: '#/definitions/EncodedPubkey'
756-
ActiveAuctions:
792+
required:
793+
- name
794+
- expiration
795+
- winning_bid
796+
- winning_bidder
797+
ActiveNameAuctions:
798+
type: array
799+
items:
800+
$ref: '#/definitions/ActiveNameAuction'
801+
ActiveName:
802+
type: object
803+
properties:
804+
name:
805+
type: string
806+
name_hash:
807+
$ref: '#/definitions/EncodedValue'
808+
tx_hash:
809+
$ref: '#/definitions/EncodedHash'
810+
created_at_height:
811+
$ref: '#/definitions/UInt'
812+
auction_end_height:
813+
$ref: '#/definitions/UInt'
814+
owner:
815+
$ref: '#/definitions/EncodedPubkey'
816+
expires_at:
817+
$ref: '#/definitions/UInt'
818+
pointers:
819+
type: array
820+
items:
821+
$ref: '#/definitions/NamePointer'
822+
required:
823+
- name
824+
- name_hash
825+
- tx_hash
826+
- created_at_height
827+
- owner
828+
- pointers
829+
ActiveNames:
757830
type: array
758831
items:
759-
$ref: '#/definitions/ActiveAuction'
832+
$ref: '#/definitions/ActiveName'

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ services:
2424
- "3080:3080"
2525

2626
aeternal:
27-
image: aeternity/aepp-middleware:${AETERNAL_TAG}
27+
image: aeternity/aeternal:${AETERNAL_TAG}
2828
ports:
2929
- "8080:80"
3030
- "3020:3020"
31-
entrypoint: ./docker/wait-for-it.sh node:3013 -- ./aepp-middleware -p -s -w
31+
entrypoint: ./docker/wait-for-it.sh node:3013 -- ./aeternal -p -s -w
3232
environment:
3333
- NODE_URL=node:3013
3434
- AESOPHIA_URL=compiler:3080

docs/changelog.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## [v2.1.0](https://github.com/kryptokrauts/aepp-sdk-java/releases/tag/v2.1.0)
4+
5+
This release ships some fixes and enhancements. Additionally we renamed some attributes and model-classes. If you already used [v2.0.0](https://github.com/kryptokrauts/aepp-sdk-java/releases/tag/v2.0.0) it might be needed to fix these changes.
6+
7+
### Refactoring
8+
- [#86](../../../issues/86) add "payable" attribute to AccountResult-model
9+
10+
### Fixes
11+
- [#85](../../../issues/85) AeternalService: fix case-sensitive comparison of domains
12+
- [#88](../../../issues/88) replace Optional.orElse with Optional.orElseGet in the AccountServiceImpl
13+
14+
### Enhancements
15+
- [#84](../../../issues/84) add missing ÆNS related AeternalService functionalities
16+
- we added the possibility to query for active names
17+
and search for a name (which allows to receive e.g. the owner of a name)
18+
- [#87](../../../issues/87) add support to receive byteCode for given contractId
19+
320
## [v2.0.0](https://github.com/kryptokrauts/aepp-sdk-java/releases/tag/v2.0.0)
421

522
### Breaking changes and new features

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
organization=kryptokrauts
22
group=com.kryptokrauts
33
name=aepp-sdk-java
4-
version=2.0.0-SNAPSHOT
4+
version=2.1.0-SNAPSHOT
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.kryptokrauts.aeternity.generated.api;
22

33
import com.fasterxml.jackson.core.JsonProcessingException;
4+
import com.kryptokrauts.aeternity.sdk.service.aeternal.domain.ActiveNameAuctionsResult;
45
import io.vertx.ext.unit.TestContext;
5-
import java.util.Optional;
66
import org.junit.Test;
77

88
public class AeternalServiceTest extends BaseTest {
@@ -12,7 +12,7 @@ public void testStatus(TestContext context) {
1212
this.executeTest(
1313
context,
1414
t -> {
15-
Object result = this.aeternityServiceNative.aeternal.blockingGetStatus();
15+
Object result = this.aeternityServiceNative.aeternal.blockingGetMdwStatus();
1616
try {
1717
_logger.info("aeternal status: {}", objectMapper.writeValueAsString(result));
1818
} catch (JsonProcessingException e) {
@@ -26,18 +26,9 @@ public void testActiveAuctions(TestContext context) {
2626
this.executeTest(
2727
context,
2828
t -> {
29-
Object result =
30-
this.aeternityServiceNative.aeternal.blockingGetNameAuctionsActive(
31-
Optional.empty(),
32-
Optional.empty(),
33-
Optional.empty(),
34-
Optional.empty(),
35-
Optional.empty());
36-
try {
37-
_logger.info("active auctions: {}", objectMapper.writeValueAsString(result));
38-
} catch (JsonProcessingException e) {
39-
context.fail(e);
40-
}
29+
ActiveNameAuctionsResult result =
30+
this.aeternityServiceNative.aeternal.blockingGetActiveNameAuctions();
31+
_logger.info("active auctions: {}", result);
4132
});
4233
}
4334
}

src/integrationTest/java/com/kryptokrauts/aeternity/generated/api/PaymentSplitterContractTest.java

Lines changed: 110 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,12 @@ public void a_deployPaymentSplitterTest(TestContext context) throws Throwable {
132132
DryRunTransactionResult dryRunResult = dryRunResults.getResults().get(0);
133133
context.assertEquals("ok", dryRunResult.getResult());
134134

135-
contractCreate
136-
.toBuilder()
137-
.gas(dryRunResult.getContractCallObject().getGasUsed())
138-
.gasPrice(dryRunResult.getContractCallObject().getGasPrice())
139-
.build();
135+
contractCreate =
136+
contractCreate
137+
.toBuilder()
138+
.gas(dryRunResult.getContractCallObject().getGasUsed())
139+
.gasPrice(dryRunResult.getContractCallObject().getGasPrice())
140+
.build();
140141

141142
PostTransactionResult result =
142143
aeternityServiceNative.transactions.blockingPostTransaction(contractCreate);
@@ -268,6 +269,110 @@ public void b_callPayAndSplitMethodTest(TestContext context) throws Throwable {
268269
});
269270
}
270271

272+
@Test
273+
public void c_callGetTotalAmountSplitted(TestContext context) throws Throwable {
274+
this.executeTest(
275+
context,
276+
t -> {
277+
try {
278+
BigDecimal paymentValue = UnitConversionUtil.toAettos("0", Unit.AE);
279+
String calldata =
280+
aeternityServiceNative.compiler.blockingEncodeCalldata(
281+
paymentSplitterSource, "getTotalAmountSplitted", null);
282+
_logger.info("Contract ID: " + localDeployedContractId);
283+
284+
DryRunTransactionResults dryRunResults =
285+
this.aeternityServiceNative.transactions.blockingDryRunTransactions(
286+
DryRunRequest.builder()
287+
.build()
288+
.account(
289+
DryRunAccountModel.builder()
290+
.publicKey(baseKeyPair.getPublicKey())
291+
.build())
292+
.transactionInputItem(
293+
ContractCallTransactionModel.builder()
294+
.callData(calldata)
295+
.gas(BigInteger.valueOf(1579000))
296+
.contractId(localDeployedContractId)
297+
.gasPrice(BigInteger.valueOf(BaseConstants.MINIMAL_GAS_PRICE))
298+
.amount(paymentValue.toBigInteger())
299+
.nonce(getNextBaseKeypairNonce())
300+
.callerId(baseKeyPair.getPublicKey())
301+
.ttl(ZERO)
302+
.virtualMachine(targetVM)
303+
.build()));
304+
305+
_logger.info("callContractAfterDryRunOnLocalNode: " + dryRunResults.toString());
306+
context.assertEquals(1, dryRunResults.getResults().size());
307+
DryRunTransactionResult dryRunResult = dryRunResults.getResults().get(0);
308+
context.assertEquals("ok", dryRunResult.getResult());
309+
310+
Object decodedValue =
311+
decodeCallResult(
312+
paymentSplitterSource,
313+
"getTotalAmountSplitted",
314+
dryRunResult.getContractCallObject().getReturnType(),
315+
dryRunResult.getContractCallObject().getReturnValue());
316+
317+
System.out.println(decodedValue);
318+
} catch (Throwable e) {
319+
context.fail(e);
320+
}
321+
});
322+
}
323+
324+
@Test
325+
public void d_callGetOwner(TestContext context) throws Throwable {
326+
this.executeTest(
327+
context,
328+
t -> {
329+
try {
330+
BigDecimal paymentValue = UnitConversionUtil.toAettos("0", Unit.AE);
331+
String calldata =
332+
aeternityServiceNative.compiler.blockingEncodeCalldata(
333+
paymentSplitterSource, "getOwner", null);
334+
_logger.info("Contract ID: " + localDeployedContractId);
335+
336+
DryRunTransactionResults dryRunResults =
337+
this.aeternityServiceNative.transactions.blockingDryRunTransactions(
338+
DryRunRequest.builder()
339+
.build()
340+
.account(
341+
DryRunAccountModel.builder()
342+
.publicKey(baseKeyPair.getPublicKey())
343+
.build())
344+
.transactionInputItem(
345+
ContractCallTransactionModel.builder()
346+
.callData(calldata)
347+
.gas(BigInteger.valueOf(1579000))
348+
.contractId(localDeployedContractId)
349+
.gasPrice(BigInteger.valueOf(BaseConstants.MINIMAL_GAS_PRICE))
350+
.amount(paymentValue.toBigInteger())
351+
.nonce(getNextBaseKeypairNonce())
352+
.callerId(baseKeyPair.getPublicKey())
353+
.ttl(ZERO)
354+
.virtualMachine(targetVM)
355+
.build()));
356+
357+
_logger.info("callContractAfterDryRunOnLocalNode: " + dryRunResults.toString());
358+
context.assertEquals(1, dryRunResults.getResults().size());
359+
DryRunTransactionResult dryRunResult = dryRunResults.getResults().get(0);
360+
context.assertEquals("ok", dryRunResult.getResult());
361+
362+
Object decodedValue =
363+
decodeCallResult(
364+
paymentSplitterSource,
365+
"getOwner",
366+
dryRunResult.getContractCallObject().getReturnType(),
367+
dryRunResult.getContractCallObject().getReturnValue());
368+
369+
System.out.println(decodedValue);
370+
} catch (Throwable e) {
371+
context.fail(e);
372+
}
373+
});
374+
}
375+
271376
protected String createUnsignedContractCallTx(
272377
String callerId,
273378
BigInteger nonce,

src/integrationTest/java/com/kryptokrauts/aeternity/generated/api/TestConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ public interface TestConstants {
99
String testnetAccountPrivateKey =
1010
"a7a695f999b1872acb13d5b63a830a8ee060ba688a478a08c6e65dfad8a01cd70bb4ed7927f97b51e1bcb5e1340d12335b2a2b12c8bc5221d63c4bcb39d41e61";
1111

12+
String aeternalTestnetURL = "https://testnet.aeternal.io/";
13+
1214
String testnetURL = "https://sdk-testnet.aepps.com";
1315

1416
String testContractSourceCode = "contract Identity =\n entrypoint main(z : int) = z";

0 commit comments

Comments
 (0)