Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transcoder for Unregister as validator txn type. Add support for approve component for this new txn type #292

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/app/approve/approve.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
TransactionMetadataUpdateProfile,
TransactionSpendingLimit,
TransactionMetadataRegisterAsValidator,
TransactionMetadataUnregisterAsValidator,
} from '../../lib/deso/transaction';
import { ExtraData } from '../../types/identity';
import { AccountService } from '../account.service';
Expand Down Expand Up @@ -593,6 +594,9 @@ export class ApproveComponent implements OnInit {
// TODO: Do we want any additional details in the approve component?
description = 'register as a validator';
break;
case TransactionMetadataUnregisterAsValidator:
description = 'unregister as a validator';
break;
}

// Set the transaction description based on the description populated with public keys.
Expand Down
2 changes: 2 additions & 0 deletions src/app/identity.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
TransactionMetadataUpdateNFT,
TransactionMetadataUpdateProfile,
TransactionMetadataRegisterAsValidator,
TransactionMetadataUnregisterAsValidator,
} from '../lib/deso/transaction';
import { SwalHelper } from '../lib/helpers/swal-helper';
import { AccessLevel, PublicUserInfo } from '../types/identity';
Expand Down Expand Up @@ -520,6 +521,7 @@ export class IdentityService {
case TransactionMetadataTransferDAOCoin:
case TransactionMetadataDAOCoinLimitOrder:
case TransactionMetadataRegisterAsValidator:
case TransactionMetadataUnregisterAsValidator:
return AccessLevel.Full;

case TransactionMetadataFollow:
Expand Down
3 changes: 3 additions & 0 deletions src/lib/deso/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,8 @@ export class TransactionMetadataRegisterAsValidator extends TransactionMetadata
votingAuthorization: Buffer = Buffer.alloc(0);
}

export class TransactionMetadataUnregisterAsValidator extends TransactionMetadata {}

export const TransactionTypeMetadataMap = {
1: TransactionMetadataBlockReward,
2: TransactionMetadataBasicTransfer,
Expand Down Expand Up @@ -641,6 +643,7 @@ export const TransactionTypeMetadataMap = {
32: TransactionMetadataAccessGroupMembers,
33: TransactionMetadataNewMessage,
34: TransactionMetadataRegisterAsValidator,
35: TransactionMetadataUnregisterAsValidator,
};

export class Transaction extends BinaryRecord {
Expand Down