Skip to content

Commit

Permalink
Rename Conditions to UnlockConditions
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Nov 8, 2023
1 parent 14ff107 commit 67b3465
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions pkg/protocol/engine/utxoledger/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func TestBasicOutputOnEd25519WithoutSpendConstraintsSerialization(t *testing.T)

iotaOutput := &iotago.BasicOutput{
Amount: amount,
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address,
},
Expand Down Expand Up @@ -177,7 +177,7 @@ func TestBasicOutputOnEd25519WithSpendConstraintsSerialization(t *testing.T) {

iotaOutput := &iotago.BasicOutput{
Amount: amount,
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address,
},
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestNFTOutputSerialization(t *testing.T) {
iotaOutput := &iotago.NFTOutput{
Amount: amount,
NFTID: nftID,
Conditions: iotago.NFTOutputUnlockConditions{
UnlockConditions: iotago.NFTOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address,
},
Expand Down Expand Up @@ -254,7 +254,7 @@ func TestNFTOutputWithSpendConstraintsSerialization(t *testing.T) {
iotaOutput := &iotago.NFTOutput{
Amount: amount,
NFTID: nftID,
Conditions: iotago.NFTOutputUnlockConditions{
UnlockConditions: iotago.NFTOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address.ToAddress(),
},
Expand Down Expand Up @@ -299,7 +299,7 @@ func TestAccountOutputSerialization(t *testing.T) {
iotaOutput := &iotago.AccountOutput{
Amount: amount,
AccountID: aliasID,
Conditions: iotago.AccountOutputUnlockConditions{
UnlockConditions: iotago.AccountOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address,
},
Expand Down Expand Up @@ -342,7 +342,7 @@ func TestAnchorOutputSerialization(t *testing.T) {
iotaOutput := &iotago.AnchorOutput{
Amount: amount,
AnchorID: aliasID,
Conditions: iotago.AnchorOutputUnlockConditions{
UnlockConditions: iotago.AnchorOutputUnlockConditions{
&iotago.StateControllerAddressUnlockCondition{
Address: stateController.ToAddress(),
},
Expand Down Expand Up @@ -391,7 +391,7 @@ func TestFoundryOutputSerialization(t *testing.T) {
MeltedTokens: new(big.Int).SetBytes([]byte{0}),
MaximumSupply: supply,
},
Conditions: iotago.FoundryOutputUnlockConditions{
UnlockConditions: iotago.FoundryOutputUnlockConditions{
&iotago.ImmutableAccountUnlockCondition{
Address: aliasID.ToAddress().(*iotago.AccountAddress),
},
Expand Down Expand Up @@ -425,7 +425,7 @@ func TestDelegationOutputSerialization(t *testing.T) {
DelegationID: iotago_tpkg.RandDelegationID(),
ValidatorAddress: utils.RandAddress(iotago.AddressAccount).(*iotago.AccountAddress),
StartEpoch: iotago_tpkg.RandEpoch(),
Conditions: iotago.DelegationOutputUnlockConditions{
UnlockConditions: iotago.DelegationOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/protocol/engine/utxoledger/slot_diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestSimpleSlotDiffSerialization(t *testing.T) {
amount := iotago.BaseToken(832493)
iotaOutput := &iotago.BasicOutput{
Amount: amount,
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address,
},
Expand Down
12 changes: 6 additions & 6 deletions pkg/testsuite/mock/wallet_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (w *Wallet) CreateAccountFromInput(transactionName string, inputName string
remainderOutput := &iotago.BasicOutput{
Amount: input.BaseTokenAmount() - accountOutput.Amount,
Mana: input.StoredMana() - accountOutput.Mana,
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{Address: recipientWallet.Address()},
},
Features: iotago.BasicOutputFeatures{},
Expand Down Expand Up @@ -78,7 +78,7 @@ func (w *Wallet) CreateDelegationFromInput(transactionName string, inputName str
outputStates = append(outputStates, &iotago.BasicOutput{
Amount: input.BaseTokenAmount() - delegationOutput.Amount,
Mana: input.StoredMana(),
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{Address: w.Address()},
},
Features: iotago.BasicOutputFeatures{},
Expand Down Expand Up @@ -176,7 +176,7 @@ func (w *Wallet) DestroyAccount(transactionName string, inputName string, creati
destructionOutputs := iotago.Outputs[iotago.Output]{&iotago.BasicOutput{
Amount: input.BaseTokenAmount(),
Mana: input.StoredMana(),
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{Address: w.Address()},
},
Features: iotago.BasicOutputFeatures{},
Expand Down Expand Up @@ -207,7 +207,7 @@ func (w *Wallet) CreateImplicitAccountFromInput(transactionName string, inputNam
implicitAccountOutput := &iotago.BasicOutput{
Amount: MinIssuerAccountAmount,
Mana: AccountConversionManaCost,
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{Address: recipientWallet.ImplicitAccountCreationAddress()},
},
Features: iotago.BasicOutputFeatures{},
Expand All @@ -216,7 +216,7 @@ func (w *Wallet) CreateImplicitAccountFromInput(transactionName string, inputNam
remainderBasicOutput := &iotago.BasicOutput{
Amount: input.BaseTokenAmount() - MinIssuerAccountAmount,
Mana: input.StoredMana() - AccountConversionManaCost,
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{Address: input.Output().UnlockConditionSet().Address().Address},
},
Features: iotago.BasicOutputFeatures{},
Expand Down Expand Up @@ -305,7 +305,7 @@ func (w *Wallet) CreateBasicOutputsEquallyFromInputs(transactionName string, out
outputStates = append(outputStates, &iotago.BasicOutput{
Amount: tokenAmount,
Mana: manaAmount,
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{Address: w.Address()},
},
Features: iotago.BasicOutputFeatures{},
Expand Down
4 changes: 2 additions & 2 deletions pkg/testsuite/snapshotcreator/snapshotcreator.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func createOutput(address iotago.Address, tokenAmount iotago.BaseToken, mana iot
return &iotago.BasicOutput{
Amount: tokenAmount,
Mana: mana,
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{Address: address},
},
}
Expand All @@ -253,7 +253,7 @@ func createAccount(accountID iotago.AccountID, address iotago.Address, tokenAmou
Amount: tokenAmount,
Mana: mana,
AccountID: accountID,
Conditions: iotago.AccountOutputUnlockConditions{
UnlockConditions: iotago.AccountOutputUnlockConditions{
&iotago.AddressUnlockCondition{Address: address},
},
Features: iotago.AccountOutputFeatures{
Expand Down
12 changes: 6 additions & 6 deletions pkg/utils/rand.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func RandOutputOnAddressWithAmount(outputType iotago.OutputType, address iotago.
//nolint:forcetypeassert // we already checked the type
iotaOutput = &iotago.BasicOutput{
Amount: amount,
Conditions: iotago.BasicOutputUnlockConditions{
UnlockConditions: iotago.BasicOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address,
},
Expand All @@ -194,7 +194,7 @@ func RandOutputOnAddressWithAmount(outputType iotago.OutputType, address iotago.
iotaOutput = &iotago.AccountOutput{
Amount: amount,
AccountID: RandAccountID(),
Conditions: iotago.AccountOutputUnlockConditions{
UnlockConditions: iotago.AccountOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address,
},
Expand All @@ -208,7 +208,7 @@ func RandOutputOnAddressWithAmount(outputType iotago.OutputType, address iotago.
iotaOutput = &iotago.AnchorOutput{
Amount: amount,
AnchorID: RandAnchorID(),
Conditions: iotago.AnchorOutputUnlockConditions{
UnlockConditions: iotago.AnchorOutputUnlockConditions{
&iotago.StateControllerAddressUnlockCondition{
Address: address,
},
Expand Down Expand Up @@ -236,7 +236,7 @@ func RandOutputOnAddressWithAmount(outputType iotago.OutputType, address iotago.
MeltedTokens: new(big.Int).SetBytes([]byte{0}),
MaximumSupply: supply,
},
Conditions: iotago.FoundryOutputUnlockConditions{
UnlockConditions: iotago.FoundryOutputUnlockConditions{
&iotago.ImmutableAccountUnlockCondition{
Address: address.(*iotago.AccountAddress),
},
Expand All @@ -250,7 +250,7 @@ func RandOutputOnAddressWithAmount(outputType iotago.OutputType, address iotago.
iotaOutput = &iotago.NFTOutput{
Amount: amount,
NFTID: RandNFTID(),
Conditions: iotago.NFTOutputUnlockConditions{
UnlockConditions: iotago.NFTOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address,
},
Expand All @@ -268,7 +268,7 @@ func RandOutputOnAddressWithAmount(outputType iotago.OutputType, address iotago.
ValidatorAddress: tpkg.RandAccountAddress(),
StartEpoch: tpkg.RandEpoch(),
EndEpoch: iotago.MaxEpochIndex,
Conditions: iotago.DelegationOutputUnlockConditions{
UnlockConditions: iotago.DelegationOutputUnlockConditions{
&iotago.AddressUnlockCondition{
Address: address,
},
Expand Down

0 comments on commit 67b3465

Please sign in to comment.