Skip to content

Commit 021cbf6

Browse files
authored
Update to iroha:2.0.0-pre-rc.22.2 (#438)
1 parent bf6bac1 commit 021cbf6

File tree

490 files changed

+21228
-19530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

490 files changed

+21228
-19530
lines changed

.github/workflows/iroha2-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [ iroha2-dev, iroha2-main ]
66
jobs:
77
build:
8-
runs-on: ubuntu-latest
8+
runs-on: self-hosted
99

1010
steps:
1111
- uses: actions/checkout@v3

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ build/
44
*/*/out
55

66
# Rust
7-
**/target
7+
**/target/
88
**/Cargo.lock
9+
**/storage/
10+
**/*.rs.bk
11+
**/rusty-tags.vi

docker-compose/docker-compose.yaml

Lines changed: 95 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,112 @@
1-
version: "3.8"
2-
31
services:
4-
iroha:
5-
image: hyperledger/iroha2:stable-2.0.0-pre-rc.20
2+
irohad0:
3+
image: hyperledger/iroha:2.0.0-pre-rc.22.2
4+
platform: linux/amd64
65
environment:
7-
TORII_P2P_ADDR: iroha:1337
8-
TORII_API_URL: iroha:8080
9-
TORII_TELEMETRY_URL: iroha:8180
10-
IROHA_PUBLIC_KEY: "ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"
11-
IROHA_PRIVATE_KEY: '{"digest_function": "ed25519", "payload": "9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"}'
12-
SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha:1337", "public_key": "ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"}, {"address":"iroha1:1338", "public_key": "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}, {"address": "iroha2:1339", "public_key": "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}, {"address": "iroha3:1340", "public_key": "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}]'
13-
IROHA_GENESIS_ACCOUNT_PUBLIC_KEY: 'ed01203f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255'
14-
IROHA_GENESIS_ACCOUNT_PRIVATE_KEY: '{ "digest_function": "ed25519", "payload": "038ae16b219da35aa036335ed0a43c28a2cc737150112c78a7b8034b9d99c9023f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255" }'
15-
WSV_WASM_RUNTIME_CONFIG: "{\"FUEL_LIMIT\":900000000000, \"MAX_MEMORY\": 524288000}"
6+
CHAIN: 00000000-0000-0000-0000-000000000000
7+
PUBLIC_KEY: ed0120A98BAFB0663CE08D75EBD506FEC38A84E576A7C9B0897693ED4B04FD9EF2D18D
8+
PRIVATE_KEY: 802620A4DFC16789FBF9A588525E4AC7F791AC51B12AEE8919EACC03EB2FC31D32C692
9+
P2P_ADDRESS: 0.0.0.0:1337
10+
API_ADDRESS: 0.0.0.0:8080
11+
TRUSTED_PEERS: '[{"address":"irohad2:1339","public_key":"ed01204EE2FCD53E1730AF142D1E23951198678295047F9314B4006B0CB61850B1DB10"},{"address":"irohad1:1338","public_key":"ed01209897952D14BDFAEA780087C38FF3EB800CB20B882748FC95A575ADB9CD2CB21D"},{"address":"irohad3:1340","public_key":"ed0120CACF3A84B8DC8710CE9D6B968EE95EC7EE4C93C85858F026F3B4417F569592CE"}]'
12+
GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4
13+
GENESIS_PRIVATE_KEY: 80262082B3BDE54AEBECA4146257DA0DE8D59D8E46D5FE34887DCD8072866792FCB3AD
14+
GENESIS: /tmp/genesis.signed.scale
15+
TOPOLOGY: '[{"address":"irohad2:1339","public_key":"ed01204EE2FCD53E1730AF142D1E23951198678295047F9314B4006B0CB61850B1DB10"},{"address":"irohad1:1338","public_key":"ed01209897952D14BDFAEA780087C38FF3EB800CB20B882748FC95A575ADB9CD2CB21D"},{"address":"irohad0:1337","public_key":"ed0120A98BAFB0663CE08D75EBD506FEC38A84E576A7C9B0897693ED4B04FD9EF2D18D"},{"address":"irohad3:1340","public_key":"ed0120CACF3A84B8DC8710CE9D6B968EE95EC7EE4C93C85858F026F3B4417F569592CE"}]'
1616
ports:
17-
- "1337:1337"
18-
- "8080:8080"
19-
- "8180:8180"
17+
- 1337:1337
18+
- 8080:8080
2019
volumes:
21-
- "../modules/test-tools/src/main/resources:/config"
22-
- "../modules/test-tools/src/main/resources:/app/.cache/wasmtime"
20+
- "../modules/test-tools/src/main/resources:/config"
2321
init: true
24-
command: iroha --submit-genesis
25-
26-
iroha1:
27-
image: hyperledger/iroha2:stable-2.0.0-pre-rc.20
22+
healthcheck:
23+
test: test $(curl -s http://127.0.0.1:8080/status/blocks) -gt 0
24+
interval: 2s
25+
timeout: 1s
26+
retries: 30
27+
start_period: 4s
28+
command: |-
29+
/bin/sh -c "
30+
EXECUTOR_RELATIVE_PATH=$(jq -r '.executor' /config/genesis.json) && \\
31+
EXECUTOR_ABSOLUTE_PATH=$(realpath \"/config/$$EXECUTOR_RELATIVE_PATH\") && \\
32+
jq \\
33+
--arg executor \"$$EXECUTOR_ABSOLUTE_PATH\" \\
34+
--argjson topology \"$$TOPOLOGY\" \\
35+
'.executor = $$executor | .topology = $$topology' /config/genesis.json \\
36+
>/tmp/genesis.json && \\
37+
kagami genesis sign /tmp/genesis.json \\
38+
--public-key $$GENESIS_PUBLIC_KEY \\
39+
--private-key $$GENESIS_PRIVATE_KEY \\
40+
--out-file $$GENESIS \\
41+
&& \\
42+
irohad
43+
"
44+
irohad1:
45+
image: hyperledger/iroha:2.0.0-pre-rc.22.2
46+
platform: linux/amd64
2847
environment:
29-
TORII_P2P_ADDR: iroha1:1338
30-
TORII_API_URL: iroha1:8081
31-
TORII_TELEMETRY_URL: iroha1:8181
32-
IROHA_PUBLIC_KEY: "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"
33-
IROHA_PRIVATE_KEY: '{"digest_function": "ed25519", "payload": "3bac34cda9e3763fa069c1198312d1ec73b53023b8180c822ac355435edc4a24cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}'
34-
SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha:1337", "public_key": "ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"}, {"address":"iroha1:1338", "public_key": "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}, {"address": "iroha2:1339", "public_key": "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}, {"address": "iroha3:1340", "public_key": "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}]'
35-
IROHA_GENESIS_ACCOUNT_PUBLIC_KEY: 'ed01203f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255'
36-
IROHA_GENESIS_ACCOUNT_PRIVATE_KEY: '{ "digest_function": "ed25519", "payload": "038ae16b219da35aa036335ed0a43c28a2cc737150112c78a7b8034b9d99c9023f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255" }'
37-
WSV_WASM_RUNTIME_CONFIG: "{\"FUEL_LIMIT\":900000000000, \"MAX_MEMORY\": 524288000}"
48+
CHAIN: 00000000-0000-0000-0000-000000000000
49+
PUBLIC_KEY: ed01209897952D14BDFAEA780087C38FF3EB800CB20B882748FC95A575ADB9CD2CB21D
50+
PRIVATE_KEY: 8026203ECA64ADC23DC106C9D703233375EA6AC345AD7299FF3AD45F355DE6CD1B5510
51+
P2P_ADDRESS: 0.0.0.0:1338
52+
API_ADDRESS: 0.0.0.0:8081
53+
GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4
54+
TRUSTED_PEERS: '[{"address":"irohad2:1339","public_key":"ed01204EE2FCD53E1730AF142D1E23951198678295047F9314B4006B0CB61850B1DB10"},{"address":"irohad0:1337","public_key":"ed0120A98BAFB0663CE08D75EBD506FEC38A84E576A7C9B0897693ED4B04FD9EF2D18D"},{"address":"irohad3:1340","public_key":"ed0120CACF3A84B8DC8710CE9D6B968EE95EC7EE4C93C85858F026F3B4417F569592CE"}]'
3855
ports:
39-
- "1338:1338"
40-
- "8081:8081"
41-
- "8181:8181"
56+
- 1338:1338
57+
- 8081:8081
4258
volumes:
43-
- "../modules/test-tools/src/main/resources:/config"
44-
- "../modules/test-tools/src/main/resources:/app/.cache/wasmtime"
59+
- "../modules/test-tools/src/main/resources:/config"
4560
init: true
46-
command: iroha
47-
48-
iroha2:
49-
image: hyperledger/iroha2:stable-2.0.0-pre-rc.20
61+
healthcheck:
62+
test: test $(curl -s http://127.0.0.1:8081/status/blocks) -gt 0
63+
interval: 2s
64+
timeout: 1s
65+
retries: 30
66+
start_period: 4s
67+
irohad2:
68+
image: hyperledger/iroha:2.0.0-pre-rc.22.2
69+
platform: linux/amd64
5070
environment:
51-
TORII_P2P_ADDR: iroha2:1339
52-
TORII_API_URL: iroha2:8082
53-
TORII_TELEMETRY_URL: iroha2:8182
54-
IROHA_PUBLIC_KEY: "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"
55-
IROHA_PRIVATE_KEY: '{"digest_function": "ed25519", "payload": "1261a436d36779223d7d6cf20e8b644510e488e6a50bafd77a7485264d27197dfaca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}'
56-
SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha:1337", "public_key": "ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"}, {"address":"iroha1:1338", "public_key": "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}, {"address": "iroha2:1339", "public_key": "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}, {"address": "iroha3:1340", "public_key": "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}]'
57-
IROHA_GENESIS_ACCOUNT_PUBLIC_KEY: 'ed01203f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255'
58-
IROHA_GENESIS_ACCOUNT_PRIVATE_KEY: '{ "digest_function": "ed25519", "payload": "038ae16b219da35aa036335ed0a43c28a2cc737150112c78a7b8034b9d99c9023f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255" }'
59-
WSV_WASM_RUNTIME_CONFIG: "{\"FUEL_LIMIT\":900000000000, \"MAX_MEMORY\": 524288000}"
71+
CHAIN: 00000000-0000-0000-0000-000000000000
72+
PUBLIC_KEY: ed01204EE2FCD53E1730AF142D1E23951198678295047F9314B4006B0CB61850B1DB10
73+
PRIVATE_KEY: 8026207B1C78F733EDAFD6AF9BAC3A0D6C5A494557DD031609A4FDD9796EEF471D928C
74+
P2P_ADDRESS: 0.0.0.0:1339
75+
API_ADDRESS: 0.0.0.0:8082
76+
GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4
77+
TRUSTED_PEERS: '[{"address":"irohad1:1338","public_key":"ed01209897952D14BDFAEA780087C38FF3EB800CB20B882748FC95A575ADB9CD2CB21D"},{"address":"irohad0:1337","public_key":"ed0120A98BAFB0663CE08D75EBD506FEC38A84E576A7C9B0897693ED4B04FD9EF2D18D"},{"address":"irohad3:1340","public_key":"ed0120CACF3A84B8DC8710CE9D6B968EE95EC7EE4C93C85858F026F3B4417F569592CE"}]'
6078
ports:
61-
- "1339:1339"
62-
- "8082:8082"
63-
- "8182:8182"
79+
- 1339:1339
80+
- 8082:8082
6481
volumes:
65-
- "../modules/test-tools/src/main/resources:/config"
66-
- "../modules/test-tools/src/main/resources:/app/.cache/wasmtime"
82+
- "../modules/test-tools/src/main/resources:/config"
6783
init: true
68-
command: iroha
69-
70-
iroha3:
71-
image: hyperledger/iroha2:stable-2.0.0-pre-rc.20
84+
healthcheck:
85+
test: test $(curl -s http://127.0.0.1:8082/status/blocks) -gt 0
86+
interval: 2s
87+
timeout: 1s
88+
retries: 30
89+
start_period: 4s
90+
irohad3:
91+
image: hyperledger/iroha:2.0.0-pre-rc.22.2
92+
platform: linux/amd64
7293
environment:
73-
TORII_P2P_ADDR: iroha3:1340
74-
TORII_API_URL: iroha3:8083
75-
TORII_TELEMETRY_URL: iroha3:8183
76-
IROHA_PUBLIC_KEY: "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"
77-
IROHA_PRIVATE_KEY: '{"digest_function": "ed25519", "payload": "a70dab95c7482eb9f159111b65947e482108cfe67df877bd8d3b9441a781c7c98e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}'
78-
SUMERAGI_TRUSTED_PEERS: '[{"address":"iroha:1337", "public_key": "ed01207233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0"}, {"address":"iroha1:1338", "public_key": "ed0120cc25624d62896d3a0bfd8940f928dc2abf27cc57cefeb442aa96d9081aae58a1"}, {"address": "iroha2:1339", "public_key": "ed0120faca9e8aa83225cb4d16d67f27dd4f93fc30ffa11adc1f5c88fd5495ecc91020"}, {"address": "iroha3:1340", "public_key": "ed01208e351a70b6a603ed285d666b8d689b680865913ba03ce29fb7d13a166c4e7f1f"}]'
79-
IROHA_GENESIS_ACCOUNT_PUBLIC_KEY: 'ed01203f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255'
80-
IROHA_GENESIS_ACCOUNT_PRIVATE_KEY: '{ "digest_function": "ed25519", "payload": "038ae16b219da35aa036335ed0a43c28a2cc737150112c78a7b8034b9d99c9023f4e3e98571b55514edc5ccf7e53ca7509d89b2868e62921180a6f57c2f4e255" }'
81-
WSV_WASM_RUNTIME_CONFIG: "{\"FUEL_LIMIT\":900000000000, \"MAX_MEMORY\": 524288000}"
94+
CHAIN: 00000000-0000-0000-0000-000000000000
95+
PUBLIC_KEY: ed0120CACF3A84B8DC8710CE9D6B968EE95EC7EE4C93C85858F026F3B4417F569592CE
96+
PRIVATE_KEY: 8026206C7FF4CA09D395C7B7332C654099406E929C6238942E3CE85155CC1A5E2CF519
97+
P2P_ADDRESS: 0.0.0.0:1340
98+
API_ADDRESS: 0.0.0.0:8083
99+
GENESIS_PUBLIC_KEY: ed01204164BF554923ECE1FD412D241036D863A6AE430476C898248B8237D77534CFC4
100+
TRUSTED_PEERS: '[{"address":"irohad2:1339","public_key":"ed01204EE2FCD53E1730AF142D1E23951198678295047F9314B4006B0CB61850B1DB10"},{"address":"irohad1:1338","public_key":"ed01209897952D14BDFAEA780087C38FF3EB800CB20B882748FC95A575ADB9CD2CB21D"},{"address":"irohad0:1337","public_key":"ed0120A98BAFB0663CE08D75EBD506FEC38A84E576A7C9B0897693ED4B04FD9EF2D18D"}]'
82101
ports:
83-
- "1340:1340"
84-
- "8083:8083"
85-
- "8183:8183"
102+
- 1340:1340
103+
- 8083:8083
86104
volumes:
87-
- "../modules/test-tools/src/main/resources:/config"
88-
- "../modules/test-tools/src/main/resources:/app/.cache/wasmtime"
105+
- "../modules/test-tools/src/main/resources:/config"
89106
init: true
90-
command: iroha
107+
healthcheck:
108+
test: test $(curl -s http://127.0.0.1:8083/status/blocks) -gt 0
109+
interval: 2s
110+
timeout: 1s
111+
retries: 30
112+
start_period: 4s
Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,69 @@
11
package jp.co.soramitsu.iroha2
22

33
import jp.co.soramitsu.iroha2.generated.AccountId
4+
import jp.co.soramitsu.iroha2.generated.AssetId
5+
import jp.co.soramitsu.iroha2.generated.AssetType
46
import jp.co.soramitsu.iroha2.generated.AssetValue
5-
import jp.co.soramitsu.iroha2.generated.AssetValueType
67
import kotlinx.coroutines.runBlocking
78
import java.net.URL
9+
import java.util.UUID
810

911
fun main(args: Array<String>): Unit = runBlocking {
10-
val peerUrl = "http://127.0.0.1:8080"
11-
val telemetryUrl = "http://127.0.0.1:8180"
12-
val admin = AccountId("wonderland".asDomainId(), "bob".asName())
12+
val chainId = UUID.fromString("00000000-0000-0000-0000-000000000000")
13+
val apiUrl = "http://127.0.0.1:8080"
14+
val peerUrl = "http://127.0.0.1:1337"
15+
val admin = AccountId(
16+
"wonderland".asDomainId(),
17+
publicKeyFromHex("CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03").toIrohaPublicKey(),
18+
)
1319
val adminKeyPair = keyPairFromHex(
14-
"7233bfc89dcbd68c19fde6ce6158225298ec1131b6a130d1aeb454c1ab5183c0",
15-
"9ac47abf59b356e0bd7dcbbbb4dec080e302156a48ca907e47cb6aea1d32719e",
20+
"CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03",
21+
"CCF31D85E3B32A4BEA59987CE0C78E3B8E2DB93881468AB2435FE45D5C9DCD53",
1622
)
17-
18-
val client = AdminIroha2Client(URL(peerUrl), URL(peerUrl), URL(telemetryUrl), log = true)
23+
val client = AdminIroha2Client(URL(apiUrl), URL(peerUrl), log = true)
1924
val query = Query(client, admin, adminKeyPair)
2025
query.findAllDomains()
2126
.also { println("ALL DOMAINS: ${it.map { d -> d.id.asString() }}") }
27+
query.findAllAccounts()
28+
.also { println("ALL ACCOUNTS: ${it.map { d -> d.id.asString() }}") }
29+
query.findAllAssets()
30+
.also { println("ALL ASSETS: ${it.map { d -> d.id.asString() }}") }
2231

23-
val sendTransaction = SendTransaction(client, admin, adminKeyPair)
32+
val sendTransaction = SendTransaction(client, admin, adminKeyPair, chainId)
2433

2534
val domain = "looking_glass_${System.currentTimeMillis()}"
2635
sendTransaction.registerDomain(domain).also { println("DOMAIN $domain CREATED") }
2736

28-
val madHatter = "madHatter_${System.currentTimeMillis()}$ACCOUNT_ID_DELIMITER$domain"
2937
val madHatterKeyPair = generateKeyPair()
30-
sendTransaction.registerAccount(madHatter, listOf(madHatterKeyPair.public.toIrohaPublicKey()))
38+
val madHatter = AccountId(domain.asDomainId(), madHatterKeyPair.public.toIrohaPublicKey())
39+
sendTransaction.registerAccount(madHatter.asString())
3140
.also { println("ACCOUNT $madHatter CREATED") }
3241

33-
query.findAllAccounts()
34-
.also { println("ALL ACCOUNTS: ${it.map { a -> a.id.asString() }}") }
35-
3642
val assetDefinition = "asset_time_${System.currentTimeMillis()}$ASSET_ID_DELIMITER$domain"
37-
sendTransaction.registerAssetDefinition(assetDefinition, AssetValueType.Quantity())
43+
sendTransaction.registerAssetDefinition(assetDefinition, AssetType.numeric())
3844
.also { println("ASSET DEFINITION $assetDefinition CREATED") }
3945

40-
val madHatterAsset = "$assetDefinition$ASSET_ID_DELIMITER$madHatter"
41-
sendTransaction.registerAsset(madHatterAsset, AssetValue.Quantity(100))
46+
val madHatterAsset = AssetId(madHatter, assetDefinition.asAssetDefinitionId())
47+
sendTransaction.registerAsset(madHatterAsset, AssetValue.Numeric(100.asNumeric()))
4248
.also { println("ASSET $madHatterAsset CREATED") }
4349

44-
val whiteRabbit = "whiteRabbit_${System.currentTimeMillis()}$ACCOUNT_ID_DELIMITER$domain"
4550
val whiteRabbitKeyPair = generateKeyPair()
46-
sendTransaction.registerAccount(whiteRabbit, listOf(whiteRabbitKeyPair.public.toIrohaPublicKey()))
51+
val whiteRabbit = AccountId(domain.asDomainId(), whiteRabbitKeyPair.public.toIrohaPublicKey())
52+
sendTransaction.registerAccount(whiteRabbit.asString())
4753
.also { println("ACCOUNT $whiteRabbit CREATED") }
4854

49-
val whiteRabbitAsset = "$assetDefinition$ASSET_ID_DELIMITER$whiteRabbit"
50-
sendTransaction.registerAsset(whiteRabbitAsset, AssetValue.Quantity(0))
55+
val whiteRabbitAsset = AssetId(whiteRabbit, assetDefinition.asAssetDefinitionId())
56+
sendTransaction.registerAsset(whiteRabbitAsset, AssetValue.Numeric(0.asNumeric()))
5157
.also { println("ASSET $whiteRabbitAsset CREATED") }
5258

53-
sendTransaction.transferAsset(madHatterAsset, 10, whiteRabbit, madHatter.asAccountId(), madHatterKeyPair)
59+
sendTransaction.transferAsset(madHatterAsset, 10, whiteRabbit.asString(), madHatter, madHatterKeyPair)
5460
.also { println("$madHatter TRANSFERRED FROM $madHatterAsset TO $whiteRabbitAsset: 10") }
55-
query.getAccountAmount(madHatter, madHatterAsset).also { println("$madHatterAsset BALANCE: $it") }
56-
query.getAccountAmount(whiteRabbit, whiteRabbitAsset).also { println("$whiteRabbitAsset BALANCE: $it") }
61+
query.getAccountAmount(madHatter, madHatterAsset.definition).also { println("$madHatterAsset BALANCE: $it") }
62+
query.getAccountAmount(whiteRabbit, whiteRabbitAsset.definition).also { println("$whiteRabbitAsset BALANCE: $it") }
5763

58-
sendTransaction.burnAssets(madHatterAsset, 10, madHatter.asAccountId(), madHatterKeyPair)
64+
sendTransaction.burnAssets(madHatterAsset, 10, madHatter, madHatterKeyPair)
5965
.also { println("$madHatterAsset WAS BURN") }
6066

61-
query.getAccountAmount(madHatter, madHatterAsset)
67+
query.getAccountAmount(madHatter, madHatterAsset.definition)
6268
.also { println("$madHatterAsset BALANCE: $it AFTER ASSETS BURNING") }
6369
}

0 commit comments

Comments
 (0)