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.
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 schedule_as into TaskScheduled event #365
Add schedule_as into TaskScheduled event #365
Changes from all commits
edc25f7
c8ae6c1
5f75496
e841538
1ce9c2c
6ff5f4d
f271544
d380f8b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We need to include more tests around this function. For example,
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.
1. schedule through an empty wallet address(empty string).
The AccountId32::new(bytes) method requires a byte array parameter with 32 elements. An empty wallet address cannot be used to construct an AccountId32 variable.
2. schedule through an invalid Turing wallet address.
The code within the automation time pallet does not perform validation checks on the account addresses.
Account address validation is a feature provided by the Substrate framework, which verifies the checksum of user addresses during actual runtime. I haven't verified this aspect yet.
However, in functional testing, incorrect account addresses will not result in an error.
schedule_as
is aAccountId
type parameter.If you create an scheduleXcmpTaskThroughProxy extrinsic with polkadot.js API on Turing chain with other ss58 prefix address, polkadot.js API will convert it to a Turing address.
YFbVAJHJbn5sH523f3o6iLeropaD5CREtocrkPaGVzpJ5iz
will be converted to68TwNoCpyz1X3ygMi9WtUAaCb8Q6jWAMvAHfAByRZqMFEtJG
If the conversion fails, an error will be thrown:
4. schedule with an invalid multi-location
5. schedule with a non-existent multi-location
The automation time pallet does not check on whether
destination
parameter is a valid MultiLocation, as that responsibility lies within the XCM module.Alternatively, end-to-end (E2E) tests can be done to verify it.
The automation-time pallet does not check
xcm_asset_location
parameter.Because the calculation logic of XCM instruction fee is in the xcmp-handler pallet.
In the mock implementation, we do not provide real functionality.
https://github.com/OAK-Foundation/OAK-blockchain/blob/67b4f7f5976d58dd35b080cf325eb01dff4921a7/pallets/automation-time/src/mock.rs#L285C33-L285C47
6. Could verify that the task can execute with a correct proxy?
The
MockEnsureProxy
is only used for automation-time testing purposes. However, it is not a fully functional proxy module in a real sense.https://github.com/OAK-Foundation/OAK-blockchain/blob/e8415385756db9daf29cf12cb2ae49e2772d4c7d/pallets/automation-time/src/mock.rs#L352
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.
xcm_asset_location
for destination doesn’t cause error on our XcmMessageSent, but causing one on relay chain instead. Therefore, we can’t test the validity in our chain’s code.