From bff1c3241c5806aa69d039c99d2dfe4afff3d739 Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Mon, 26 Feb 2024 14:55:34 -0500 Subject: [PATCH] remove over aggressive project and batch ID validation --- .../base/types/v1/features/msg_bridge.feature | 17 ----------------- .../types/v1/features/msg_create_batch.feature | 11 ----------- .../v1/features/msg_mint_batch_credits.feature | 11 ----------- .../types/v1/features/msg_seal_batch.feature | 11 ----------- .../base/types/v1/features/msg_send.feature | 16 ---------------- .../features/msg_update_batch_metadata.feature | 11 ----------- .../features/msg_update_project_admin.feature | 11 ----------- .../msg_update_project_metadata.feature | 11 ----------- .../base/types/v1/features/state_batch.feature | 13 ------------- .../types/v1/features/state_project.feature | 13 +------------ .../types/v1/features/types_credits.feature | 10 ---------- .../basket/types/v1/features/msg_put.feature | 16 ---------------- .../v1/features/state_basket_balance.feature | 11 ----------- .../types/v1/features/msg_sell.feature | 15 --------------- 14 files changed, 1 insertion(+), 176 deletions(-) diff --git a/x/ecocredit/base/types/v1/features/msg_bridge.feature b/x/ecocredit/base/types/v1/features/msg_bridge.feature index 4e51fdd91f..0766aa0cfd 100644 --- a/x/ecocredit/base/types/v1/features/msg_bridge.feature +++ b/x/ecocredit/base/types/v1/features/msg_bridge.feature @@ -118,23 +118,6 @@ Feature: MsgBridge When the message is validated Then expect the error "credits[0]: batch denom: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if credits batch denom is not formatted - Given the message - """ - { - "owner": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", - "target": "polygon", - "recipient": "0x323b5d4c32345ced77393b3530b1eed0f346429d", - "credits": [ - { - "batch_denom": "foo" - } - ] - } - """ - When the message is validated - Then expect the error "credits[0]: batch denom: expected format ---: parse error: invalid request" - Scenario: an error is returned if credits amount is empty Given the message """ diff --git a/x/ecocredit/base/types/v1/features/msg_create_batch.feature b/x/ecocredit/base/types/v1/features/msg_create_batch.feature index 844bd030b6..d83f2c2f82 100644 --- a/x/ecocredit/base/types/v1/features/msg_create_batch.feature +++ b/x/ecocredit/base/types/v1/features/msg_create_batch.feature @@ -155,17 +155,6 @@ Feature: MsgCreateBatch When the message is validated Then expect the error "project id: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if project id is not formatted - Given the message - """ - { - "issuer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", - "project_id": "foo" - } - """ - When the message is validated - Then expect the error "project id: expected format -: parse error: invalid request" - Scenario: an error is returned if class id is empty Given the message """ diff --git a/x/ecocredit/base/types/v1/features/msg_mint_batch_credits.feature b/x/ecocredit/base/types/v1/features/msg_mint_batch_credits.feature index 17f23c5886..445dad9cbe 100644 --- a/x/ecocredit/base/types/v1/features/msg_mint_batch_credits.feature +++ b/x/ecocredit/base/types/v1/features/msg_mint_batch_credits.feature @@ -77,17 +77,6 @@ Feature: MsgMintBatchCredits When the message is validated Then expect the error "batch denom: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if batch denom is not formatted - Given the message - """ - { - "issuer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", - "batch_denom": "foo" - } - """ - When the message is validated - Then expect the error "batch denom: expected format ---: parse error: invalid request" - Scenario: an error is returned if issuance is empty Given the message """ diff --git a/x/ecocredit/base/types/v1/features/msg_seal_batch.feature b/x/ecocredit/base/types/v1/features/msg_seal_batch.feature index 07b49087a6..201a67f743 100644 --- a/x/ecocredit/base/types/v1/features/msg_seal_batch.feature +++ b/x/ecocredit/base/types/v1/features/msg_seal_batch.feature @@ -39,17 +39,6 @@ Feature: MsgSealBatch When the message is validated Then expect the error "batch denom: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if batch denom is not formatted - Given the message - """ - { - "issuer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", - "batch_denom": "foo" - } - """ - When the message is validated - Then expect the error "batch denom: expected format ---: parse error: invalid request" - Scenario: a valid amino message Given the message """ diff --git a/x/ecocredit/base/types/v1/features/msg_send.feature b/x/ecocredit/base/types/v1/features/msg_send.feature index 63bf82608b..86b4dcf9fc 100644 --- a/x/ecocredit/base/types/v1/features/msg_send.feature +++ b/x/ecocredit/base/types/v1/features/msg_send.feature @@ -126,22 +126,6 @@ Feature: MsgSend When the message is validated Then expect the error "credits[0]: batch denom: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if credits batch denom is not formatted - Given the message - """ - { - "sender": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", - "recipient": "regen1tnh2q55v8wyygtt9srz5safamzdengsnlm0yy4", - "credits": [ - { - "batch_denom": "foo" - } - ] - } - """ - When the message is validated - Then expect the error "credits[0]: batch denom: expected format ---: parse error: invalid request" - Scenario: an error is returned if credits tradable amount and retired amount are empty Given the message """ diff --git a/x/ecocredit/base/types/v1/features/msg_update_batch_metadata.feature b/x/ecocredit/base/types/v1/features/msg_update_batch_metadata.feature index 26bf625df1..d7b69e3f5c 100644 --- a/x/ecocredit/base/types/v1/features/msg_update_batch_metadata.feature +++ b/x/ecocredit/base/types/v1/features/msg_update_batch_metadata.feature @@ -40,17 +40,6 @@ Feature: MsgUpdateBatchMetadata When the message is validated Then expect the error "batch denom: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if batch denom is not formatted - Given the message - """ - { - "issuer": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", - "batch_denom": "foo" - } - """ - When the message is validated - Then expect the error "batch denom: expected format ---: parse error: invalid request" - Scenario: an error is returned if new metadata is empty Given the message """ diff --git a/x/ecocredit/base/types/v1/features/msg_update_project_admin.feature b/x/ecocredit/base/types/v1/features/msg_update_project_admin.feature index edcb2f4931..eb402290d2 100644 --- a/x/ecocredit/base/types/v1/features/msg_update_project_admin.feature +++ b/x/ecocredit/base/types/v1/features/msg_update_project_admin.feature @@ -40,17 +40,6 @@ Feature: MsgUpdateProjectAdmin When the message is validated Then expect the error "project id: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if project id is not formatted - Given the message - """ - { - "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", - "project_id": "foo" - } - """ - When the message is validated - Then expect the error "project id: expected format -: parse error: invalid request" - Scenario: an error is returned if new admin is empty Given the message """ diff --git a/x/ecocredit/base/types/v1/features/msg_update_project_metadata.feature b/x/ecocredit/base/types/v1/features/msg_update_project_metadata.feature index 4691c11bbb..cbaeb55668 100644 --- a/x/ecocredit/base/types/v1/features/msg_update_project_metadata.feature +++ b/x/ecocredit/base/types/v1/features/msg_update_project_metadata.feature @@ -51,17 +51,6 @@ Feature: MsgUpdateProjectMetadata When the message is validated Then expect the error "project id: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if project id is not formatted - Given the message - """ - { - "admin": "regen1depk54cuajgkzea6zpgkq36tnjwdzv4ak663u6", - "project_id": "foo" - } - """ - When the message is validated - Then expect the error "project id: expected format -: parse error: invalid request" - Scenario: an error is returned if new metadata exceeds 256 characters Given the message """ diff --git a/x/ecocredit/base/types/v1/features/state_batch.feature b/x/ecocredit/base/types/v1/features/state_batch.feature index e195a47f94..1bb1aa6885 100644 --- a/x/ecocredit/base/types/v1/features/state_batch.feature +++ b/x/ecocredit/base/types/v1/features/state_batch.feature @@ -76,19 +76,6 @@ Feature: Batch When the batch is validated Then expect the error "denom: empty string is not allowed: parse error" - Scenario: an error is returned if denom is not formatted - Given the batch - """ - { - "key": 1, - "issuer": "BTZfSbi0JKqguZ/tIAPUIhdAa7Y=", - "project_key": 1, - "denom": "foo" - } - """ - When the batch is validated - Then expect the error "denom: expected format ---: parse error" - Scenario: an error is returned if metadata exceeds 256 characters Given the batch """ diff --git a/x/ecocredit/base/types/v1/features/state_project.feature b/x/ecocredit/base/types/v1/features/state_project.feature index e566f2bb2d..f49e3f99cb 100644 --- a/x/ecocredit/base/types/v1/features/state_project.feature +++ b/x/ecocredit/base/types/v1/features/state_project.feature @@ -60,17 +60,6 @@ Feature: Project When the project is validated Then expect the error "project id: empty string is not allowed: parse error" - Scenario: an error is returned if id is not formatted - Given the project - """ - { - "key": 1, - "id": "foo" - } - """ - When the project is validated - Then expect the error "project id: expected format -: parse error" - Scenario: an error is returned if admin is empty Given the project """ @@ -93,7 +82,7 @@ Feature: Project } """ When the project is validated - Then expect the error "class key is deprecated and must be zer: parse error" + Then expect the error "class key is deprecated and must be zero: parse error" Scenario: an error is returned if jurisdiction is empty Given the project diff --git a/x/ecocredit/base/types/v1/features/types_credits.feature b/x/ecocredit/base/types/v1/features/types_credits.feature index 15b09f30e7..252f6b9703 100644 --- a/x/ecocredit/base/types/v1/features/types_credits.feature +++ b/x/ecocredit/base/types/v1/features/types_credits.feature @@ -19,16 +19,6 @@ Feature: Credits When the message is validated Then expect the error "batch denom: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if batch denom is not formatted - Given the message - """ - { - "batch_denom": "foo" - } - """ - When the message is validated - Then expect the error "batch denom: expected format ---: parse error: invalid request" - Scenario: an error is returned if amount is empty Given the message """ diff --git a/x/ecocredit/basket/types/v1/features/msg_put.feature b/x/ecocredit/basket/types/v1/features/msg_put.feature index e9147060db..ff73a527ef 100644 --- a/x/ecocredit/basket/types/v1/features/msg_put.feature +++ b/x/ecocredit/basket/types/v1/features/msg_put.feature @@ -81,22 +81,6 @@ Feature: MsgPut When the message is validated Then expect the error "credits[0]: batch denom: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if a credit batch denom is not formatted - Given the message - """ - { - "owner": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", - "basket_denom": "eco.uC.NCT", - "credits": [ - { - "batch_denom": "foo" - } - ] - } - """ - When the message is validated - Then expect the error "credits[0]: batch denom: expected format ---: parse error: invalid request" - Scenario: an error is returned if a credit amount is empty Given the message """ diff --git a/x/ecocredit/basket/types/v1/features/state_basket_balance.feature b/x/ecocredit/basket/types/v1/features/state_basket_balance.feature index a9e8498e21..28dc951f7f 100644 --- a/x/ecocredit/basket/types/v1/features/state_basket_balance.feature +++ b/x/ecocredit/basket/types/v1/features/state_basket_balance.feature @@ -31,17 +31,6 @@ Feature: BasketBalance When the basket balance is validated Then expect the error "batch denom: empty string is not allowed: parse error" - Scenario: an error is returned if batch denom is not formatted - Given the basket balance - """ - { - "basket_id": 1, - "batch_denom": "foo" - } - """ - When the basket balance is validated - Then expect the error "batch denom: expected format ---: parse error" - Scenario: an error is returned if balance is a negative decimal Given the basket balance """ diff --git a/x/ecocredit/marketplace/types/v1/features/msg_sell.feature b/x/ecocredit/marketplace/types/v1/features/msg_sell.feature index f5377cd05c..0f28e8f37d 100644 --- a/x/ecocredit/marketplace/types/v1/features/msg_sell.feature +++ b/x/ecocredit/marketplace/types/v1/features/msg_sell.feature @@ -131,21 +131,6 @@ Feature: MsgSell When the message is validated Then expect the error "orders[0]: batch denom: empty string is not allowed: parse error: invalid request" - Scenario: an error is returned if order batch denom is not formatted - Given the message - """ - { - "seller": "regen1elq7ys34gpkj3jyvqee0h6yk4h9wsfxmgqelsw", - "orders": [ - { - "batch_denom": "foo" - } - ] - } - """ - When the message is validated - Then expect the error "orders[0]: batch denom: expected format ---: parse error: invalid request" - Scenario: an error is returned if order quantity is empty Given the message """