-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(cosmwasm): save salt in config file #217
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -35,20 +35,21 @@ const uploadContract = async (client, wallet, config, options) => { | |||||
return client.upload(account.address, wasm, uploadFee).then(({ checksum, codeId }) => ({ checksum, codeId, account })); | ||||||
}) | ||||||
.then(({ account, checksum, codeId }) => { | ||||||
const usedSalt = salt || contractName.concat(chainNames); | ||||||
const address = instantiate2 | ||||||
? instantiate2Address( | ||||||
fromHex(checksum), | ||||||
account.address, | ||||||
fromHex(getSaltFromKey(salt || contractName.concat(chainNames))), | ||||||
fromHex(getSaltFromKey(usedSalt)), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the salt need to bytes32, or can it be a string? If the latter, then |
||||||
'axelar', | ||||||
) | ||||||
: null; | ||||||
|
||||||
return { codeId, address }; | ||||||
return { codeId, address, usedSalt }; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
}); | ||||||
}; | ||||||
|
||||||
const instantiateContract = (client, wallet, initMsg, config, { contractName, salt, instantiate2, chainNames, admin }) => { | ||||||
const instantiateContract = (client, wallet, initMsg, config, { contractName, instantiate2, admin }) => { | ||||||
return wallet | ||||||
.getAccounts() | ||||||
.then(([account]) => { | ||||||
|
@@ -63,7 +64,7 @@ const instantiateContract = (client, wallet, initMsg, config, { contractName, sa | |||||
? client.instantiate2( | ||||||
account.address, | ||||||
contractConfig.codeId, | ||||||
fromHex(getSaltFromKey(salt || contractName.concat(chainNames))), | ||||||
contractConfig.salt, | ||||||
initMsg, | ||||||
contractName, | ||||||
initFee, | ||||||
|
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.
to reuse
salt
name