Skip to content

Commit 7f7ce27

Browse files
authored
chore(backend): remove get_proposal_payload canister endpoint (#7752)
# Motivation The frontend no longer calls `get_proposal_payload` after switching to `selfDescribingAction` in #7742. This is the first step toward removing the `proposals` crate entirely. # Changes - Removed the `get_proposal_payload` update endpoint from the backend canister. - Removed the `proposals` crate dependency from the backend `Cargo.toml`. - Removed `GetProposalPayloadResponse` type and `get_proposal_payload` method from the Candid interface (backend and frontend copies). - Removed the `get_proposal_payload` entry from canister export lists (production and test). - Removed the `test-proposal-payload` script and its CI step in the build workflow.
1 parent 74cd3d5 commit 7f7ce27

12 files changed

Lines changed: 0 additions & 350 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ jobs:
213213
pushd snsdemo
214214
bin/dfx-sns-demo-install
215215
popd
216-
- name: Test getting proposal payloads
217-
run: scripts/nns-dapp/test-proposal-payload
218216
- name: Install tools
219217
run: |
220218
# libarchive-zip-perl is needed for crc32, used by test-cmc-notify.

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src/lib/canisters/nns-dapp/nns-dapp.certified.idl.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ export const idlFactory = ({ IDL }) => {
6969
});
7070
const BlockHeight = IDL.Nat64;
7171
const NeuronId = IDL.Nat64;
72-
const GetProposalPayloadResponse = IDL.Variant({
73-
Ok: IDL.Text,
74-
Err: IDL.Text,
75-
});
7672
const Stats = IDL.Record({
7773
seconds_since_last_ledger_sync: IDL.Nat64,
7874
sub_accounts_count: IDL.Nat64,
@@ -185,11 +181,6 @@ export const idlFactory = ({ IDL }) => {
185181
get_canisters: IDL.Func([], [IDL.Vec(CanisterDetails)], []),
186182
get_fav_projects: IDL.Func([], [GetFavProjectsResponse], []),
187183
get_imported_tokens: IDL.Func([], [GetImportedTokensResponse], []),
188-
get_proposal_payload: IDL.Func(
189-
[IDL.Nat64],
190-
[GetProposalPayloadResponse],
191-
[]
192-
),
193184
get_stats: IDL.Func([], [Stats], []),
194185
http_request: IDL.Func([HttpRequest], [HttpResponse], []),
195186
register_hardware_wallet: IDL.Func(

frontend/src/lib/canisters/nns-dapp/nns-dapp.did

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ type DetachCanisterResponse =
123123
CanisterNotFound;
124124
};
125125

126-
type GetProposalPayloadResponse =
127-
variant {
128-
Ok: text;
129-
Err: text;
130-
};
131-
132126
type Stats =
133127
record {
134128
accounts_count: nat64;
@@ -194,7 +188,6 @@ service : {
194188
detach_canister: (DetachCanisterRequest) -> (DetachCanisterResponse);
195189
set_imported_tokens: (ImportedTokens) -> (SetImportedTokensResponse);
196190
get_imported_tokens: () -> (GetImportedTokensResponse) query;
197-
get_proposal_payload: (nat64) -> (GetProposalPayloadResponse);
198191
get_stats: () -> (Stats) query;
199192

200193
http_request: (request: HttpRequest) -> (HttpResponse) query;

frontend/src/lib/canisters/nns-dapp/nns-dapp.idl.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ export const idlFactory = ({ IDL }) => {
6969
});
7070
const BlockHeight = IDL.Nat64;
7171
const NeuronId = IDL.Nat64;
72-
const GetProposalPayloadResponse = IDL.Variant({
73-
Ok: IDL.Text,
74-
Err: IDL.Text,
75-
});
7672
const Stats = IDL.Record({
7773
seconds_since_last_ledger_sync: IDL.Nat64,
7874
sub_accounts_count: IDL.Nat64,
@@ -185,11 +181,6 @@ export const idlFactory = ({ IDL }) => {
185181
get_canisters: IDL.Func([], [IDL.Vec(CanisterDetails)], ["query"]),
186182
get_fav_projects: IDL.Func([], [GetFavProjectsResponse], ["query"]),
187183
get_imported_tokens: IDL.Func([], [GetImportedTokensResponse], ["query"]),
188-
get_proposal_payload: IDL.Func(
189-
[IDL.Nat64],
190-
[GetProposalPayloadResponse],
191-
[]
192-
),
193184
get_stats: IDL.Func([], [Stats], ["query"]),
194185
http_request: IDL.Func([HttpRequest], [HttpResponse], ["query"]),
195186
register_hardware_wallet: IDL.Func(

frontend/src/lib/canisters/nns-dapp/nns-dapp.types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export type GetFavProjectsResponse =
4444
export type GetImportedTokensResponse =
4545
| { Ok: ImportedTokens }
4646
| { AccountNotFound: null };
47-
export type GetProposalPayloadResponse = { Ok: string } | { Err: string };
4847
export interface HardwareWalletAccountDetails {
4948
principal: Principal;
5049
name: string;
@@ -173,7 +172,6 @@ export default interface _SERVICE {
173172
get_imported_tokens: () => Promise<GetImportedTokensResponse>;
174173
get_fav_projects: () => Promise<GetFavProjectsResponse>;
175174
get_address_book: () => Promise<GetAddressBookResponse>;
176-
get_proposal_payload: (arg_0: bigint) => Promise<GetProposalPayloadResponse>;
177175
get_stats: () => Promise<Stats>;
178176
http_request: (arg_0: HttpRequest) => Promise<HttpResponse>;
179177
register_hardware_wallet: (

rs/backend/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ icp-ledger = { workspace = true }
3939
icrc-ledger-types = { workspace = true }
4040
on_wire = { workspace = true }
4141

42-
proposals = { path = "../proposals" }
43-
4442
[dev-dependencies]
4543
anyhow = "1.0.95"
4644
candid_parser = "0.1.2"

rs/backend/nns-dapp-exports-production.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ canister_update add_stable_asset
1818
canister_update attach_canister
1919
canister_update create_sub_account
2020
canister_update detach_canister
21-
canister_update get_proposal_payload
2221
canister_update register_hardware_wallet
2322
canister_update rename_canister
2423
canister_update rename_sub_account

rs/backend/nns-dapp-exports-test.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ canister_update attach_canister
2020
canister_update create_sub_account
2121
canister_update create_toy_accounts
2222
canister_update detach_canister
23-
canister_update get_proposal_payload
2423
canister_update register_hardware_wallet
2524
canister_update rename_canister
2625
canister_update rename_sub_account

rs/backend/nns-dapp.did

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,6 @@ type DetachCanisterResponse =
125125
AccountNotFound;
126126
};
127127

128-
type GetProposalPayloadResponse =
129-
variant {
130-
Ok: text;
131-
Err: text;
132-
};
133-
134128
type Stats =
135129
record {
136130
accounts_count: nat64;
@@ -292,7 +286,6 @@ service: (opt Config) -> {
292286
get_fav_projects: () -> (GetFavProjectsResponse) query;
293287
set_address_book: (AddressBook) -> (SetAddressBookResponse);
294288
get_address_book: () -> (GetAddressBookResponse) query;
295-
get_proposal_payload: (nat64) -> (GetProposalPayloadResponse);
296289
get_stats: () -> (Stats) query;
297290
get_histogram: () -> (Histogram) query;
298291
get_tvl : () -> (TvlResponse) query;

0 commit comments

Comments
 (0)