fyziktom / VirtualEconomyFramework

Framework for economy applications
https://veframework.com/
MIT License
24 stars 7 forks source link

Split Transaction creation and signing functions into separate methods. #105

Closed VenkataRoundSqr closed 1 year ago

VenkataRoundSqr commented 2 years ago

Need to split the methods which creates Transactions and sign and broadcast them. Should be done on NeblioAccount level (NeblioAccountbase.cs class). It helps to create better tests to verify Transaction creation logic. Functions like SendNTP1TokenWithPaymentAPIAsync, etc. we can test without broadcast and explore if transaction is assembled correctly.

Currently we are calling NeblioTransactionHelpers and getting response transactionId. Below are the steps involved:

  1. Creating transaction.
  2. Signing transaction and
  3. Broadcasting it.

After the proposed change we will call NeblioTransactionHelpers separately to create transactions and sign and broadcast them.

@fyziktom please add if you think need more details.

Below is link to the new method SignAndBroadcastTransaction in NeblioTransactionHelpers.cs https://github.com/fyziktom/VirtualEconomyFramework/blob/105-Splitting-Sign-and-Broadcast/VirtualEconomyFramework/VEDriversLite/Neblio/NeblioTransactionHelpers.cs

fyziktom commented 1 year ago

Uzavírám tuto issue, protože již byla vyřešena a zatím se neobjevily nějaké speciální problémy. Díky této úpravě bylo také možné vytvořit řadu testů, které nyní testují automaticky některé funkce v rámci tvorby transakcí.