Skip to content

Commit

Permalink
[FEATURE] Polkadot network upgrade: sunset of stash/controller feature (
Browse files Browse the repository at this point in the history
#5462)

* remove controller from the calls in our Polkadot integration

* add changeset
  • Loading branch information
chabroA authored Nov 28, 2023
1 parent 2a543de commit cf41c53
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/gentle-tips-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/coin-polkadot": minor
---

Polkadot network upgrade: sunset of stash/controller feature
15 changes: 1 addition & 14 deletions libs/coin-polkadot/src/deviceTransactionConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function getDeviceTransactionConfig({
transaction: Transaction;
status: TransactionStatus;
}): Array<DeviceTransactionField> {
const { mode, recipient, rewardDestination } = transaction;
const { mode, rewardDestination } = transaction;
const { amount } = status;
const mainAccount = getMainAccount(account, parentAccount) as PolkadotAccount;
let fields: { type: string; label: string; value?: string }[] = [];
Expand Down Expand Up @@ -81,11 +81,6 @@ function getDeviceTransactionConfig({
label: "Staking",
value: "Bond",
});
fields.push({
type: "text",
label: "Controller",
value: recipient,
});
fields.push({
type: "text",
label: "Amount",
Expand Down Expand Up @@ -171,14 +166,6 @@ function getDeviceTransactionConfig({
label: "Staking",
value: "Set controller",
});
fields.push({
type: "text",
label: "Controller",
value:
// NOTE: I added this here as TokenAccount and ChildAccount
// both don't have freshAddress
account.type === "Account" ? account.freshAddress : mainAccount.freshAddress,
});
break;

case "claimReward":
Expand Down
4 changes: 1 addition & 3 deletions libs/coin-polkadot/src/js-buildTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ const getExtrinsicParams = (a: PolkadotAccount, t: Transaction): ExtrinsicParams
pallet: "staking",
name: "bond",
args: {
// Spec choice: we always set the account as both the stash and its controller
controller: a.freshAddress,
value: t.amount.toString(),
// The rewards destination. Can be "Stash", "Staked", "Controller" or "{ Account: accountId }"".
payee: t.rewardDestination || "Stash",
Expand Down Expand Up @@ -93,7 +91,7 @@ const getExtrinsicParams = (a: PolkadotAccount, t: Transaction): ExtrinsicParams
return {
pallet: "staking",
name: "setController",
args: { controller: a.freshAddress },
args: {},
};

case "nominate":
Expand Down

1 comment on commit cf41c53

@vercel
Copy link

@vercel vercel bot commented on cf41c53 Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.