-
Notifications
You must be signed in to change notification settings - Fork 19
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
publish contract to object instead of account #120
Conversation
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.
Looks fine to me, but I have less context. What do you think @0xmaayan
const move = new cli.Move(); | ||
|
||
move | ||
.upgradeObjectPackage({ |
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.
this is duplicated with the publish script. can we somehow merge it? maybe for the publish command, call the upgrade command an then run a script to update the .env file?
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.
which part is duplicate? you mean the function parameter of createObjectAndPublishPackage
and upgradeObjectPackage
is the same?
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 mean the use of upgradeObjectPackage
in both publish and upgrade scripts
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.
upgradeObjectPackage
is only used in upgrade script, not in publish script
}, | ||
profile: process.env.VITE_APP_NETWORK, | ||
}) | ||
.then(console.log); |
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.
why we need to console log here?
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.
just to display the result of running cli, it will show
Code was successfully upgraded at object address 0x37ae9c36ac620f7cdaa4e835926a3a21ea1bb0ff7d407e87a06fc29b46d82693.
{
"Result": "Success"
}
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.
dont think we need it? it outputs any cli response to the console already
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.
removed
@@ -4,32 +4,55 @@ const yaml = require("js-yaml"); | |||
const cli = require("@aptos-labs/ts-sdk/dist/common/cli/index.js"); | |||
|
|||
const config = yaml.load(fs.readFileSync("./.aptos/config.yaml", "utf8")); | |||
const accountAddress = | |||
config["profiles"][process.env.VITE_APP_NETWORK]["account"]; | |||
const accountAddress = config["profiles"][process.env.VITE_APP_NETWORK]["account"]; |
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.
this needs to be changed, look at #122
d3b878d
to
298411a
Compare
af9f92a
to
c39d11a
Compare
some context aptos-labs/aptos-developer-discussions#279
New publishing UX becomes
npm run move:publish
to publish contract to an object.npm run move:upgrade
to upgrade and keep the same contract addressnpm run move:publish
to publish contract to a new object.