-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add dummy precompile hook with rust and typescript tests #478
Conversation
Coverage Report@@ Coverage Diff @@
## master add-dummy-precompile +/- ##
=======================================================
Coverage 64.77% 64.77% 0.00%
Files 66 66
Lines 9775 9775
=======================================================
Hits 6331 6331
Misses 3444 3444
|
test/suites/dev-frontier-template/test-eth-asset-address/test-eth-asset-address-creation.ts
Outdated
Show resolved
Hide resolved
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.
Small comments, but otherwise looks good!
@@ -439,3 +469,17 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter< | |||
/// Multiplier used for dedicated `TakeFirstAssetTrader` with `ForeignAssets` instance. | |||
pub type AssetRateAsMultiplier = | |||
AssetFeeAsExistentialDepositMultiplier<Runtime, WeightToFee, AssetRate, ForeignAssetsInstance>; | |||
|
|||
#[test] | |||
fn test_asset_id_to_account_conversion() { |
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.
I think we don't need this test
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.
Currently asset_id_to_account
takes prefix
as slice, instead of hard bound array. Then it does invoke copy_from_slice
, which can panic, if the slice's size is not exact.
If the implementation changes tomorrow (i.e the expected size of the slice in the implementation), it need to be captured by the unit test (otherwise you would see panic during integration test or worse in dev environment). Which this test prevents.
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.
Let's discuss this offline. I am merging this as it is not blocker as of now.
Description
Follow up PR for Moonsong-Labs/moonkit#32
This PR utilizes the hooks introduced in above PR and adds revert bytecode at the evm account derived from the asset id specified in the hook invocation. It also has rust unit test and typescript integration test.