Parcourir la source

feat(tests): add serialization/deserialization test for SetTransactionFee action

Daniel Chew il y a 8 mois
Parent
commit
fe75b45e91

+ 7 - 0
governance/xc_admin/packages/xc_admin_common/src/__tests__/GovernancePayload.test.ts

@@ -32,6 +32,7 @@ import {
   DataSource,
   SetDataSources,
 } from "../governance_payload/SetDataSources";
+import { SetTransactionFee } from "../governance_payload/SetTransactionFee";
 
 test("GovernancePayload ser/de", (done) => {
   jest.setTimeout(60000);
@@ -424,6 +425,12 @@ function governanceActionArb(): Arbitrary<PythGovernanceAction> {
             Buffer.from(token),
           );
         });
+    } else if (header.action === "SetTransactionFee") {
+      return fc
+        .record({ v: fc.bigUintN(64), e: fc.bigUintN(64) })
+        .map(({ v, e }) => {
+          return new SetTransactionFee(header.targetChainId, v, e);
+        });
     } else {
       throw new Error("Unsupported action type");
     }