Skip to content

Commit

Permalink
fix: Correctly identify full access key actions
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmccauley committed Mar 17, 2022
1 parent 7372346 commit 000dcc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const StyledBannerContainer = styled.div`
`;

const ActionDetailsBanner = ({ multisigRequest }) => {
const isAddingFullAccessKey = multisigRequest.actions.some(({ enum: type, permission }) => type === 'addKey' && !permission);
const isAddingFullAccessKey = multisigRequest.actions.some(({ enum: type, [type]: action }) => type === 'addKey' && !action.accessKey.permission);

return (
<StyledBannerContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const parseAndFormatArguments = (argsBuffer) => {
};

export default function getTranslationsFromMultisigRequest({ actions, receiverId, accountId }) {
const fullAccessKeyAction = actions.find(({ enum: type, permission }) => type === 'addKey' && !permission);
const fullAccessKeyAction = actions.find(({ enum: type, [type]: action }) => type === 'addKey' && !action.accessKey.permission);
if (fullAccessKeyAction) {
return [
{
Expand All @@ -49,15 +49,15 @@ export default function getTranslationsFromMultisigRequest({ actions, receiverId
}

return actions
.map(({ enum: actionType, [actionType]: action }) => {
switch (actionType) {
.map(({ enum: type, [type]: action }) => {
switch (type) {
case 'addKey':
return {
id: 'twoFactor.action.addKey.limited',
data: {
receiverId,
methodNames: action.permission.functionCall.methodNames.join(', '),
allowance: formatNear(action.permission.functionCall.allowance),
methodNames: action.accessKey.permission.functionCall.methodNames.join(', '),
allowance: formatNear(action.accessKey.permission.functionCall.allowance),
publicKey: rawPublicKeyToString(action.publicKey),
}
};
Expand Down

0 comments on commit 000dcc1

Please sign in to comment.