From 231967b120c42e03d4dfc54b474a02d0b4aa4fba Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Tue, 20 Aug 2024 10:15:33 +0300 Subject: [PATCH] added recipient flags and functions --- cmd/main.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cmd/main.go b/cmd/main.go index d408f9f..22ba037 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -24,6 +24,8 @@ const ( USERFLAG_ACCOUNT_PENDING USERFLAG_ACCOUNT_SUCCESS USERFLAG_ACCOUNT_UNLOCKED + invalidRecipient + invalidRecipientWithInvite ) const ( @@ -311,6 +313,22 @@ func (fsd *fsData) checkBalance(ctx context.Context, sym string, input []byte) ( return res, nil } +func(fsd *fsData) send_transaction(ctx context.Context, sym string, input []byte) (resource.Result, error) { + res := resource.Result{} + recipient := string(input) + + res.FlagSet = []uint32{invalidRecipient} + res.Content = recipient + + return res, nil +} + +func(fsd *fsData) transaction_reset(ctx context.Context, sym string, input []byte) (resource.Result, error) { + res := resource.Result{} + res.FlagReset = []uint32{invalidRecipient} + return res, nil +} + var ( scriptDir = path.Join("services", "registration") ) @@ -376,6 +394,8 @@ func main() { rfs.AddLocalFunc("unlock_account", fs.unlock) rfs.AddLocalFunc("quit",fs.quit) rfs.AddLocalFunc("check_balance", fs.checkBalance) + rfs.AddLocalFunc("send_transaction", fs.send_transaction) + rfs.AddLocalFunc("transaction_reset", fs.transaction_reset) cont, err := en.Init(ctx) if err != nil {