Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to add Account support #435

Merged
merged 72 commits into from
Jun 20, 2023
Merged

Conversation

piotrm50
Copy link
Contributor

Description of change

This PR introduces a large number of changes that add support for using AccountOutput in a transaction, in place of AliasOutput.
It also extends VM to support Transaction validation when creating, destroying or modifying an AccountOutput.

Type of change

Choose a type of change, and delete any options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How the change has been tested

Implemented unit tests.
This code is also used in iota-core software which uses it in it's own test cases.

Make sure to provide instructions for the maintainer as well as any relevant configurations.

Change checklist

Add an x to the boxes that are relevant to your changes, and delete any items that are not.

  • My code follows the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests using ginkgo that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

cyberphysic4l and others added 30 commits May 9, 2023 08:19
The field must be second last with the nonce being last
in order for the `contentHashFromBlockBytes` to work correctly.

Also make the calculation of `SlotIdentifierLength` slightly more clear
by using the size of a `uint64` rather than `int64`.
@karimodm karimodm marked this pull request as ready for review June 20, 2023 09:13
@@ -99,6 +101,12 @@ type ProtocolParameters struct {
GenesisUnixTimestamp uint32 `serix:"6,mapKey=genesisUnixTimestamp"`
// SlotDurationInSeconds defines the duration of each slot in seconds.
SlotDurationInSeconds uint8 `serix:"7,mapKey=slotDurationInSeconds"`
// ManaGenerationRate is the amount of potential Mana generated by 1 IOTA in 1 slot.
ManaGenerationRate uint8 //`serix:"8,mapKey=manaGenerationRate"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the serix tags commented out?

@@ -47,6 +47,8 @@ func LatestAPI(protoParams *ProtocolParameters) API {
}

// calls the internally instantiated API to encode the given object.
//
//nolint:unparam
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why unparam here?

@@ -86,8 +86,9 @@ func TestProtocolParametersJSONMarshalling(t *testing.T) {
TokenSupply: 1234567890987654321,
GenesisUnixTimestamp: 1681373293,
SlotDurationInSeconds: 10,
MaxCommitableAge: 10,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the new mana values to this test

bic.go Outdated Show resolved Hide resolved
chain.go Outdated Show resolved Hide resolved
}

func (s *BlockIssuerFeature) VBytes(rentStruct *RentStructure, _ VBytesFunc) VBytes {
// TODO: add factor for block issuer keys (higher than regular keys factor).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about this TODO?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

input.go Outdated Show resolved Hide resolved
output.go Outdated Show resolved Hide resolved
@@ -403,6 +432,22 @@ func ExecFuncSenderUnlocked() ExecFunc {
}
}

// ExecFuncBalancedMana validates that Mana is balanced from the input/output side.
// TODO: Return Mana according to StorageDepositReturnUnlockCondition(s)?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about the TODO?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mana_decay_provider.go Outdated Show resolved Hide resolved
mana_decay_provider.go Outdated Show resolved Hide resolved
@alexsporn alexsporn force-pushed the serix-iota-core-accounts branch from 5251c62 to 537f7d9 Compare June 20, 2023 12:55
@alexsporn alexsporn force-pushed the serix-iota-core-accounts branch from 537f7d9 to a483caf Compare June 20, 2023 12:56
@alexsporn alexsporn force-pushed the serix-iota-core-accounts branch from a09f9d7 to 2e18e83 Compare June 20, 2023 13:14
@cyberphysic4l cyberphysic4l force-pushed the serix-iota-core-accounts branch from 7527feb to 328934f Compare June 20, 2023 13:58
@alexsporn alexsporn merged commit 034aed0 into serix-iota-core Jun 20, 2023
@alexsporn alexsporn deleted the serix-iota-core-accounts branch June 20, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants