From c8ca0471361d7be0b2cc824f70b299bb3162af6a Mon Sep 17 00:00:00 2001
From: librelois <c@elo.tf>
Date: Sun, 5 Jun 2022 01:01:05 +0200
Subject: [PATCH] =?UTF-8?q?feat(gdev):=C2=A0add=20transaction=20bytes=20fe?=
 =?UTF-8?q?es=20(1=20cent=20per=20byte)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #61
---
 .../cucumber-features/monetary_mass.feature          | 12 ++++++------
 end2end-tests/cucumber-features/transfer_all.feature |  7 +++++--
 end2end-tests/cucumber-genesis/default.json          |  8 ++++----
 runtime/g1/src/parameters.rs                         |  2 +-
 runtime/gdev/src/parameters.rs                       |  2 +-
 runtime/gtest/src/parameters.rs                      |  2 +-
 6 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/end2end-tests/cucumber-features/monetary_mass.feature b/end2end-tests/cucumber-features/monetary_mass.feature
index 8679d2c23..2a810a552 100644
--- a/end2end-tests/cucumber-features/monetary_mass.feature
+++ b/end2end-tests/cucumber-features/monetary_mass.feature
@@ -1,10 +1,10 @@
 Feature: Balance transfer
 
-  Scenario: After 10 blocks, the monetary mass should be 60 ĞD
-    Then Monetary mass should be 30.00 ĞD
-    Then Current UD amount should be 10.00 ĞD
+  Scenario: After 10 blocks, the monetary mass should be 600 ĞD
+    Then Monetary mass should be 300.00 ĞD
+    Then Current UD amount should be 100.00 ĞD
     When 10 blocks later
-    Then Monetary mass should be 60.00 ĞD
+    Then Monetary mass should be 600.00 ĞD
     When 10 blocks later
-    Then Monetary mass should be 90.00 ĞD
-    Then Current UD amount should be 10.00 ĞD
+    Then Monetary mass should be 900.00 ĞD
+    Then Current UD amount should be 100.00 ĞD
diff --git a/end2end-tests/cucumber-features/transfer_all.feature b/end2end-tests/cucumber-features/transfer_all.feature
index b111bb518..bd2dd30cd 100644
--- a/end2end-tests/cucumber-features/transfer_all.feature
+++ b/end2end-tests/cucumber-features/transfer_all.feature
@@ -1,11 +1,14 @@
 @genesis.default
 Feature: Balance transfer all
 
-  Scenario: If alice sends all her ĞDs to Dave, Dave will get 8 ĞD
+  Scenario: If alice sends all her ĞDs to Dave, Dave will get 96 ĞD
     When alice sends all her ĞDs to dave
     """
     Alice is a smith member, as such she is not allowed to empty her account completely,
     if she tries to do so, the existence deposit (2 ĞD) must remain.
     """
     Then alice should have 2 ĞD
-    Then dave should have 8 ĞD
+    """
+    100 ĞD (initial Alice balance) - 2 ĞD (Existential deposit) - 1.4 ĞD (transaction fees)
+    """
+    Then dave should have 96.60 ĞD
diff --git a/end2end-tests/cucumber-genesis/default.json b/end2end-tests/cucumber-genesis/default.json
index 7a9780910..43438583c 100644
--- a/end2end-tests/cucumber-genesis/default.json
+++ b/end2end-tests/cucumber-genesis/default.json
@@ -1,19 +1,19 @@
 {
-  "first_ud": 1000,
+  "first_ud": 10000,
   "first_ud_reeval": 100,
   "identities": {
     "Alice": {
-      "balance": 1000,
+      "balance": 10000,
       "certs": ["Bob", "Charlie"],
       "pubkey": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
     },
     "Bob": {
-      "balance": 1000,
+      "balance": 10000,
       "certs": ["Alice", "Charlie"],
       "pubkey": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty"
     },
     "Charlie": {
-      "balance": 1000,
+      "balance": 10000,
       "certs": ["Alice", "Bob"],
       "pubkey": "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y"
     }
diff --git a/runtime/g1/src/parameters.rs b/runtime/g1/src/parameters.rs
index 4275a5ef1..bf2c6bea3 100644
--- a/runtime/g1/src/parameters.rs
+++ b/runtime/g1/src/parameters.rs
@@ -79,7 +79,7 @@ frame_support::parameter_types! {
 
 // Transaction payment
 frame_support::parameter_types! {
-    pub const TransactionByteFee: Balance = 0;
+    pub const TransactionByteFee: Balance = 1;
 }
 
 // Universal dividend
diff --git a/runtime/gdev/src/parameters.rs b/runtime/gdev/src/parameters.rs
index 024568027..848135cb6 100644
--- a/runtime/gdev/src/parameters.rs
+++ b/runtime/gdev/src/parameters.rs
@@ -77,7 +77,7 @@ frame_support::parameter_types! {
 
 // Transaction payment
 frame_support::parameter_types! {
-    pub const TransactionByteFee: Balance = 0;
+    pub const TransactionByteFee: Balance = 1;
 }
 
 // Universal dividend
diff --git a/runtime/gtest/src/parameters.rs b/runtime/gtest/src/parameters.rs
index df70c7bf6..1a1eb4b33 100644
--- a/runtime/gtest/src/parameters.rs
+++ b/runtime/gtest/src/parameters.rs
@@ -79,7 +79,7 @@ frame_support::parameter_types! {
 
 // Transaction payment
 frame_support::parameter_types! {
-    pub const TransactionByteFee: Balance = 0;
+    pub const TransactionByteFee: Balance = 1;
 }
 
 // Universal dividend
-- 
GitLab