-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Currently AccountRestrictionFlags is used with three different account restriction transaction type. The problem is that not all of enum value in AccountRestrictionFlags is valid for each transaction type. This can lead to runtime failures instead of catching errors at compile time.
Suggestion is to break AccountRestrictionFlags into three smaller enum types, each specific to transaction type.
e.g. This would be for the account address restriction tx.
export enum AccountAddressRestrictionFlags {
/**
* Allow only incoming transactions from a given address.
*/
AllowIncomingAddress = AccountRestrictionTypeEnum.Address,
/**
* Allow only outgoing transactions to a given address.
*/
AllowOutgoingAddress = AccountRestrictionTypeEnum.Address + AccountRestrictionTypeEnum.Outgoing,
/**
* Block incoming transactions from a given address.
*/
BlockIncomingAddress = AccountRestrictionTypeEnum.Address + AccountRestrictionTypeEnum.Block,
/**
* Block outgoing transactions from a given address.
*/
BlockOutgoingAddress = AccountRestrictionTypeEnum.Address + AccountRestrictionTypeEnum.Block + AccountRestrictionTypeEnum.Outgoing,
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request