Skip to content

Conversation

@sinev-valentine
Copy link
Contributor

@sinev-valentine sinev-valentine commented Sep 3, 2021

When cancel operation is processed it is need to transfer all used gas to operator

Dependency: neonlabsorg/proxy-model.py#178

@sinev-valentine sinev-valentine changed the title impl burning of gas, add caller_token to AccountMeta of Cancel operation WIP: impl burning of gas, add caller_token to AccountMeta of Cancel operation Sep 3, 2021
@sinev-valentine sinev-valentine changed the title WIP: impl burning of gas, add caller_token to AccountMeta of Cancel operation impl burning of gas, add caller_token to AccountMeta of Cancel operation Sep 3, 2021
let fee = U256::from(used_gas)
.checked_mul(gas_price_wei).ok_or_else(||E!(ProgramError::InvalidArgument))?;

let (caller_info, caller_token_info) = account_storage.get_caller_account_info().ok_or_else(||E!(ProgramError::InvalidArgument))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why user token is being getting here, but not mentioned in accounts like in Continue or CallFromRawEthereumTX

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

let AccountMeta{ account, token: _, code: _ } = &self.account_metas[account_index];
return Some(account);
let AccountMeta{ account, token, code: _ } = &self.account_metas[account_index];
return Some((account, token));
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need token account to be returned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

token was removed

@otselnik
Copy link
Contributor

Caller token for payment for transaction should be passed in first part of accounts list, and there is no need for returning token account in get_caller_account_info.
Or all instructions, like Continue and CallFromRawEthereumTX should be rebuilt to use token account from get_caller_account_info.

@sinev-valentine sinev-valentine self-assigned this Sep 20, 2021
s-medvedev
s-medvedev previously approved these changes Sep 20, 2021
@s-medvedev s-medvedev merged commit 3a3ca99 into develop Sep 24, 2021
@s-medvedev s-medvedev deleted the 180_burn_gas_during_cancel branch September 24, 2021 12:43
arkadyone pushed a commit to arkadyone/neon-evm that referenced this pull request Nov 25, 2022
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.

4 participants