-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix token properties and nesting weights #1007
Conversation
pallets/refungible/src/common.rs
Outdated
<SelfWeightOf<T>>::set_token_properties(amount) | ||
write_token_properties_total_weight::<T, _>([amount].into_iter(), |amount| { | ||
<SelfWeightOf<T>>::load_token_properties() | ||
+ <PalletStructure<T>>::find_parent_weight(MAX_NESTING_BUDGET) |
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.
Так делать некорректно, поскольку в common интерфейсы нам попадает уже budget, так было бы правильно если бы мы его тут (в common интерфейсе) конструировали
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.
Возможно имеет смысл бюджет сделать generic, чтобы было более понятно какие веса нужно для каких бюджетов использовать, и чтобы нельзя было его использовать не в тех местах?
enum NestingKind {}
dyn Budget<NestingKind>
И будет по коду логично что у нас для инициализации Budget<NestingKind>
нужно в weight забрать nesting_weight(N)
b270b77
to
85147ac
Compare
87f24e8
to
2ba6495
Compare
chore: temporary bench common/nft/rft fix: std features for up-common refactor: account nesting_budget in common weights chore: revert nesting_budget logic fix: nesting_budget weight
2d2a945
to
a46c1bd
Compare
@@ -158,6 +130,16 @@ impl<T: Config> CommonWeightInfo<T::CrossAccountId> for CommonWeights<T> { | |||
} | |||
} | |||
|
|||
pub(crate) fn mint_with_props_weight<T: Config>( |
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.
Может вообще заинлайнить этот метод?) В nonfungible тоже
pallets/refungible/src/erc.rs
Outdated
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.
Кажется мне что для эфира будет читабельнее вместо CommonWeights везде использовать газомер...
Но допустим пока так.
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.
Минтинг refungible намного лучше выглядел бы через бюджеты
No description provided.