Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MicroProofs committed May 21, 2024
1 parent 974032a commit 3223a7a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 33 deletions.
6 changes: 3 additions & 3 deletions aiken.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ requirements = []
source = "github"

[etags]
"aiken-lang/fuzz@main" = [{ secs_since_epoch = 1715741615, nanos_since_epoch = 791411000 }, "d7aadd4a9b25589bd6d5e3bbedcd809cdf97fe3eddb365cf89cd6ac6bc829643"]
"aiken-lang/sparse-merkle-tree@main" = [{ secs_since_epoch = 1715741616, nanos_since_epoch = 5835000 }, "bfef445771d3be9c165c8d2e0a2b6eb437ef55f94ab061470ac921b00cfbf17e"]
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1715741615, nanos_since_epoch = 554058000 }, "3d3d948e66503986746dfdf33ca5e80ac634b356c928321987188473d813b2db"]
"aiken-lang/fuzz@main" = [{ secs_since_epoch = 1716260504, nanos_since_epoch = 947915000 }, "d7aadd4a9b25589bd6d5e3bbedcd809cdf97fe3eddb365cf89cd6ac6bc829643"]
"aiken-lang/sparse-merkle-tree@main" = [{ secs_since_epoch = 1716260505, nanos_since_epoch = 223186000 }, "e038474b26fcf3ea00f93497891354db93df206402f532445a4a26374bc89f97"]
"aiken-lang/stdlib@main" = [{ secs_since_epoch = 1716260504, nanos_since_epoch = 860710000 }, "3d3d948e66503986746dfdf33ca5e80ac634b356c928321987188473d813b2db"]
7 changes: 3 additions & 4 deletions lib/hardfork.ak
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ pub fn burn_forked(

// // validate mint
// // Expect only 1 minted token
// expect [(minted_token, 1)] =
// expect [Pair(minted_token, 1)] =
// mint
// |> value.from_minted_value
// |> value.tokens(own_policy)
Expand Down Expand Up @@ -792,8 +792,7 @@ pub fn burn_forked(
// stake_credential: None,
// }

// let expected_fortuna_v2_datum: Datum =
// InlineDatum(Statev2 { mining_state: todo, extra: todo })
// let expected_fortuna_v2_datum: Datum = InlineDatum(todo)

// and {
// // Miner mined a valid fortuna v1 block
Expand All @@ -816,7 +815,7 @@ pub fn burn_forked(
// out_locked_tuna == miner_locked_tuna + locked_tuna,
// out_block_signals == block_signals + 1,
// // Thresholds are met
// out_block_signals >= miner_hardfork_threshold,
// out_block_signals >= _miner_hardfork_threshold,
// out_locked_tuna + ref_locked_tuna >= total_emitted * tuna_hardfork_threshold_numerator / tuna_hardfork_threshold_denominator,
// // Miner lock value is correct
// value.without_lovelace(out_miner_lock_value) == value.without_lovelace(
Expand Down
32 changes: 6 additions & 26 deletions validators/unused_fork.ak
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use aiken/dict
use aiken/alist
use aiken/list
use aiken/transaction.{InlineDatum,
OutputReference, ScriptContext, Transaction} as tx
Expand Down Expand Up @@ -73,7 +73,7 @@ validator(init_utxo_ref: OutputReference, fortuna_v1_hash: ByteArray) {
let own_withdrawal = Inline(ScriptCredential(own_policy))

// Fork Mint(0) requirement: Withdrawal script is present
dict.has_key(withdrawals, own_withdrawal)
alist.has_key(withdrawals, own_withdrawal)
}

tx.WithdrawFrom(stake_cred) -> {
Expand Down Expand Up @@ -167,15 +167,7 @@ validator(init_utxo_ref: OutputReference, fortuna_v1_hash: ByteArray) {
locked_tokens_ref,
)

HardFork {
hardfork_state_input,
hardfork_output_index,
nft_output_index,
lock_output_index,
ownership_key_index,
v2_miner_output,
lock_action,
} -> {
HardFork { .. } -> {
expect Some(locked_state_input) =
list.find(
transaction.reference_inputs,
Expand All @@ -184,22 +176,10 @@ validator(init_utxo_ref: OutputReference, fortuna_v1_hash: ByteArray) {
},
)

expect LockState { locked_tuna: user_locked_tuna }: ForkDatum =
expect LockState { locked_tuna: _user_locked_tuna }: ForkDatum =
get_inline_datum(locked_state_input.output.datum)

hf.hard_fork(
fv1h: fortuna_v1_hash,
hfsi: hardfork_state_input,
hoi: hardfork_output_index,
noi: nft_output_index,
loi: lock_output_index,
oki: ownership_key_index,
vmo: v2_miner_output,
la: lock_action,
tx: transaction,
op: own_policy,
rlt: user_locked_tuna,
)
todo
}

FailForkAttempt { fortuna_v1_output } ->
Expand Down Expand Up @@ -228,6 +208,6 @@ validator(init_utxo_ref: OutputReference, fortuna_v1_hash: ByteArray) {
let own_withdrawal = Inline(own_input.address.payment_credential)

// Fork Spend(0) requirement: Withdrawal script is present
dict.has_key(withdrawals, own_withdrawal)
alist.has_key(withdrawals, own_withdrawal)
}
}

0 comments on commit 3223a7a

Please sign in to comment.