Skip to content

Commit

Permalink
Merge branch 'implement-acp-77-warp-verification' into implement-acp-…
Browse files Browse the repository at this point in the history
…77-warp-signing
  • Loading branch information
StephenButtolph authored Nov 13, 2024
2 parents ef445ca + c03ad3b commit 75f94bf
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions vms/platformvm/txs/executor/create_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestCreateChainTxInsufficientControlSigs(t *testing.T) {
tx,
stateDiff,
)
require.ErrorIs(err, errUnauthorizedSubnetModification)
require.ErrorIs(err, errUnauthorizedModification)
}

// Ensure Execute fails when an incorrect control signature is given
Expand Down Expand Up @@ -101,7 +101,7 @@ func TestCreateChainTxWrongControlSig(t *testing.T) {
tx,
stateDiff,
)
require.ErrorIs(err, errUnauthorizedSubnetModification)
require.ErrorIs(err, errUnauthorizedModification)
}

// Ensure Execute fails when the Subnet the blockchain specifies as
Expand Down
4 changes: 2 additions & 2 deletions vms/platformvm/txs/executor/proposal_tx_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ func TestProposalTxExecuteAddSubnetValidator(t *testing.T) {
onCommitState,
onAbortState,
)
require.ErrorIs(err, errUnauthorizedSubnetModification)
require.ErrorIs(err, errUnauthorizedModification)
}

{
Expand Down Expand Up @@ -737,7 +737,7 @@ func TestProposalTxExecuteAddSubnetValidator(t *testing.T) {
onCommitState,
onAbortState,
)
require.ErrorIs(err, errUnauthorizedSubnetModification)
require.ErrorIs(err, errUnauthorizedModification)
}

{
Expand Down
8 changes: 4 additions & 4 deletions vms/platformvm/txs/executor/standard_tx_executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ func TestApricotStandardTxExecutorAddSubnetValidator(t *testing.T) {
tx,
onAcceptState,
)
require.ErrorIs(err, errUnauthorizedSubnetModification)
require.ErrorIs(err, errUnauthorizedModification)
}

{
Expand Down Expand Up @@ -830,7 +830,7 @@ func TestApricotStandardTxExecutorAddSubnetValidator(t *testing.T) {
tx,
onAcceptState,
)
require.ErrorIs(err, errUnauthorizedSubnetModification)
require.ErrorIs(err, errUnauthorizedModification)
}

{
Expand Down Expand Up @@ -1962,7 +1962,7 @@ func TestStandardExecutorRemoveSubnetValidatorTx(t *testing.T) {
}
return env.unsignedTx, e
},
expectedErr: errUnauthorizedSubnetModification,
expectedErr: errUnauthorizedModification,
},
{
name: "flow checker failed",
Expand Down Expand Up @@ -2464,7 +2464,7 @@ func TestStandardExecutorConvertSubnetTx(t *testing.T) {
})
return nil
},
expectedErr: errUnauthorizedSubnetModification,
expectedErr: errUnauthorizedModification,
},
{
name: "invalid if subnet is transformed",
Expand Down
8 changes: 4 additions & 4 deletions vms/platformvm/txs/executor/subnet_tx_verification.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
)

var (
errWrongNumberOfCredentials = errors.New("should have the same number of credentials as inputs")
errIsImmutable = errors.New("is immutable")
errUnauthorizedSubnetModification = errors.New("unauthorized subnet modification")
errWrongNumberOfCredentials = errors.New("should have the same number of credentials as inputs")
errIsImmutable = errors.New("is immutable")
errUnauthorizedModification = errors.New("unauthorized modification")
)

// verifyPoASubnetAuthorization carries out the validation for modifying a PoA
Expand Down Expand Up @@ -93,7 +93,7 @@ func verifyAuthorization(
authCred := tx.Creds[baseTxCredsLen]

if err := fx.VerifyPermission(tx.Unsigned, auth, authCred, owner); err != nil {
return nil, fmt.Errorf("%w: %w", errUnauthorizedSubnetModification, err)
return nil, fmt.Errorf("%w: %w", errUnauthorizedModification, err)
}

return tx.Creds[:baseTxCredsLen], nil
Expand Down

0 comments on commit 75f94bf

Please sign in to comment.