Skip to content

Commit

Permalink
fix(claim): fix claim validator rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
aeddaqqa committed Nov 19, 2024
1 parent a918fe0 commit 1bab987
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/helpers/wallet_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,6 @@ class WalletHelper {

//signerAddresses = arrSigner.concat(signerAddresses)

const changeAddress = activeWallet.getChangeAddressPlatform()

const threshold =
activeWallet.type === 'multisig'
? (activeWallet as MultisigWallet)?.keyData?.owner?.threshold
Expand All @@ -518,7 +516,7 @@ class WalletHelper {
//@ts-ignore
utxoSet,
[[rewardOwnerAddress], signerAddresses],
[changeAddress],
[],
undefined, // memo
new BN(0), //as Of
Number(threshold),
Expand Down Expand Up @@ -563,9 +561,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 claimAmountParam = {
claimType: claimValidator
? ClaimType.VALIDATOR_REWARD
Expand All @@ -585,7 +580,7 @@ class WalletHelper {
.buildClaimTx(
wallet.platformUtxoset,
[pAddressStrings, signerAddresses],
[changeAddress],
[],
Buffer.alloc(0),
ZeroBN,
1,
Expand Down Expand Up @@ -621,7 +616,6 @@ class WalletHelper {
'P'
)

const changeAddress = wallet.getChangeAddressPlatform()
const depositCreator = pAddressStrings[0]
const depositCreatorAuth: [number, string | Buffer][] = [[0, depositCreator]]
const unsignedTx = await ava
Expand All @@ -630,7 +624,7 @@ class WalletHelper {
restrictedOffer ? 1 : 0,
wallet.platformUtxoset,
[pAddressStrings, signerAddresses],
[changeAddress],
[],
depositID,
depositDuration,
new OutputOwners([depositOwnerAddress], ZeroBN, 1),
Expand All @@ -656,7 +650,6 @@ class WalletHelper {
static async buildAddDepositOfferTx(wallet: WalletType, offer: DepositOffer) {
const pAddressStrings = wallet.getAllAddressesP()
const signerAddresses = wallet.getSignerAddresses('P')
const changeAddress = wallet.getChangeAddressPlatform()

const creatorAddress = pAddressStrings[0]
const creatorAuth: [number, Buffer | string][] = [[0, pAddressStrings[0]]]
Expand All @@ -666,7 +659,7 @@ class WalletHelper {
.buildAddDepositOfferTx(
wallet.platformUtxoset,
[pAddressStrings, signerAddresses],
[changeAddress],
[],
offer,
creatorAddress,
creatorAuth,
Expand Down

0 comments on commit 1bab987

Please sign in to comment.