Skip to content

Commit

Permalink
Merge pull request #444 from chain4travel/aeddaqqa/fix-register-node
Browse files Browse the repository at this point in the history
fix(validator): fix register node
  • Loading branch information
aeddaqqa authored Nov 18, 2024
2 parents 6de1235 + a1ca5b2 commit a918fe0
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 a918fe0

Please sign in to comment.