mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-14 19:31:02 +00:00
Fix TaxZekatScreen: use pezTreasury.governmentPotAccountId for transfers
This commit is contained in:
@@ -125,15 +125,12 @@ const TaxZekatScreen: React.FC = () => {
|
|||||||
|
|
||||||
const amountInUnits = BigInt(Math.floor(parseFloat(amount) * 1e12)); // Convert to smallest unit (12 decimals for HEZ)
|
const amountInUnits = BigInt(Math.floor(parseFloat(amount) * 1e12)); // Convert to smallest unit (12 decimals for HEZ)
|
||||||
|
|
||||||
// Get treasury account address
|
// Get government pot account from PezTreasury pallet
|
||||||
// Treasury account is derived from pallet ID "py/trsry" (standard Substrate treasury)
|
const treasuryAccountOption = await api.query.pezTreasury.governmentPotAccountId();
|
||||||
const treasuryAccount = api.consts.treasury?.palletId
|
if (!treasuryAccountOption || treasuryAccountOption.isEmpty) {
|
||||||
? api.registry.createType('AccountId', api.consts.treasury.palletId.toU8a())
|
throw new Error('Government treasury account not found');
|
||||||
: null;
|
|
||||||
|
|
||||||
if (!treasuryAccount) {
|
|
||||||
throw new Error('Treasury account not found');
|
|
||||||
}
|
}
|
||||||
|
const treasuryAccount = treasuryAccountOption.toString();
|
||||||
|
|
||||||
if (__DEV__) {
|
if (__DEV__) {
|
||||||
console.log('[TaxZekat] Treasury account:', treasuryAccount.toString());
|
console.log('[TaxZekat] Treasury account:', treasuryAccount.toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user