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

#272 manage starage and holder accounts #274

Merged
merged 13 commits into from
Nov 12, 2021

Conversation

otselnik
Copy link
Contributor

@otselnik otselnik commented Nov 9, 2021

Changes:

  • added new_acc_id_glob and acc_list_glob global variables for acquiring or creating storage and holder accounts.
  • moved PermanentAccounts creation prior iterative transaction execution.
  • collateral pool index calculated from transaction hash and stored in TransactionInfo structure.
  • moved eth_trx to TransactionInfo structure.
  • operator and operators token addresses are calculated in place.
  • disabled combined transactions

Storage/Holder accounts distribution and acquiring:

  • new_acc_id_glob is used for generating new addresses.
  • acc_list_glob is used to store previously generated addresses that are not already in use.
  • if an id already exists in acc_list_glob, it is taken from there. otherwise id got from incremented new_acc_id_glob.
  • address is generated using id.
  • account of address checked on existence, owner, emptiness, and size through lamports(implying bigger size requires more lamports)
  • if problems are found new id is taken.

@otselnik otselnik changed the title 272 create and delete for transaction #272 create and delete for transaction Nov 11, 2021
@otselnik otselnik marked this pull request as ready for review November 11, 2021 21:13
@otselnik otselnik self-assigned this Nov 11, 2021
@otselnik otselnik changed the title #272 create and delete for transaction #272 manage starage and holder accounts Nov 12, 2021
}
}

result = client._provider.make_request("getAccountInfo", str(storage_account), opts)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why you don't use client.get_account_info implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It returns full accounts data, wich is massive


data = base64.b64decode(info['data'][0])

empty = True if data[0] == 0 else False
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest returning the type of account (instead of the empty flag) here.
Rationale: we will change the Storage account logic and empty storage will be in two cases Empty and FinalizedStorage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@s-medvedev s-medvedev merged commit a8eab63 into develop Nov 12, 2021
@s-medvedev s-medvedev deleted the 272_create_and_delete_for_transaction branch November 12, 2021 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants