Object Code Deployment - Writing Move Unit tests #227
Unanswered
kshitijc1506
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Discord user ID
kc1506
Describe your question in detail.
Context
I'm using object code deployment. In essence, we deploy our packages to an object instead of a regular account or resource account. The owner of the "code object" has the ability to upgrade the modules in the package.
I'm writing a rewards module, in which I have a function
transfer_admin_role
.I want to write unit tests for this function. In particular, I want to simulate publishing the package, using the event emitted obtain the address of the object. And then convert that address to an instance of the code object and pass that through the
transfer_admin_role
function in my unit test. Here's some incomplete code to help understand:My Questions
object_code_deployment::publish
function.vector<vector<u8>>
? Is there any recommended way to do this?I don't know if this should be prepared on-chain (most likely not), but I'm not sure how else to test the function.
What error, if any, are you getting?
No response
What have you tried or looked at? Or how can we reproduce the error?
N/A
Which operating system are you using?
macOS
Which SDK or tool are you using? (if any)
N/A
Describe your environment or tooling in detail
Visual Studio Code
Beta Was this translation helpful? Give feedback.
All reactions