Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Cryp-153: Confidential asset creation #601
Conversation
| Portfolio::<T>::set_default_portfolio_balance(did, &ticker, total_supply); | ||
| } | ||
| <AssetOwnershipRelations>::insert(did, ticker, AssetOwnershipRelation::AssetOwned); | ||
| Self::deposit_event(RawEvent::AssetCreated( |
satyamakgec
Sep 15, 2020
Member
I think this also needs to be under if confidential condition.
I think this also needs to be under if confidential condition.
ParnianAlimi
Sep 15, 2020
Author
Good call.
Good call.
maxsam4
Sep 16, 2020
Member
@satyamakgec Why do you think so? There is nothing confidential in the event. Perhaps we can add a Confidential/Non-Confidential enum to the event but I see no reason to not emit an event here.
@satyamakgec Why do you think so? There is nothing confidential in the event. Perhaps we can add a Confidential/Non-Confidential enum to the event but I see no reason to not emit an event here.
maxsam4
Sep 16, 2020
Member
Ah, confidential lib is emitting a different event. I'd suggest that we use this event for both confidential and non-confidential assets with an enum differentiating between both.
Ah, confidential lib is emitting a different event. I'd suggest that we use this event for both confidential and non-confidential assets with an enum differentiating between both.
satyamakgec
Sep 16, 2020
Member
I did not want to emit that event to create a differentiation b/w confidential and non-confidential asset creation but if we choose the enum to represent the asset type then I think it makes sense and we can emit AssetCreated event in the creation of the confidential asset.
I did not want to emit that event to create a differentiation b/w confidential and non-confidential asset creation but if we choose the enum to represent the asset type then I think it makes sense and we can emit AssetCreated event in the creation of the confidential asset.
|
lgtm |
| Portfolio::<T>::set_default_portfolio_balance(did, &ticker, total_supply); | ||
| } | ||
| <AssetOwnershipRelations>::insert(did, ticker, AssetOwnershipRelation::AssetOwned); | ||
| if !is_confidential { |
satyamakgec
Sep 16, 2020
Member
You can make it in the same if as order of storage changes doesn't matter here.
<AssetOwnershipRelations>::insert(did, ticker, AssetOwnershipRelation::AssetOwned);
if !is_confidential {
<BalanceOf<T>>::insert(ticker, did, total_supply);
Portfolio::<T>::set_default_portfolio_balance(did, &ticker, total_supply);
Self::deposit_event(RawEvent::AssetCreated(
did,
ticker,
total_supply,
divisible,
asset_type,
did,
));
}
You can make it in the same if as order of storage changes doesn't matter here.
<AssetOwnershipRelations>::insert(did, ticker, AssetOwnershipRelation::AssetOwned);
if !is_confidential {
<BalanceOf<T>>::insert(ticker, did, total_supply);
Portfolio::<T>::set_default_portfolio_balance(did, &ticker, total_supply);
Self::deposit_event(RawEvent::AssetCreated(
did,
ticker,
total_supply,
divisible,
asset_type,
did,
));
}
|
Some minor comments. |
| @@ -0,0 +1,149 @@ | |||
| #![cfg_attr(not(feature = "std"), no_std)] | |||
|
|
|||
maxsam4
Sep 16, 2020
Member
Best to move these to ./primitives/src. All our types are defined there.
Best to move these to ./primitives/src. All our types are defined there.
| Portfolio::<T>::set_default_portfolio_balance(did, &ticker, total_supply); | ||
| } | ||
| <AssetOwnershipRelations>::insert(did, ticker, AssetOwnershipRelation::AssetOwned); | ||
| if !is_confidential { |
maxsam4
Sep 16, 2020
Member
I think the event should be emitted even for confidential assets.
I think the event should be emitted even for confidential assets.
|
I have to abandon this PR in favour of #623. This PR was changing the Settlement repo, which doesn't exist anymore. Other than that the content is identical. |
Implementation for registering confidential assets.