Skip to content

Commit aab053d

Browse files
Merge pull request #3 from logicalmechanism/renaming-credentials
first rev for new naming convention
2 parents c1d7196 + e44ad06 commit aab053d

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

lib/aiken/transaction.ak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use aiken/time.{PosixTime}
88
use aiken/transaction/certificate.{Certificate}
99
use aiken/transaction/credential.{
1010
Address, Credential, DatumHashDigest, ScriptCredential, ScriptHash,
11-
VerificationKeyCredential, VerificationKeyHash,
11+
StakeCredential, VerificationKeyCredential, VerificationKeyHash,
1212
}
1313
use aiken/transaction/governance.{
1414
GovernanceActionId, ProposalProcedure, Vote, Voter,
@@ -73,7 +73,7 @@ pub type Transaction {
7373
mint: Value,
7474
// ^ minted value is now back to a value
7575
certificates: List<Certificate>,
76-
withdrawals: Dict<Credential, Lovelace>,
76+
withdrawals: Dict<StakeCredential, Lovelace>,
7777
validity_range: ValidityRange,
7878
extra_signatories: List<VerificationKeyHash>,
7979
redeemers: Dict<ScriptPurpose, Redeemer>,
Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use aiken/transaction/credential.{
2-
ColdCommitteeCredential, Credential, DRepCredential, HotCommitteeCredential,
3-
PoolId, VerificationKeyHash,
2+
ColdCommitteeCredential, DRepCredential, HotCommitteeCredential, PoolId,
3+
StakeCredential, VerificationKeyHash,
44
}
55
use aiken/transaction/governance.{Delegatee}
66
use aiken/transaction/value.{Lovelace}
@@ -10,30 +10,43 @@ use aiken/transaction/value.{Lovelace}
1010
/// they require signatures from / specific keys.
1111
pub type Certificate {
1212
// Register staking credential with an optional deposit amount
13-
RegisterStaking(Credential, Option<Lovelace>)
13+
RegisterStaking {
14+
delegator: StakeCredential,
15+
deposit_amount: Option<Lovelace>,
16+
}
1417
// Un-Register staking credential with an optional refund amount
15-
UnRegisterStaking(Credential, Option<Lovelace>)
18+
UnregisterStaking {
19+
delegator: StakeCredential,
20+
refund_amount: Option<Lovelace>,
21+
}
1622
// Delegate staking credential to a Delegatee
17-
DelegateStaking(Credential, Delegatee)
23+
DelegateStaking { delegator: StakeCredential, delegatee: Delegatee }
1824
// Register and delegate staking credential to a Delegatee in one certificate. Noter that
1925
// deposit is mandatory.
20-
RegisterAndDelegate(Credential, Delegatee, Lovelace)
26+
RegisterAndDelegate {
27+
delegator: StakeCredential,
28+
delegatee: Delegatee,
29+
deposit_amount: Lovelace,
30+
}
2131
// Register a DRep with a deposit value. The optional anchor is omitted.
22-
RegisterDRep(DRepCredential, Lovelace)
32+
RegisterDRep { representative: DRepCredential, deposit_amount: Lovelace }
2333
// Update a DRep. The optional anchor is omitted.
24-
UpdateDRep(DRepCredential)
34+
UpdateDRep { representative: DRepCredential }
2535
// UnRegister a DRep with mandatory refund value
26-
UnregisterDRep(DRepCredential, Lovelace)
36+
UnregisterDRep { representative: DRepCredential, refund_amount: Lovelace }
2737
// A digest of the PoolParams
28-
PoolRegister(
38+
PoolRegister {
2939
// poolId
30-
PoolId,
40+
pool_id: PoolId,
3141
// pool VFR
32-
VerificationKeyHash,
33-
)
42+
pool_vrf: VerificationKeyHash,
43+
}
3444
// The retirement certificate and the Epoch in which the retirement will take place
35-
PoolRetire(VerificationKeyHash, Int)
45+
PoolRetire { pool_id: PoolId, epoch: Int }
3646
// Authorize a Hot credential for a specific Committee member's cold credential
37-
AuthorizeHotCommittee(ColdCommitteeCredential, HotCommitteeCredential)
38-
ResignColdCommittee(ColdCommitteeCredential)
47+
AuthorizeHotCommittee {
48+
cold_memeber: ColdCommitteeCredential,
49+
hot_member: HotCommitteeCredential,
50+
}
51+
ResignColdCommittee { cold_member: ColdCommitteeCredential }
3952
}

0 commit comments

Comments
 (0)