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

chore: add attestation to allowed operations for some tests #509

Merged
merged 12 commits into from
Oct 17, 2024
Merged
22 changes: 11 additions & 11 deletions pkg/signatory/signatory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,21 @@ func TestPolicy(t *testing.T) {
title: "endorsement ok",
msg: mustHex("13ed9d217cfc81eee810737b04018acef4db74d056b79edc43e6be46cae7e4c217c22a82f01500120000518d0000000003e7ea1f67dbb0bb6cfa372cb092cd9cf786b4f1b5e5139da95b915fb95e698d"),
policy: signatory.PublicKeyPolicy{
AllowedRequests: []string{"generic", "block", "endorsement"},
AllowedOps: []string{"endorsement", "seed_nonce_revelation", "activate_account", "ballot", "reveal", "transaction", "origination", "delegation"},
LogPayloads: true,
},
},
{
title: "endorsement not allowed",
msg: mustHex("13ed9d217cfc81eee810737b04018acef4db74d056b79edc43e6be46cae7e4c217c22a82f01500120000518d0000000003e7ea1f67dbb0bb6cfa372cb092cd9cf786b4f1b5e5139da95b915fb95e698d"),
policy: signatory.PublicKeyPolicy{
AllowedRequests: []string{"generic", "block"},
AllowedRequests: []string{"generic", "block", "endorsement", "attestation"},
AllowedOps: []string{"endorsement", "seed_nonce_revelation", "activate_account", "ballot", "reveal", "transaction", "origination", "delegation"},
LogPayloads: true,
},
expected: "request kind `endorsement' is not allowed",
},
// {
// title: "endorsement not allowed",
// msg: mustHex("13ed9d217cfc81eee810737b04018acef4db74d056b79edc43e6be46cae7e4c217c22a82f01500120000518d0000000003e7ea1f67dbb0bb6cfa372cb092cd9cf786b4f1b5e5139da95b915fb95e698d"),
// policy: signatory.PublicKeyPolicy{
// AllowedRequests: []string{"generic", "block"},
// AllowedOps: []string{"seed_nonce_revelation", "activate_account", "ballot", "reveal", "transaction", "origination", "delegation", "update_consensus_key"},
// LogPayloads: true,
// },
// expected: "request kind `endorsement' is not allowed",
// },
{
title: "generic ok",
msg: mustHex("03a60703a9567bf69ec66b368c3d8562eba4cbf29278c2c10447a684e3aa1436856c00a0c7a9b0bcd6a48ee0c13094327f215ba2adeaa7d40dabc1af25e36fde02c096b10201f525eabd8b0eeace1494233ea0230d2c9ad6619b00ffff0b66756c66696c6c5f61736b0000000907070088f0f6010306"),
Expand Down
Loading