-
Notifications
You must be signed in to change notification settings - Fork 276
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
[feature] #3941, #3612: Remove expressions #4089
Merged
Arjentix
merged 1 commit into
hyperledger-iroha:iroha2-dev
from
Arjentix:executor_expressions
Dec 14, 2023
Merged
[feature] #3941, #3612: Remove expressions #4089
Arjentix
merged 1 commit into
hyperledger-iroha:iroha2-dev
from
Arjentix:executor_expressions
Dec 14, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Arjentix
added
Enhancement
New feature or request
iroha2-dev
The re-implementation of a BFT hyperledger in RUST
labels
Nov 27, 2023
Arjentix
requested review from
s8sato,
mversic,
SamHSmith,
QuentinI,
outoftardis,
ilchu,
pesterev,
Erigara,
0x009922 and
DCNick3
as code owners
November 27, 2023 23:11
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
data_model/src/isi.rs
Outdated
Comment on lines
796
to
767
/// Constructs a new [`BurnBox`] to burn [`Asset`] of [`Quantity`] type. | ||
pub fn asset_quantity(quantity: u32, asset_id: <Asset as Identifiable>::Id) -> Self { | ||
Self::Asset(AssetBurnBox::Quantity(Burn::new(quantity, asset_id))) | ||
} | ||
|
||
/// Constructs a new [`BurnBox`] to burn [`Asset`] of [`BigQuantity`] type. | ||
pub fn asset_big_quantity(quantity: u128, asset_id: <Asset as Identifiable>::Id) -> Self { | ||
Self::Asset(AssetBurnBox::BigQuantity(Burn::new(quantity, asset_id))) | ||
} | ||
|
||
/// Constructs a new [`BurnBox`] to burn [`Asset`] of [`Fixed`] type. | ||
pub fn asset_fixed(quantity: Fixed, asset_id: <Asset as Identifiable>::Id) -> Self { | ||
Self::Asset(AssetBurnBox::Fixed(Burn::new(quantity, asset_id))) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is how I would prefer doing it:
Suggested change
/// Constructs a new [`BurnBox`] to burn [`Asset`] of [`Quantity`] type. | |
pub fn asset_quantity(quantity: u32, asset_id: <Asset as Identifiable>::Id) -> Self { | |
Self::Asset(AssetBurnBox::Quantity(Burn::new(quantity, asset_id))) | |
} | |
/// Constructs a new [`BurnBox`] to burn [`Asset`] of [`BigQuantity`] type. | |
pub fn asset_big_quantity(quantity: u128, asset_id: <Asset as Identifiable>::Id) -> Self { | |
Self::Asset(AssetBurnBox::BigQuantity(Burn::new(quantity, asset_id))) | |
} | |
/// Constructs a new [`BurnBox`] to burn [`Asset`] of [`Fixed`] type. | |
pub fn asset_fixed(quantity: Fixed, asset_id: <Asset as Identifiable>::Id) -> Self { | |
Self::Asset(AssetBurnBox::Fixed(Burn::new(quantity, asset_id))) | |
} | |
/// Constructs a new [`BurnBox`] to burn [`Asset`] | |
pub fn asset(quantity: impl Into<AssetValue>, asset_id: AssetId) -> Self { | |
match quantity.into() { | |
AssetType::Quantity(quantity) => Self::Asset(AssetBurnBox::Quantity(Burn::new(quantity, asset_id))), | |
AssetType::BigQuantity(quantity) => Self::Asset(AssetBurnBox::Quantity(Burn::new(quantity, asset_id))), | |
AssetType::Fixed(quantity) => Self::Asset(AssetBurnBox::Quantity(Burn::new(quantity, asset_id))), | |
} | |
} |
I think this makes a better API but I see we might not be able to do it because of AssetValue::Store
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Nov 28, 2023
mversic
reviewed
Dec 6, 2023
mversic
requested changes
Dec 6, 2023
mversic
changed the title
[feature] #3941: Remove expressions
[feature] #3941, #3612: Remove expressions
Dec 6, 2023
This was referenced Dec 7, 2023
Arjentix
force-pushed
the
executor_expressions
branch
from
December 10, 2023 23:57
b08ec9c
to
e0036f0
Compare
mversic
reviewed
Dec 11, 2023
mversic
reviewed
Dec 11, 2023
mversic
reviewed
Dec 12, 2023
6 tasks
Arjentix
force-pushed
the
executor_expressions
branch
2 times, most recently
from
December 12, 2023 08:01
39703b1
to
e1de609
Compare
mversic
previously approved these changes
Dec 13, 2023
Arjentix
force-pushed
the
executor_expressions
branch
from
December 13, 2023 18:05
e1de609
to
efdcc4e
Compare
mversic
previously approved these changes
Dec 13, 2023
Erigara
previously approved these changes
Dec 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…essions Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Arjentix
force-pushed
the
executor_expressions
branch
from
December 14, 2023 08:32
efdcc4e
to
2dc4c02
Compare
mversic
approved these changes
Dec 14, 2023
Erigara
approved these changes
Dec 14, 2023
Asem-Abdelhady
pushed a commit
to Asem-Abdelhady/iroha
that referenced
this pull request
Jan 9, 2024
…essions (hyperledger-iroha#4089) Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Asem-Abdelhady
pushed a commit
to Asem-Abdelhady/iroha
that referenced
this pull request
Jan 22, 2024
…essions (hyperledger-iroha#4089) Signed-off-by: Daniil Polyakov <arjentix@gmail.com> Signed-off-by: Asem-Abdelhady <asemshawkey@gmail.com>
Asem-Abdelhady
pushed a commit
to Asem-Abdelhady/iroha
that referenced
this pull request
Feb 9, 2024
…essions (hyperledger-iroha#4089) Signed-off-by: Daniil Polyakov <arjentix@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The main idea was to move all expressions into executor. After a discussion with @mversic we decided not to implement any of them inside
default_executor
, but to have an example executor to show PoC.#[model]
together withffi
have become useless for data_model because in future clients should link against executor_data_model. So I partly removed them. This might need future investigationI wii squash all my commits before merge.
Linked issue
Benefits
Follow up tasks
Checklist
CONTRIBUTING.md