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

Buy/Sell RAM Notifications and Logging #103

Conversation

DenisCarriere
Copy link
Contributor

@DenisCarriere DenisCarriere commented Jan 6, 2024

Change Description

Add buy RAM logging by including additional inline actions and notifications via the use of require_recipient.

bytes & quant are computed values based on Bancor algorithm market.

This allows payer or receiver to confirm exact bytes sent/received via notifications.

API Changes

  • Add require_recipient(receiver) on buyram & buyrambytes actions

ACTION: logbuyram

/**
 * Logging for buyram & buyrambytes action
 *
 * @param payer - the ram buyer,
 * @param receiver - the ram receiver,
 * @param quantity - the quantity of tokens to buy ram with.
 * @param bytes - the quantity of ram to buy specified in bytes.
 * @param ram_bytes - the ram bytes held by receiver after the action.
 */
[[eosio::action]]
void logbuyram( const name& payer, const name& receiver, const asset& quantity, int64_t bytes, int64_t ram_bytes );

🚧 Feedback

  • add logsellram ACTION
  • ACTION return value of new_bytes

@DenisCarriere DenisCarriere changed the title RAM Notifications and Logging Buy RAM Notifications and Logging Jan 6, 2024
@DenisCarriere DenisCarriere changed the title Buy RAM Notifications and Logging Buy/Sell RAM Notifications and Logging Jan 9, 2024
@DenisCarriere DenisCarriere marked this pull request as draft January 9, 2024 04:09
@DenisCarriere
Copy link
Contributor Author

confirm logging using buy_bytes_out

@DenisCarriere DenisCarriere marked this pull request as ready for review January 9, 2024 22:55
@ericpassmore ericpassmore self-requested a review January 10, 2024 00:05
@ericpassmore ericpassmore changed the base branch from main to ram_actions January 12, 2024 17:41
@ericpassmore
Copy link
Contributor

Changed to merge into branch ram_actions. Need to keep in sync with antlerIO/reference_contracts. That repo is also being updated with faster finality changes. Having the changes on a branch, and then merging in main will make it easier to manage these two separate workstreams.

Copy link
Contributor

@ericpassmore ericpassmore left a comment

Choose a reason for hiding this comment

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

Approving, to merge into ram_actions branch. Test coverage covered in other PRs, and test coverage will be reviewed and verified before integration into main branch.


// logging
system_contract::logbuyram_action logbuyram_act{ get_self(), { {get_self(), active_permission} } };
logbuyram_act.send( payer, receiver, quant, bytes_out, res_itr->ram_bytes );
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth testing this? Pushing the top level action and then checking for the inline actions executed?


// logging
system_contract::logsellram_action logsellram_act{ get_self(), { {get_self(), active_permission} } };
logsellram_act.send( account, tokens_out, bytes, res_itr->ram_bytes );
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth testing this? Pushing the top level action and then checking for the inline actions executed?

@ericpassmore ericpassmore merged commit 4d51a17 into eosnetworkfoundation:ram_actions Jan 16, 2024
1 check passed
ericpassmore pushed a commit that referenced this pull request Aug 9, 2024
Split system tests so that they can run in parallel
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