diff --git a/README.md b/README.md index 9fec48d..d490036 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,7 @@ To allow slightly more advanced aproach to amont which have to be transfer there }, "actions": [ { + "name": "CustomActionName", "username": "universal-bot", "activeKey": "", "postingKey": "", diff --git a/src/Functional.UniversalBot.CLI/Logging.fs b/src/Functional.UniversalBot.CLI/Logging.fs index 66d5ec5..3fce876 100644 --- a/src/Functional.UniversalBot.CLI/Logging.fs +++ b/src/Functional.UniversalBot.CLI/Logging.fs @@ -4,13 +4,21 @@ open Functional.ETL.Pipeline open PipelineResult open Lamar +let writeToConsole message = + printfn "%O" message + let logger (entity: PipelineProcessData) = if entity.results |> Seq.length > 0 then let lastMessage = entity.results.Head - printfn "%O" lastMessage + writeToConsole lastMessage entity +let logConfigurationFound (config: Types.Configuration) = + let actionsMessage = sprintf "Found actions %i to process" (config.actions |> Seq.length) + writeToConsole actionsMessage + config + type ActionRegistry () as self = inherit ServiceRegistry () do diff --git a/src/Functional.UniversalBot.CLI/Program.fs b/src/Functional.UniversalBot.CLI/Program.fs index 49bbac2..dd13e04 100644 --- a/src/Functional.UniversalBot.CLI/Program.fs +++ b/src/Functional.UniversalBot.CLI/Program.fs @@ -9,7 +9,8 @@ let config = getConfiguration () printfn "Starting UniveralHiveBot processs" config -|> Scheduler.bind -|> Scheduler.start +|> Logging.logConfigurationFound +|> Scheduler.bind Logging.writeToConsole +|> Scheduler.start Logging.writeToConsole Loop.executeLoop () diff --git a/src/Functional.UniversalBot.CLI/Scheduler.fs b/src/Functional.UniversalBot.CLI/Scheduler.fs index e813631..b573609 100644 --- a/src/Functional.UniversalBot.CLI/Scheduler.fs +++ b/src/Functional.UniversalBot.CLI/Scheduler.fs @@ -13,13 +13,29 @@ let options = opt.IncludingSeconds <- true opt -let bind configuration = +let private bindAction logger name pipeline = + new Action(fun ct -> logger name; processPipeline pipeline |> ignore) + +let bind logger configuration = let crontab = new Scheduler() createScheduledPipelines configuration - |> Seq.map (fun (trigger, pipeline) -> (CrontabSchedule.Parse(trigger, options), pipeline)) - |> Seq.map (fun (cron, pipeline) -> (cron, new Action(fun ct -> processPipeline pipeline |> ignore))) + |> Seq.map (fun (name, trigger, pipeline) -> (name, CrontabSchedule.Parse(trigger, options), pipeline)) + |> Seq.map (fun (name, cron, pipeline) -> (cron, bindAction logger name pipeline)) |> Seq.iter (fun (cron, action) -> crontab.AddTask(cron, action) |> ignore) crontab -let start (scheduler: Scheduler) = +let start logger (scheduler: Scheduler) = scheduler.Start() + + let message = + let occurences = + scheduler.GetNextOccurrences () + |> Seq.map (fun x -> x.ToTuple()) + |> Seq.map (fun (date, _) -> date) + |> Seq.sortBy (fun x -> x) + //let nextOccurence = occurences |> Seq.head + //let (dateOfOccurence, _) = (nextOccurence.ToTuple()) + let dateOfOccurence = occurences |> Seq.head + sprintf "Next action on: %s" (dateOfOccurence.ToString("dd/MM/yyyy HH:mm:ss")) + + logger message diff --git a/src/Functional.UniversalBot.Core/Action.fs b/src/Functional.UniversalBot.Core/Action.fs new file mode 100644 index 0000000..1df3c08 --- /dev/null +++ b/src/Functional.UniversalBot.Core/Action.fs @@ -0,0 +1,14 @@ +module Action + +open PipelineResult +open Functional.ETL.Pipeline +open Functional.ETL.Pipeline.PipelineProcessData + +let bindAction moduleName userbasedAction (entity: PipelineProcessData) = + let userDetails: (string * string * string) option = PipelineProcessData.readPropertyAsType entity "userdata" + + match userDetails with + | Some (username, _, _) when username <> "" -> + userbasedAction username entity + | _ -> + NoUserDetails moduleName |> PipelineProcessData.withResult entity diff --git a/src/Functional.UniversalBot.Core/Configuration.fs b/src/Functional.UniversalBot.Core/Configuration.fs index 772b754..1094388 100644 --- a/src/Functional.UniversalBot.Core/Configuration.fs +++ b/src/Functional.UniversalBot.Core/Configuration.fs @@ -66,19 +66,13 @@ let private bindTransfomers url (config: UserActionsDefinition) = |> List.map (fun item -> binder item) |> List.fold (fun state next -> state >> next >> actionDecorator) Transformer.defaultTransformer -//type ScheduledPipeline = -// { -// schedule: string -// pipeline: Pipeline -// } - let private bindScheduledPipeline urls (config: UserActionsDefinition) = let reader = container.GetInstance() let transforms = bindTransfomers urls config let pipeline = Pipeline.bind (reader [config]) transforms - (config.Trigger, pipeline) + (config.Name, config.Trigger, pipeline) let private bindPipeline urls (config: UserActionsDefinition) = let reader = container.GetInstance() diff --git a/src/Functional.UniversalBot.Core/Functional.UniversalBot.Core.fsproj b/src/Functional.UniversalBot.Core/Functional.UniversalBot.Core.fsproj index 41f0223..2246a3a 100644 --- a/src/Functional.UniversalBot.Core/Functional.UniversalBot.Core.fsproj +++ b/src/Functional.UniversalBot.Core/Functional.UniversalBot.Core.fsproj @@ -23,6 +23,7 @@ + diff --git a/src/Functional.UniversalBot.Core/Types.fs b/src/Functional.UniversalBot.Core/Types.fs index bac0bb8..7ce6a10 100644 --- a/src/Functional.UniversalBot.Core/Types.fs +++ b/src/Functional.UniversalBot.Core/Types.fs @@ -26,6 +26,7 @@ let private defaultTrigger = "0 0 */1 * * *" type UserActionsDefinition () = let mutable username = "" + let mutable name = "" let mutable activeKey = "" let mutable postingKey = "" let mutable trigger = defaultTrigger @@ -34,6 +35,14 @@ type UserActionsDefinition () = member this.Username with get () = username and set (value) = username <- value + member this.Name + with get () = + if System.String.IsNullOrEmpty(name) + then + username + else + name + and set (value) = name <- value member this.ActiveKey with get () = activeKey and set (value) = activeKey <- value diff --git a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/AddTokenToPool.fs b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/AddTokenToPool.fs index 138fc65..55bbe04 100644 --- a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/AddTokenToPool.fs +++ b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/AddTokenToPool.fs @@ -32,44 +32,38 @@ let private scheduleTokenToPoolTransfer username tokenPair baseQuantity quoteQua |> buildCustomJson username "ssc-mainnet-hive" |> scheduleActiveOperation ModuleName tokenPair -let action hive hiveEngineUrl tokenPair leftAmountCalculator rightAmountCalculator (entity: PipelineProcessData) = - let userDetails: (string * string * string) option = PipelineProcessData.readPropertyAsType entity "userdata" - - match userDetails with - | Some (username, _, _) when username <> "" -> - let marketPosition = HiveEngine.getAvailableMarketPools hiveEngineUrl tokenPair - let (leftToken, rightToken) = splitPair tokenPair +let action hive hiveEngineUrl tokenPair leftAmountCalculator rightAmountCalculator username (entity: PipelineProcessData) = + let marketPosition = HiveEngine.getAvailableMarketPools hiveEngineUrl tokenPair + let (leftToken, rightToken) = splitPair tokenPair - let leftTokenPrecision = TokenInfo.getTokenPrecision entity leftToken - let rightTokenPrecision = TokenInfo.getTokenPrecision entity rightToken + let leftTokenPrecision = TokenInfo.getTokenPrecision entity leftToken + let rightTokenPrecision = TokenInfo.getTokenPrecision entity rightToken - let leftTokenBaseAmount = - readPropertyAsDecimal entity leftToken - |> defaultWhenNone 0M - |> leftAmountCalculator - |> roundToPrecision leftTokenPrecision - let leftTokenQuoteAmount = (leftTokenBaseAmount * marketPosition.basePrice) |> roundToPrecision rightTokenPrecision + let leftTokenBaseAmount = + readPropertyAsDecimal entity leftToken + |> defaultWhenNone 0M + |> leftAmountCalculator + |> roundToPrecision leftTokenPrecision + let leftTokenQuoteAmount = (leftTokenBaseAmount * marketPosition.basePrice) |> roundToPrecision rightTokenPrecision - let rightTokenBaseAmount = - readPropertyAsDecimal entity rightToken - |> defaultWhenNone 0M - |> rightAmountCalculator - |> roundToPrecision rightTokenPrecision - let rightTokenQuoteAmount = (rightTokenBaseAmount * marketPosition.quotePrice) |> roundToPrecision leftTokenPrecision + let rightTokenBaseAmount = + readPropertyAsDecimal entity rightToken + |> defaultWhenNone 0M + |> rightAmountCalculator + |> roundToPrecision rightTokenPrecision + let rightTokenQuoteAmount = (rightTokenBaseAmount * marketPosition.quotePrice) |> roundToPrecision leftTokenPrecision - match (leftTokenBaseAmount, leftTokenQuoteAmount, rightTokenBaseAmount, rightTokenQuoteAmount) with - | (leftBase, leftQuote, _, _) when leftBase > 0M && leftQuote > 0M && leftBase <= leftTokenBaseAmount && leftQuote <= rightTokenBaseAmount -> - scheduleTokenToPoolTransfer username tokenPair leftBase leftQuote |> withResult entity - | (_, _, rightBase, rightQuote) when rightBase > 0M && rightQuote > 0M && rightBase <= rightTokenBaseAmount && rightQuote <= leftTokenBaseAmount -> - scheduleTokenToPoolTransfer username tokenPair rightQuote rightBase |> withResult entity - | _ -> - TokenBalanceTooLow (ModuleName, username, tokenPair) |> withResult entity + match (leftTokenBaseAmount, leftTokenQuoteAmount, rightTokenBaseAmount, rightTokenQuoteAmount) with + | (leftBase, leftQuote, _, _) when leftBase > 0M && leftQuote > 0M && leftBase <= leftTokenBaseAmount && leftQuote <= rightTokenBaseAmount -> + scheduleTokenToPoolTransfer username tokenPair leftBase leftQuote |> withResult entity + | (_, _, rightBase, rightQuote) when rightBase > 0M && rightQuote > 0M && rightBase <= rightTokenBaseAmount && rightQuote <= leftTokenBaseAmount -> + scheduleTokenToPoolTransfer username tokenPair rightQuote rightBase |> withResult entity | _ -> - NoUserDetails ModuleName |> PipelineProcessData.withResult entity + TokenBalanceTooLow (ModuleName, username, tokenPair) |> withResult entity let bind (urls: Urls) (parameters: Map) = let tokenPair = parameters.["tokenPair"] let leftAmount = parameters.["leftAmount"] |> AmountCalator.bind let rightAmount = parameters.["rightAmount"] |> AmountCalator.bind - action urls.hiveNodeUrl urls.hiveEngineNodeUrl tokenPair leftAmount rightAmount + Action.bindAction ModuleName (action urls.hiveNodeUrl urls.hiveEngineNodeUrl tokenPair leftAmount rightAmount) diff --git a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/DelegateStake.fs b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/DelegateStake.fs index 06d0f3e..cd1094d 100644 --- a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/DelegateStake.fs +++ b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/DelegateStake.fs @@ -12,32 +12,27 @@ open Functional.ETL.Pipeline.PipelineProcessData [] let ModuleName = "DelegateStake" -let action tokenSymbol delegateTo amountCalcualtor (entity: PipelineProcessData) = - let userDetails: (string * string * string) option = readPropertyAsType entity "userdata" +let action tokenSymbol delegateTo amountCalcualtor username (entity: PipelineProcessData) = + let precision = TokenInfo.getTokenPrecision entity tokenSymbol + let tokenBalance = + sprintf "%s_stake" tokenSymbol + |> readPropertyAsDecimal entity + |> defaultWhenNone 0M + |> amountCalcualtor + |> roundToPrecision precision - match userDetails with - | Some (username, activeKey, _) -> - let precision = TokenInfo.getTokenPrecision entity tokenSymbol - let tokenBalance = - sprintf "%s_stake" tokenSymbol - |> readPropertyAsDecimal entity - |> defaultWhenNone 0M - |> amountCalcualtor - |> roundToPrecision precision - - if tokenBalance > 0M - then - bindCustomJson "tokens" "delegate" {|``to`` = delegateTo;symbol = tokenSymbol;quantity = String.asString tokenBalance|} - |> buildCustomJson username "ssc-mainnet-hive" - |> scheduleActiveOperation ModuleName tokenSymbol - |> withResult entity - else - TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> withResult entity - | _ -> - NoUserDetails ModuleName |> withResult entity + if tokenBalance > 0M + then + bindCustomJson "tokens" "delegate" {|``to`` = delegateTo;symbol = tokenSymbol;quantity = String.asString tokenBalance|} + |> buildCustomJson username "ssc-mainnet-hive" + |> scheduleActiveOperation ModuleName tokenSymbol + |> withResult entity + else + TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> withResult entity let bind urls (parameters: Map) = let token = parameters.["token"] let delegateTo = parameters.["delegateTo"] let amount = parameters.["amount"] |> AmountCalator.bind - action token delegateTo amount + + Action.bindAction ModuleName (action token delegateTo amount) diff --git a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/SellToken.fs b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/SellToken.fs index 7230a66..6f98794 100644 --- a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/SellToken.fs +++ b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/SellToken.fs @@ -18,30 +18,24 @@ let private getTokenPrice hiveEngineUrl tokenSymbol quantityToSell = |> Seq.find (fun marketBook -> marketBook.quantity >= quantityToSell) priceItem.price -let action hive hiveEngineUrl tokenSymbol amountCalcualtor (entity: PipelineProcessData) = - let userDetails: (string * string * string) option = PipelineProcessData.readPropertyAsType entity "userdata" +let action hive hiveEngineUrl tokenSymbol amountCalcualtor username (entity: PipelineProcessData) = + let amountToSell = + tokenSymbol + |> readPropertyAsDecimal entity + |> defaultWhenNone 0M + |> amountCalcualtor - match userDetails with - | Some (username, _, _) when username <> "" -> - let amountToSell = - tokenSymbol - |> readPropertyAsDecimal entity - |> defaultWhenNone 0M - |> amountCalcualtor - - if amountToSell > 0M - then - let tokenPrice = getTokenPrice hiveEngineUrl tokenSymbol amountToSell - bindCustomJson "market" "sell" {| symbol = tokenSymbol; quantity = String.asString amountToSell; price = String.asString tokenPrice; |} - |> buildCustomJson username "ssc-mainnet-hive" - |> scheduleActiveOperation ModuleName tokenSymbol - |> withResult entity - else - TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity - | _ -> - NoUserDetails ModuleName |> PipelineProcessData.withResult entity + if amountToSell > 0M + then + let tokenPrice = getTokenPrice hiveEngineUrl tokenSymbol amountToSell + bindCustomJson "market" "sell" {| symbol = tokenSymbol; quantity = String.asString amountToSell; price = String.asString tokenPrice; |} + |> buildCustomJson username "ssc-mainnet-hive" + |> scheduleActiveOperation ModuleName tokenSymbol + |> withResult entity + else + TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity let bind (urls: Urls) (parameters: Map) = let token = parameters.["token"] let amountToSell = parameters.["amountToSell"] |> AmountCalator.bind - action urls.hiveNodeUrl urls.hiveEngineNodeUrl token amountToSell + Action.bindAction ModuleName (action urls.hiveNodeUrl urls.hiveEngineNodeUrl token amountToSell) diff --git a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/StakeToken.fs b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/StakeToken.fs index 18c7995..95d268a 100644 --- a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/StakeToken.fs +++ b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/StakeToken.fs @@ -10,28 +10,22 @@ open Functional.ETL.Pipeline.PipelineProcessData [] let ModuleName = "Stake" -let action tokenSymbol amountCalcualtor (entity: PipelineProcessData) = - let userDetails: (string * string * string) option = PipelineProcessData.readPropertyAsType entity "userdata" - - match userDetails with - | Some (username, _, _) when username <> "" -> - let tokenBalance = - tokenSymbol - |> readPropertyAsDecimal entity - |> defaultWhenNone 0M - |> amountCalcualtor - if tokenBalance > 0M - then - bindCustomJson "tokens" "stake" {| ``to`` = username;symbol = tokenSymbol;quantity = String.asString tokenBalance|} - |> buildCustomJson username "ssc-mainnet-hive" - |> scheduleActiveOperation ModuleName tokenSymbol - |> withResult entity - else - TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity - | _ -> - NoUserDetails ModuleName |> PipelineProcessData.withResult entity +let action tokenSymbol amountCalcualtor username (entity: PipelineProcessData) = + let tokenBalance = + tokenSymbol + |> readPropertyAsDecimal entity + |> defaultWhenNone 0M + |> amountCalcualtor + if tokenBalance > 0M + then + bindCustomJson "tokens" "stake" {| ``to`` = username;symbol = tokenSymbol;quantity = String.asString tokenBalance|} + |> buildCustomJson username "ssc-mainnet-hive" + |> scheduleActiveOperation ModuleName tokenSymbol + |> withResult entity + else + TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity let bind urls (parameters: Map) = let token = parameters.["token"] let amount = parameters.["amount"] |> AmountCalator.bind - action token amount + Action.bindAction ModuleName (action token amount) diff --git a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/TokenSwapAction.fs b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/TokenSwapAction.fs index 33d9dbf..52f471e 100644 --- a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/TokenSwapAction.fs +++ b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/TokenSwapAction.fs @@ -11,31 +11,25 @@ open Functional.ETL.Pipeline.PipelineProcessData [] let ModuleName = "SwapToken" -let action hive hiveEngineUrl tokenPair tokenSymbol maxSlippage amountToSwapCalcualtor (entity: PipelineProcessData) = - let userDetails: (string * string * string) option = readPropertyAsType entity "userdata" +let action hive hiveEngineUrl tokenPair tokenSymbol maxSlippage amountToSwapCalcualtor username (entity: PipelineProcessData) = + let amountToSwap = + tokenSymbol + |> readPropertyAsDecimal entity + |> defaultWhenNone 0M + |> amountToSwapCalcualtor - match userDetails with - | Some (username, _, _) when username <> "" -> - let amountToSwap = - tokenSymbol - |> readPropertyAsDecimal entity - |> defaultWhenNone 0M - |> amountToSwapCalcualtor - - if amountToSwap > 0M - then - bindCustomJson "marketpools" "swapTokens" {| tokenPair = tokenPair; tokenSymbol = tokenSymbol; tokenAmount = String.asString amountToSwap; tradeType = "exactInput"; maxSlippage = maxSlippage |} - |> buildCustomJson username "ssc-mainnet-hive" - |> scheduleActiveOperation ModuleName tokenSymbol - |> withResult entity - else - TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity - | _ -> - NoUserDetails ModuleName |> PipelineProcessData.withResult entity + if amountToSwap > 0M + then + bindCustomJson "marketpools" "swapTokens" {| tokenPair = tokenPair; tokenSymbol = tokenSymbol; tokenAmount = String.asString amountToSwap; tradeType = "exactInput"; maxSlippage = maxSlippage |} + |> buildCustomJson username "ssc-mainnet-hive" + |> scheduleActiveOperation ModuleName tokenSymbol + |> withResult entity + else + TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity let bind (urls: Urls) (parameters: Map) = let tokenPair = parameters.["tokenPair"] let tokenSymbol = parameters.["token"] let maxSlippage = parameters.["maxSlippage"] let amountToSwap = parameters.["amountToSwap"] |> AmountCalator.bind - action urls.hiveNodeUrl urls.hiveEngineNodeUrl tokenPair tokenSymbol maxSlippage amountToSwap + Action.bindAction ModuleName (action urls.hiveNodeUrl urls.hiveEngineNodeUrl tokenPair tokenSymbol maxSlippage amountToSwap) diff --git a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/TransferToken.fs b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/TransferToken.fs index 5384de2..16a8470 100644 --- a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/TransferToken.fs +++ b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/TransferToken.fs @@ -12,32 +12,26 @@ open Decimal [] let ModuleName = "Transfer" -let action tokenSymbol transferTo amountCalcualtor memo (entity: PipelineProcessData) = - let userDetails: (string * string * string) option = PipelineProcessData.readPropertyAsType entity "userdata" +let action tokenSymbol transferTo amountCalcualtor memo username (entity: PipelineProcessData) = + let precision = TokenInfo.getTokenPrecision entity tokenSymbol + let tokenBalance = + readPropertyAsDecimal entity tokenSymbol + |> defaultWhenNone 0M + |> amountCalcualtor + |> roundToPrecision precision - match userDetails with - | Some (username, _, _) when username <> "" -> - let precision = TokenInfo.getTokenPrecision entity tokenSymbol - let tokenBalance = - readPropertyAsDecimal entity tokenSymbol - |> defaultWhenNone 0M - |> amountCalcualtor - |> roundToPrecision precision - - if tokenBalance > 0M - then - bindCustomJson "tokens" "transfer" {| ``to`` = transferTo;symbol = tokenSymbol;quantity = String.asString tokenBalance; memo = memo|} - |> buildCustomJson username "ssc-mainnet-hive" - |> scheduleActiveOperation ModuleName tokenSymbol - |> withResult entity - else - TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity - | _ -> - NoUserDetails ModuleName |> PipelineProcessData.withResult entity + if tokenBalance > 0M + then + bindCustomJson "tokens" "transfer" {| ``to`` = transferTo;symbol = tokenSymbol;quantity = String.asString tokenBalance; memo = memo|} + |> buildCustomJson username "ssc-mainnet-hive" + |> scheduleActiveOperation ModuleName tokenSymbol + |> withResult entity + else + TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity let bind urls (parameters: Map) = let tokenSymbol = parameters.["token"] let transferTo = parameters.["transferTo"] let memo = Map.getValueWithDefault parameters "memo" "" let amount = parameters.["amount"] |> AmountCalator.bind - action tokenSymbol transferTo amount memo + Action.bindAction ModuleName (action tokenSymbol transferTo amount memo) diff --git a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/UndelegateStake.fs b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/UndelegateStake.fs index f51c829..8b67d15 100644 --- a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/UndelegateStake.fs +++ b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/UndelegateStake.fs @@ -10,29 +10,24 @@ open Functional.ETL.Pipeline.PipelineProcessData [] let ModuleName = "UndelegateStake" -let action tokenSymbol undelegateFrom amountCalcualtor (entity: PipelineProcessData) = - let userDetails: (string * string * string) option = readPropertyAsType entity "userdata" +let action tokenSymbol undelegateFrom amountCalcualtor username (entity: PipelineProcessData) = + let tokenBalance = + sprintf "%s_delegatedstake" tokenSymbol + |> readPropertyAsDecimal entity + |> defaultWhenNone 0M + |> amountCalcualtor - match userDetails with - | Some (username, _, _) when username <> "" -> - let tokenBalance = - sprintf "%s_delegatedstake" tokenSymbol - |> readPropertyAsDecimal entity - |> defaultWhenNone 0M - |> amountCalcualtor + if tokenBalance > 0M + then + bindCustomJson "tokens" "undelegate" {|from = undelegateFrom;symbol = tokenSymbol;quantity = String.asStringWithPrecision tokenBalance|} + |> buildCustomJson username "ssc-mainnet-hive" + |> scheduleActiveOperation ModuleName tokenSymbol + |> withResult entity + else + TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> withResult entity - if tokenBalance > 0M - then - bindCustomJson "tokens" "undelegate" {|from = undelegateFrom;symbol = tokenSymbol;quantity = String.asStringWithPrecision tokenBalance|} - |> buildCustomJson username "ssc-mainnet-hive" - |> scheduleActiveOperation ModuleName tokenSymbol - |> withResult entity - else - TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> withResult entity - | _ -> - NoUserDetails ModuleName |> withResult entity let bind urls (parameters: Map) = let token = parameters.["token"] let undelegateFrom = parameters.["undelegateFrom"] let amount = parameters.["amount"] |> AmountCalator.bind - action token undelegateFrom amount + Action.bindAction ModuleName (action token undelegateFrom amount) diff --git a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/UnstakeToken.fs b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/UnstakeToken.fs index 24569f3..fd6875d 100644 --- a/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/UnstakeToken.fs +++ b/src/Functional.UniversalBot.Plugin.HiveEngine/Actions/UnstakeToken.fs @@ -10,28 +10,22 @@ open Functional.ETL.Pipeline.PipelineProcessData [] let ModuleName = "Unstake" -let action tokenSymbol amountCalcualtor (entity: PipelineProcessData) = - let userDetails: (string * string * string) option = PipelineProcessData.readPropertyAsType entity "userdata" - - match userDetails with - | Some (username, _, _) when username <> "" -> - let tokenBalance = - sprintf "%s_stake" tokenSymbol - |> readPropertyAsDecimal entity - |> defaultWhenNone 0M - |> amountCalcualtor - if tokenBalance > 0M - then - bindCustomJson "tokens" "unstake" {|symbol = tokenSymbol;quantity = String.asString tokenBalance|} - |> buildCustomJson username "ssc-mainnet-hive" - |> scheduleActiveOperation ModuleName tokenSymbol - |> withResult entity - else - TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity - | _ -> - NoUserDetails ModuleName |> PipelineProcessData.withResult entity +let action tokenSymbol amountCalcualtor username (entity: PipelineProcessData) = + let tokenBalance = + sprintf "%s_stake" tokenSymbol + |> readPropertyAsDecimal entity + |> defaultWhenNone 0M + |> amountCalcualtor + if tokenBalance > 0M + then + bindCustomJson "tokens" "unstake" {|symbol = tokenSymbol;quantity = String.asString tokenBalance|} + |> buildCustomJson username "ssc-mainnet-hive" + |> scheduleActiveOperation ModuleName tokenSymbol + |> withResult entity + else + TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity let bind urls (parameters: Map) = let token = parameters.["token"] let amount = parameters.["amount"] |> AmountCalator.bind - action token amount + Action.bindAction ModuleName (action token amount) diff --git a/src/Functional.UniversalBot.Plugin.Terracore/Actions/TerracoreClaim.fs b/src/Functional.UniversalBot.Plugin.Terracore/Actions/TerracoreClaim.fs index ea47090..f945246 100644 --- a/src/Functional.UniversalBot.Plugin.Terracore/Actions/TerracoreClaim.fs +++ b/src/Functional.UniversalBot.Plugin.Terracore/Actions/TerracoreClaim.fs @@ -1,5 +1,6 @@ module TerracoreClaim +open Action open Some open Hive open Decimal @@ -13,28 +14,22 @@ open Functional.ETL.Pipeline.PipelineProcessData let ModuleName = "TerracoreClaim" let tokenSymbol = "terraccore_claim" -let action amountCalcualtor (entity: PipelineProcessData) = - let userDetails: (string * string * string) option = PipelineProcessData.readPropertyAsType entity "userdata" - - match userDetails with - | Some (username, _, _) when username <> "" -> - let scrapBalance = - TerracoreBalance.scrapHandle - |> readPropertyAsDecimal entity - |> defaultWhenNone 0M - |> amountCalcualtor - |> roundToPrecision 8 - if scrapBalance > 0M - then - {| ``tx-hash`` = String.generateRandomString 22;amount = String.asString scrapBalance |} - |> buildCustomJson username "terracore_claim" - |> schedulePostingOperation ModuleName tokenSymbol - |> withResult entity - else - TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity - | _ -> - NoUserDetails ModuleName |> PipelineProcessData.withResult entity +let action amountCalcualtor username (entity: PipelineProcessData) = + let scrapBalance = + TerracoreBalance.scrapHandle + |> readPropertyAsDecimal entity + |> defaultWhenNone 0M + |> amountCalcualtor + |> roundToPrecision 8 + if scrapBalance > 0M + then + {| ``tx-hash`` = String.generateRandomString 22;amount = String.asString scrapBalance |} + |> buildCustomJson username "terracore_claim" + |> schedulePostingOperation ModuleName tokenSymbol + |> withResult entity + else + TokenBalanceTooLow (ModuleName, username, tokenSymbol) |> PipelineProcessData.withResult entity let bind urls (parameters: Map) = let amount = parameters.["amount"] |> AmountCalator.bind - action amount + Action.bindAction ModuleName (action amount) diff --git a/src/Functional.UniversalBot.Plugin.Terracore/Functional.UniversalBot.Plugin.Terracore.fsproj b/src/Functional.UniversalBot.Plugin.Terracore/Functional.UniversalBot.Plugin.Terracore.fsproj index 2558166..35d28d6 100644 --- a/src/Functional.UniversalBot.Plugin.Terracore/Functional.UniversalBot.Plugin.Terracore.fsproj +++ b/src/Functional.UniversalBot.Plugin.Terracore/Functional.UniversalBot.Plugin.Terracore.fsproj @@ -1,27 +1,21 @@  - - net7.0 - true - ..\..\build\debugBuild - + + net7.0 + true + - - - - - - - + + + + + + + - - - - - - - - - + + + + diff --git a/test/Functional.UniversalBot.Tests/ActionFixture.fs b/test/Functional.UniversalBot.Tests/ActionFixture.fs new file mode 100644 index 0000000..7c81902 --- /dev/null +++ b/test/Functional.UniversalBot.Tests/ActionFixture.fs @@ -0,0 +1,17 @@ +module ActionFixture + +open Xunit +open FsUnit.Xunit +open Functional.ETL.Pipeline +open PipelineResult + +let sampleAction username entity = + entity +let moduleName = "test" +let actionToTest = Action.bindAction moduleName sampleAction + +[] +let ``Returns no username when one not found`` () = + let entity = PipelineProcessData.bind 1 + let response = actionToTest entity + response.results.Head |> should equal (UniversalHiveBotResutls.NoUserDetails moduleName) diff --git a/test/Functional.UniversalBot.Tests/Actions/DelegateStakeTokensFixture.fs b/test/Functional.UniversalBot.Tests/Actions/DelegateStakeTokensFixture.fs index 35892c8..3490354 100644 --- a/test/Functional.UniversalBot.Tests/Actions/DelegateStakeTokensFixture.fs +++ b/test/Functional.UniversalBot.Tests/Actions/DelegateStakeTokensFixture.fs @@ -20,7 +20,7 @@ let testData = let ``Can delegate stake tokens`` oneUpBalance amountToBind result = let transformer = (TestingStubs.mockedStakedBalanceAction [| ("ONEUP", oneUpBalance) |]) - >> (DelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind amountToBind)) + >> (DelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind amountToBind) "universal-bot") let pipelineDefinition = Pipeline.bind reader transformer let results = processPipeline pipelineDefinition @@ -38,22 +38,10 @@ let ``Can delegate stake tokens`` oneUpBalance amountToBind result = let ``Check that balance is too low`` () = let transformer = (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) + >> (DelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100") "universal-bot") let pipelineDefinition = Pipeline.bind reader transformer processPipeline pipelineDefinition |> Seq.collect (fun x-> x.results) |> Seq.item 0 - |> should equal (TokenBalanceTooLow ("UndelegateStake", "ultimate-bot", "ONEUP")) - -[] -let ``Check that username is required`` () = - let transformer = - (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) - let pipelineDefinition = Pipeline.bind noUserReader transformer - - processPipeline pipelineDefinition - |> Seq.collect (fun x-> x.results) - |> Seq.item 0 - |> should equal (NoUserDetails ("UndelegateStake")) + |> should equal (TokenBalanceTooLow ("DelegateStake", "universal-bot", "ONEUP")) diff --git a/test/Functional.UniversalBot.Tests/Actions/SellTokensFixture.fs b/test/Functional.UniversalBot.Tests/Actions/SellTokensFixture.fs index ed413ce..a272885 100644 --- a/test/Functional.UniversalBot.Tests/Actions/SellTokensFixture.fs +++ b/test/Functional.UniversalBot.Tests/Actions/SellTokensFixture.fs @@ -21,7 +21,7 @@ let testData = let ``Can sell tokens`` (oneUpBalance:decimal) (amountToBind: string) (result: string) = let transformer = (TestingStubs.mockedBalanceAction [| ("ONEUP", oneUpBalance) |]) - >> (SellToken.action hiveNodeUrl hiveEngineNode "ONEUP" (AmountCalator.bind amountToBind)) + >> (SellToken.action hiveNodeUrl hiveEngineNode "ONEUP" (AmountCalator.bind amountToBind) "universal-bot") let pipelineDefinition = Pipeline.bind TestingStubs.reader transformer let results = processPipeline pipelineDefinition @@ -38,22 +38,10 @@ let ``Can sell tokens`` (oneUpBalance:decimal) (amountToBind: string) (result: s let ``Check that balance is too low`` () = let transformer = (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) + >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100") "universal-bot") let pipelineDefinition = Pipeline.bind TestingStubs.reader transformer processPipeline pipelineDefinition |> Seq.collect (fun x-> x.results) |> Seq.item 0 - |> should equal (TokenBalanceTooLow ("UndelegateStake", "ultimate-bot", "ONEUP")) - -[] -let ``Check that username is required`` () = - let transformer = - (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) - let pipelineDefinition = Pipeline.bind noUserReader transformer - - processPipeline pipelineDefinition - |> Seq.collect (fun x-> x.results) - |> Seq.item 0 - |> should equal (NoUserDetails ("UndelegateStake")) + |> should equal (TokenBalanceTooLow ("UndelegateStake", "universal-bot", "ONEUP")) diff --git a/test/Functional.UniversalBot.Tests/Actions/StakeTokensFixture.fs b/test/Functional.UniversalBot.Tests/Actions/StakeTokensFixture.fs index 4710641..e8c29fd 100644 --- a/test/Functional.UniversalBot.Tests/Actions/StakeTokensFixture.fs +++ b/test/Functional.UniversalBot.Tests/Actions/StakeTokensFixture.fs @@ -20,7 +20,7 @@ let testData = let ``Can stake tokens`` (oneUpBalance:decimal) (amountToBind: string) (result: string) = let transformer = (TestingStubs.mockedBalanceAction [| ("ONEUP", oneUpBalance) |]) - >> (StakeToken.action "ONEUP" (AmountCalator.bind amountToBind)) + >> (StakeToken.action "ONEUP" (AmountCalator.bind amountToBind) "universal-bot") let pipelineDefinition = Pipeline.bind reader transformer let results = processPipeline pipelineDefinition @@ -31,28 +31,16 @@ let ``Can stake tokens`` (oneUpBalance:decimal) (amountToBind: string) (result: underTestObject |> TestingStubs.extractCustomJson - |> should equal (sprintf """{"contractName":"tokens","contractAction":"stake","contractPayload":{"quantity":"%s","symbol":"ONEUP","to":"ultimate-bot"}}""" result) + |> should equal (sprintf """{"contractName":"tokens","contractAction":"stake","contractPayload":{"quantity":"%s","symbol":"ONEUP","to":"universal-bot"}}""" result) [] let ``Check that balance is too low`` () = let transformer = (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) + >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100") "universal-bot") let pipelineDefinition = Pipeline.bind reader transformer processPipeline pipelineDefinition |> Seq.collect (fun x-> x.results) |> Seq.item 0 - |> should equal (TokenBalanceTooLow ("UndelegateStake", "ultimate-bot", "ONEUP")) - -[] -let ``Check that username is required`` () = - let transformer = - (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) - let pipelineDefinition = Pipeline.bind noUserReader transformer - - processPipeline pipelineDefinition - |> Seq.collect (fun x-> x.results) - |> Seq.item 0 - |> should equal (NoUserDetails ("UndelegateStake")) + |> should equal (TokenBalanceTooLow ("UndelegateStake", "universal-bot", "ONEUP")) diff --git a/test/Functional.UniversalBot.Tests/Actions/TransferTokensFixture.fs b/test/Functional.UniversalBot.Tests/Actions/TransferTokensFixture.fs index 74c4aa9..ceeb6a3 100644 --- a/test/Functional.UniversalBot.Tests/Actions/TransferTokensFixture.fs +++ b/test/Functional.UniversalBot.Tests/Actions/TransferTokensFixture.fs @@ -20,7 +20,7 @@ let testData = let ``Can transfer tokens`` (oneUpBalance:decimal) (amountToBind: string) (result: string) = let transformer = (TestingStubs.mockedBalanceAction [| ("ONEUP", oneUpBalance) |]) - >> (TransferToken.action "ONEUP" "ultimate-bot" (AmountCalator.bind amountToBind)) "" + >> (TransferToken.action "ONEUP" "universal-bot" (AmountCalator.bind amountToBind) "" "universal-bot") let pipelineDefinition = Pipeline.bind reader transformer let results = processPipeline pipelineDefinition @@ -31,29 +31,16 @@ let ``Can transfer tokens`` (oneUpBalance:decimal) (amountToBind: string) (resul underTestObject |> TestingStubs.extractCustomJson - |> should equal (sprintf """{"contractName":"tokens","contractAction":"transfer","contractPayload":{"memo":"","quantity":"%s","symbol":"ONEUP","to":"ultimate-bot"}}""" result) + |> should equal (sprintf """{"contractName":"tokens","contractAction":"transfer","contractPayload":{"memo":"","quantity":"%s","symbol":"ONEUP","to":"universal-bot"}}""" result) [] let ``Check that balance is too low`` () = let transformer = (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) + >> (TransferToken.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100") "" "universal-bot") let pipelineDefinition = Pipeline.bind reader transformer processPipeline pipelineDefinition |> Seq.collect (fun x-> x.results) |> Seq.item 0 - |> should equal (TokenBalanceTooLow ("UndelegateStake", "ultimate-bot", "ONEUP")) - - -[] -let ``Check that username is required`` () = - let transformer = - (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) - let pipelineDefinition = Pipeline.bind noUserReader transformer - - processPipeline pipelineDefinition - |> Seq.collect (fun x-> x.results) - |> Seq.item 0 - |> should equal (NoUserDetails ("UndelegateStake")) + |> should equal (TokenBalanceTooLow ("Transfer", "universal-bot", "ONEUP")) diff --git a/test/Functional.UniversalBot.Tests/Actions/UndelegateStakeTokensFixturey.fs b/test/Functional.UniversalBot.Tests/Actions/UndelegateStakeTokensFixturey.fs index 9989012..8d9ce4b 100644 --- a/test/Functional.UniversalBot.Tests/Actions/UndelegateStakeTokensFixturey.fs +++ b/test/Functional.UniversalBot.Tests/Actions/UndelegateStakeTokensFixturey.fs @@ -20,7 +20,7 @@ let testData = let ``Can delegate stake tokens`` oneUpBalance amountToBind result = let transformer = (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", oneUpBalance) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind amountToBind)) + >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind amountToBind) "universal-bot") let pipelineDefinition = Pipeline.bind reader transformer processPipeline pipelineDefinition @@ -33,23 +33,10 @@ let ``Can delegate stake tokens`` oneUpBalance amountToBind result = let ``Check that balance is too low`` () = let transformer = (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) + >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100") "universal-bot") let pipelineDefinition = Pipeline.bind reader transformer processPipeline pipelineDefinition |> Seq.collect (fun x-> x.results) |> Seq.item 0 - |> should equal (TokenBalanceTooLow ("UndelegateStake", "ultimate-bot", "ONEUP")) - - -[] -let ``Check that username is required`` () = - let transformer = - (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) - let pipelineDefinition = Pipeline.bind noUserReader transformer - - processPipeline pipelineDefinition - |> Seq.collect (fun x-> x.results) - |> Seq.item 0 - |> should equal (NoUserDetails ("UndelegateStake")) + |> should equal (TokenBalanceTooLow ("UndelegateStake", "universal-bot", "ONEUP")) diff --git a/test/Functional.UniversalBot.Tests/Actions/UnstakeTokensFixture.fs b/test/Functional.UniversalBot.Tests/Actions/UnstakeTokensFixture.fs index 101477d..98f9da6 100644 --- a/test/Functional.UniversalBot.Tests/Actions/UnstakeTokensFixture.fs +++ b/test/Functional.UniversalBot.Tests/Actions/UnstakeTokensFixture.fs @@ -20,7 +20,7 @@ let testData = let ``Can stake tokens`` (oneUpBalance:decimal) (amountToBind: string) (result: string) = let transformer = (TestingStubs.mockedStakedBalanceAction [| ("ONEUP", oneUpBalance) |]) - >> (UnstakeToken.action "ONEUP" (AmountCalator.bind amountToBind)) + >> (UnstakeToken.action "ONEUP" (AmountCalator.bind amountToBind) "universal-bot") let pipelineDefinition = Pipeline.bind reader transformer let results = processPipeline pipelineDefinition @@ -37,22 +37,10 @@ let ``Can stake tokens`` (oneUpBalance:decimal) (amountToBind: string) (result: let ``Check that balance is too low`` () = let transformer = (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) + >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100") "universal-bot") let pipelineDefinition = Pipeline.bind reader transformer processPipeline pipelineDefinition |> Seq.collect (fun x-> x.results) |> Seq.item 0 - |> should equal (TokenBalanceTooLow ("UndelegateStake", "ultimate-bot", "ONEUP")) - -[] -let ``Check that username is required`` () = - let transformer = - (TestingStubs.mockedDelegatedStakedBalanceAction [| ("ONEUP", 0M) |]) - >> (UndelegateStake.action "ONEUP" "delegation-target-user" (AmountCalator.bind "100")) - let pipelineDefinition = Pipeline.bind noUserReader transformer - - processPipeline pipelineDefinition - |> Seq.collect (fun x-> x.results) - |> Seq.item 0 - |> should equal (NoUserDetails ("UndelegateStake")) + |> should equal (TokenBalanceTooLow ("UndelegateStake", "universal-bot", "ONEUP")) diff --git a/test/Functional.UniversalBot.Tests/Functional.UniversalBot.Tests.fsproj b/test/Functional.UniversalBot.Tests/Functional.UniversalBot.Tests.fsproj index a01a861..1e20df2 100644 --- a/test/Functional.UniversalBot.Tests/Functional.UniversalBot.Tests.fsproj +++ b/test/Functional.UniversalBot.Tests/Functional.UniversalBot.Tests.fsproj @@ -12,6 +12,7 @@ Always + @@ -24,7 +25,6 @@ - diff --git a/test/Functional.UniversalBot.Tests/TestingStubs.fs b/test/Functional.UniversalBot.Tests/TestingStubs.fs index f1c94aa..dc160ec 100644 --- a/test/Functional.UniversalBot.Tests/TestingStubs.fs +++ b/test/Functional.UniversalBot.Tests/TestingStubs.fs @@ -44,7 +44,7 @@ let inline (~~) x = x :> obj let reader: unit -> PipelineProcessData taskSeq = let userDefinition = new UserActionsDefinition () - userDefinition.Username <- "ultimate-bot" + userDefinition.Username <- "universal-bot" userDefinition.ActiveKey <- "" userDefinition.PostingKey <- "" diff --git a/test/Functional.UniversalBot.Tests/configuration.json b/test/Functional.UniversalBot.Tests/configuration.json index 33678da..20c7e49 100644 --- a/test/Functional.UniversalBot.Tests/configuration.json +++ b/test/Functional.UniversalBot.Tests/configuration.json @@ -9,7 +9,7 @@ {}, {}, { - "username": "ultimate-bot", + "username": "universal-bot", "activeKey": "", "postingKey": "", "tasks": [