Skip to content

Commit

Permalink
Merge pull request #445 from chain4travel/suite
Browse files Browse the repository at this point in the history
Fix: Adjust buildRegisterNode Parameters and Resolve Restricted Offers Issue with Multisig Wallets
  • Loading branch information
aeddaqqa authored Nov 18, 2024
2 parents f32e660 + a918fe0 commit 2927d1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
10 changes: 8 additions & 2 deletions src/components/wallet/earn/CreateOfferForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,8 @@ export default class CreateOfferForm extends Vue {
/* methods */
async submitCreateOffer() {
if (!this.isRestricted) this.offer.ownerAddress = undefined
if (!this.isRestricted || this.wallet.type === 'multisig')
this.offer.ownerAddress = undefined
else this.offer.ownerAddress = this.wallet?.getStaticAddress('P')
this.txState = TxState.started
const wallet: WalletType = this.$store.state.activeWallet
Expand All @@ -793,7 +794,12 @@ export default class CreateOfferForm extends Vue {
try {
const result = await WalletHelper.buildAddDepositOfferTx(wallet, offer)
this.txState = TxState.waiting
this.waitTxConfirm(result, addresses, this.offer.start.toNumber(), this.isRestricted)
this.waitTxConfirm(
result,
addresses,
this.offer.start.toNumber(),
this.wallet.type === 'multisig' ? false : this.isRestricted
)
} catch (error) {
if (error instanceof SignatureError) {
await this.$store.dispatch('Signavault/updateTransaction')
Expand Down
9 changes: 2 additions & 7 deletions src/helpers/wallet_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,6 @@ class WalletHelper {

const signerAddresses = wallet.getSignerAddresses('P')

// For change address use first available on the platform chain
const changeAddress = wallet.getChangeAddressPlatform()
const consortiumMemberAuthCredentials: [number, Buffer | string][] = [
[0, pAddressStrings[0]],
]
Expand All @@ -290,7 +288,7 @@ class WalletHelper {
const unsignedTx = await ava.PChain().buildRegisterNodeTx(
utxoSet,
[pAddressStrings, signerAddresses], // from + possible signers
[changeAddress], // change
[], // change
oldNodeID,
newNodeID,
address,
Expand Down Expand Up @@ -368,9 +366,6 @@ class WalletHelper {
const pAddressStrings = wallet.getAllAddressesP()
const signerAddresses = wallet.getSignerAddresses('P')

// For change address use first available on the platform chain
const changeAddress = wallet.getChangeAddressPlatform()

const threshold =
wallet.type === 'multisig' ? (wallet as MultisigWallet)?.keyData?.owner?.threshold : 1

Expand All @@ -379,7 +374,7 @@ class WalletHelper {
amount,
[toAddress],
[pAddressStrings, signerAddresses], // from + possible signers
[changeAddress], // change
[], // change
memo,
undefined, // asOf
undefined, // lockTime
Expand Down

0 comments on commit 2927d1c

Please sign in to comment.