Skip to content

Commit 0e63aff

Browse files
committed
chore: traces
1 parent 04f3c60 commit 0e63aff

File tree

12 files changed

+77
-71
lines changed

12 files changed

+77
-71
lines changed

cardano/gateway/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ OGMIOS_ENDPOINT=http://127.0.0.1:1337
1212
CARDANO_CHAIN_HOST=127.0.0.1
1313
CARDANO_CHAIN_PORT=3001
1414
CARDANO_NETWORK_MAGIC=42
15-
CARDANO_EPOCH_NONCE_GENESIS="3c30e01c4d2be5cc21e14a88542929e5f9c2cfb7af6d94a746d7d61b6049dc62"
15+
CARDANO_EPOCH_NONCE_GENESIS="5a9f8426ad4079263b88c45c84079a2ccbd3e7d4218166404dababe07f69fdad"
1616

1717
HANDLER_JSON_PATH=/usr/src/app/cardano/offchain/deployments/handler.json
1818

cardano/offchain/src/create_deployment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ async function createReferenceUtxos(
390390
await Promise.all(
391391
deployLucids.map(async (inst) => {
392392
const address = await inst.wallet().address();
393-
fundDeployAccTx.pay.ToAddress(address, { lovelace: 100_000_000n });
393+
fundDeployAccTx.pay.ToAddress(address, { lovelace: 500_000_000n });
394394
})
395395
);
396396
await submitTx(fundDeployAccTx, lucid, "Fund Deploy Account", false);

cardano/onchain/lib/ibc/auth.ak

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pub fn contains_only_auth_tokens(
1818
output: Output,
1919
tokens: List<AuthToken>,
2020
) -> Bool {
21+
trace @"output": output
22+
trace @"tokens": tokens
2123
let expected_value =
2224
list.foldl(
2325
tokens,

cardano/onchain/validators/minting_channel.ak

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,11 @@ validator mint_channel(
152152
)
153153
expect Callback(ibc_module_callback) = ibc_module_redeemer
154154
and {
155-
valid_feature,
156-
is_status_active,
157-
is_channel_open,
158-
auth.contains_only_auth_tokens(channel_output, [channel_token]),
159-
ibc_module_callback == OnChanOpenInit { channel_id },
155+
valid_feature?,
156+
is_status_active?,
157+
is_channel_open?,
158+
auth.contains_only_auth_tokens(channel_output, [channel_token])?,
159+
(ibc_module_callback == OnChanOpenInit { channel_id })?,
160160
}
161161
}
162162

@@ -254,12 +254,12 @@ validator mint_channel(
254254
)
255255
expect Callback(ibc_module_callback) = ibc_module_redeemer
256256
and {
257-
connection_datum.state.state == connection_state.Open,
258-
is_channel_active,
259-
auth.contains_only_auth_tokens(channel_output, [channel_token]),
260-
is_channel_open,
261-
valid_channel,
262-
ibc_module_callback == OnChanOpenTry { channel_id },
257+
(connection_datum.state.state == connection_state.Open)?,
258+
is_channel_active?,
259+
auth.contains_only_auth_tokens(channel_output, [channel_token])?,
260+
is_channel_open?,
261+
valid_channel?,
262+
(ibc_module_callback == OnChanOpenTry { channel_id })?,
263263
}
264264
}
265265
}

cardano/onchain/validators/minting_client.ak

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ validator mint_client(spend_client_script_hash: Hash<Blake2b_224, Script>) {
8181
) == Active
8282

8383
and {
84-
mint |> auth.mint_auth_token(client_token),
85-
client_output |> auth.contains_only_auth_tokens([client_token]),
86-
valid_output_datum,
87-
is_state_active,
84+
(mint |> auth.mint_auth_token(client_token))?,
85+
(client_output |> auth.contains_only_auth_tokens([client_token]))?,
86+
valid_output_datum?,
87+
is_state_active?,
8888
}
8989
}
9090

cardano/onchain/validators/minting_connection.ak

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ validator mint_connection(
109109
_,
110110
)
111111
and {
112-
client_state_active,
113-
auth.contains_only_auth_tokens(connection_output, [connection_token]),
112+
client_state_active?,
113+
auth.contains_only_auth_tokens(connection_output, [connection_token])?,
114114
connection_datum.is_conn_open_init_valid(
115115
connection_output_datum,
116116
connection_token,
117-
),
117+
)?,
118118
}
119119
}
120120
ConnOpenTry {
@@ -184,9 +184,9 @@ validator mint_connection(
184184
verify_proof_policy_id,
185185
)
186186
and {
187-
client_state_active,
188-
auth.contains_only_auth_tokens(connection_output, [connection_token]),
189-
is_open_connection,
187+
client_state_active?,
188+
auth.contains_only_auth_tokens(connection_output, [connection_token])?,
189+
is_open_connection?,
190190
}
191191
}
192192
}

cardano/onchain/validators/minting_handler.ak

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ validator mint_handler(
3535

3636
// handler utxo contains auth token
3737
and {
38-
inputs |> list.any(fn(input) { input.output_reference == utxo_ref }),
39-
mint |> auth.mint_auth_token(auth_token),
40-
handler_output |> auth.contains_only_auth_tokens([auth_token]),
41-
valid_datum,
38+
(inputs |> list.any(fn(input) { input.output_reference == utxo_ref }))?,
39+
(mint |> auth.mint_auth_token(auth_token))?,
40+
(handler_output |> auth.contains_only_auth_tokens([auth_token]))?,
41+
valid_datum?,
4242
}
4343
}
4444

cardano/onchain/validators/minting_port.ak

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ validator mint_port {
6161
trace @"mint_port: transfer module output datum": module_output.datum
6262
expect NoDatum = module_output.datum
6363
and {
64-
valid_handler_operator,
65-
auth.mint_auth_token(mint, port_token),
66-
module_output |> auth.contain_auth_token(port_token),
67-
valid_number_of_ports(module_output, port_minting_policy_id),
64+
valid_handler_operator?,
65+
auth.mint_auth_token(mint, port_token)?,
66+
(module_output |> auth.contain_auth_token(port_token))?,
67+
valid_number_of_ports(module_output, port_minting_policy_id)?,
6868
}
6969
}
7070

cardano/onchain/validators/minting_voucher.ak

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ validator mint_voucher(module_token: AuthToken) {
8080
)
8181

8282
and {
83-
valid_receiver,
84-
valid_minted_tokens,
83+
valid_receiver?,
84+
valid_minted_tokens?,
8585
valid_voucher_output(
8686
payout_output,
8787
voucher_minting_policy_id,
8888
token_name,
8989
transfer_amount,
90-
),
90+
)?,
9191
}
9292
}
9393
BurnVoucher { packet_source_port, packet_source_channel } -> {
@@ -245,7 +245,7 @@ fn valid_voucher_output(
245245
let voucher_output_value = assets.without_lovelace(voucher_output.value)
246246
expect [actual_policy_id] = assets.policies(voucher_output_value)
247247
and {
248-
actual_policy_id == voucher_policy_id,
249-
quantity_of(voucher_output_value, voucher_policy_id, asset_name) >= transfer_amount,
248+
(actual_policy_id == voucher_policy_id)?,
249+
(quantity_of(voucher_output_value, voucher_policy_id, asset_name) >= transfer_amount)?,
250250
}
251251
}

cardano/onchain/validators/spending_client.ak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ validator spend_client {
8181

8282
if found_misbehaviour {
8383
trace @"spend_client: found misbehaviour"
84-
client_datum_mod.update_state_on_misbehaviour(datum, updated_datum)
84+
client_datum_mod.update_state_on_misbehaviour(datum, updated_datum)?
8585
} else {
8686
expect HeaderCase(header) = msg
8787
client_datum_mod.update_state(
8888
datum,
8989
updated_datum,
9090
header,
9191
tx_valid_from,
92-
)
92+
)?
9393
}
9494
}
9595

0 commit comments

Comments
 (0)