public void InteractionSerialisation() { //decimal amount = 0.12345678m; //decimal fee = 0.00011234m; //string parm1 = (amount - fee).ToString("0.00000000").Split('.')[1]; //string saveParm = fee.ToString("0.00000000").Split('.')[1].Substring(4); //string costType = parm1.Substring(0, 2); //string actionType = parm1.Substring(2, 2); //string addParm = parm1.Substring(4, 4); var adventure1 = new AdventureAction(AdventureType.TestRoom, DifficultyType.Challenging, 2); Assert.Equal(0.01040004m, adventure1.GetValue1()); Assert.Equal(0.00002002m, adventure1.GetValue2()); var amount = adventure1.GetValue1(); var fee = adventure1.GetValue2(); var adventure2 = (AdventureAction)Interaction.GetInteraction(amount, fee); Assert.Equal(0.01040004m, adventure2.GetValue1()); Assert.Equal(0.00002002m, adventure2.GetValue2()); //Console.WriteLine($"Value1: {adventure.CostType}"); //Console.WriteLine($"Value1: {adventure.InteractionType}"); //Console.WriteLine($"Value1: {adventure.AdventureType}"); //Console.WriteLine($"Value1: {adventure.ChallengeRating}"); //Console.WriteLine($"Value1: {adventure.DifficultyType}"); //Console.WriteLine($"Value1: {adventure.AveragePartyLevel}"); //Console.WriteLine($"Value1: {adventure.ParamAdd1}"); //Console.WriteLine($"Value2: {adventure.ParamAdd2}"); }
public MogwaiKeys TestMogwaiKeys() { //return GetKeysFor("M9whXm2mjrhySAH6D81Lk5mthw1mUEZpvi", "MGJ9VoguyKeRTYmpURgztife4N7PnuDH6u"); var lvlBarbarian = new LevelingAction(LevelingType.Class, ClassType.Barbarian, 0, 1); var lvlCleric = new LevelingAction(LevelingType.Class, ClassType.Cleric, 0, 1); var lvlSorcerer = new LevelingAction(LevelingType.Class, ClassType.Sorcerer, 0, 1); var dungAction = new AdventureAction(AdventureType.Dungeon, DifficultyType.Easy, 2); var healAction = new SpecialAction(SpecialType.Heal, SpecialSubType.None, CostType.Medium); var revivingAction = new SpecialAction(SpecialType.Reviving, SpecialSubType.None, CostType.High); var pubMogAddressHex = HexHashUtil.ByteArrayToString(Base58Encoding.Decode("MJHYMxu2kyR1Bi4pYwktbeCM7yjZyVxt2i")); var blockHeight = 84659; var index = 0; var shifts = new Dictionary <long, Shift> { { blockHeight, new Shift(index++, 1530914381, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "00000000090d6c6b058227bb61ca2915a84998703d4444cc2641e6a0da4ba37e", 2, "163d2e383c77765232be1d9ed5e06749a814de49b4c0a8aebf324c0e9e2fd1cf", 1.00m, 0.0001m) }, { blockHeight, new Shift(index++, 1530914381, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "00000000090d6c6b058227bb61ca2915a84998703d4444cc2641e6a0da4ba37e", 2, "163d2e383c77765232be1d9ed5e06749a814de49b4c0a8aebf324c0e9e2fd1cf", lvlSorcerer.GetValue1(), lvlSorcerer.GetValue2()) }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163de3671ba28b41ecab6f5d1cf9bb43174cc97bf2164d2e39") }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163de3671ba28b41ecab6f5d1cf9bb43174cc97bf2164d2e39") }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163de3671ba28b41ecab6f5d1cf9bb43174cc97bf2164d2e39") }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163de3671ba28b41ecab6f5d1cf9bb43174cc97bf2164d2e39") }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163de3671ba28b41ecab6f5d1cf9bb43174cc97bf2164d2e39") }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163de3671ba28b41ecab6f5d1cf9bb43174cc97bf2164d2e39") }, { blockHeight, new Shift(index++, 1539810141, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", 1, "cbcd39553f9727c434343222f1bd8025608edcfbcfc262c0c2afe9fc3f0bcb29", lvlBarbarian.GetValue1(), lvlBarbarian.GetValue2()) }, { blockHeight, new Shift(index++, 1539815141, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", 1, "bbcd39553a9727c434343242f9bd8025608edcfbcfc262c0c2afe9fc3f0bff29", healAction.GetValue1(), healAction.GetValue2()) }, { blockHeight, new Shift(index++, 1540417599, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "00000000b552e9c7c51ed793f87c51b2cc945fbb222efd6cec17666a5ecd18a5", 1, "cb03db5029f426ed517fdfffd6a90c99a3111f2254f41f9a8f56320076b1f0e3", dungAction.GetValue1(), dungAction.GetValue2()) }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163de3671ba28b41ecab6f547219bb43174cc97bf2164d2e39") }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163dc3671ba28b41ecab6f547219bb43174cc97bf2164d2e30") }, { blockHeight, new Shift(index++, 1555309745, "32ab20cfbef0ccddfe5c79e726f5fc48b151106f196f7ccb71", blockHeight++, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", 1, "bbcd39553a9727c434343242f9bd8025608edcfbcfc262c0c2afe9fc3f0bdf29", revivingAction.GetValue1(), revivingAction.GetValue2()) }, { blockHeight, new Shift(index++, 1539815141, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", 1, "bbcd39553a9727c434343242f9bd8025608edcfbcfc262c0c2afe9fc3f0bff29", healAction.GetValue1(), healAction.GetValue2()) }, { blockHeight, new Shift(index++, 1539810141, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", 1, "cbcd39553f9727c434343222f1bd8025608edcfbcfc262c0c2afe9fc3f0bcb29", lvlSorcerer.GetValue1(), lvlSorcerer.GetValue2()) }, { blockHeight, new Shift(index++, 1540985507, "32ab20cfbef0ccddfe5c79e726f5fc48b151106f196f7ccb71", blockHeight++, "00000000b2204f48bb8d48542a6ada13bc86dde4d2909563fdb8f46389d1a1d2", 1, "01d8c163c4f034f7d1f8d7e94fc9fc9a30bbef1aa41c2e03dab29787588c60c4", dungAction.GetValue1(), dungAction.GetValue2()) }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163db3671ba28b41ecab6f547219bb43174cc97bf2164d2e31") }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163db3671ba28b41ecab6f547219bb43174cc97bf2164d2e31") }, { blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163db3671ba28b41ecab6f547219bb43174cc97bf2164d2e31") }, { blockHeight, new Shift(index++, 1555309745, "32ab20cfbef0ccddfe5c79e726f5fc48b151106f196f7ccb71", blockHeight++, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", 1, "bbcd39553a9727c434343242f9bd8025608edcfbcfc262c0c2afe9fc3f0bdf29", revivingAction.GetValue1(), revivingAction.GetValue2()) }, { blockHeight, new Shift(index++, 1556309745, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", 1, "bbcd39553a9727c434343242f9bd8025608edcfbcfc262c0c2afe9fc3f0bff29", healAction.GetValue1(), healAction.GetValue2()) }, { blockHeight, new Shift(index++, 1557309745, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", 1, "cbcd39553f9727c434343222f1bd8025608edcfbcfc262c0c2afe9fc3f0bcb29", lvlSorcerer.GetValue1(), lvlSorcerer.GetValue2()) }, { blockHeight, new Shift(index++, 1541350482, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "00000000341eea3f27e4ddaf72253cd6a35f54ece70fdeee0906a663f8403a60", 1, "302e37f0c69b1b037bc178fce6f8493a76a4c844df5391a0a46e81fcad8657c8", 0.01042002m, 0.00019003m) }, }; for (var i = 0; i < 30; i++) { shifts.Add(blockHeight, new Shift(index++, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "0000000033dbfc163de3671ba28b41ecab6f5d1cf9bb43174cc97bf2164d2e39")); } for (var i = 0; i < 10; i++) { shifts.Add(blockHeight, new Shift(index++, 1530914381, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "00000000090d6c6b058227bb61ca2915a84998703d4444cc2641e6a0da4ba37e", 2, "163d2e383c77765232be1d9ed5e06749a814de49b4c0a8aebf324c0e9e2fd1cf", lvlBarbarian.GetValue1(), lvlBarbarian.GetValue2())); } var dungActionNext = new AdventureAction(AdventureType.Dungeon, DifficultyType.Easy, 8); shifts.Add(blockHeight, new Shift(index++, 1540417599, "328e6077135a1012eae0c92dc624d1cbc02c69d45200e5f72c", blockHeight++, "00000000b552e9c7c51ed793f87c51b2cc945fbb222efd6cec17666a5ecd18a5", 1, "cb03db5029f426ed517fdfffd6a90c99a3111f2254f41f9a8f56320076b1f0e3", dungActionNext.GetValue1(), dungActionNext.GetValue2())); // var shifts = new Dictionary<long, Shift> // { // { // 1001, new Shift(0, 1530914381, pubMogAddressHex, // 1001, "00000000090d6c6b058227bb61ca2915a84998703d4444cc2641e6a0da4ba37e", // 2, "163d2e383c77765232be1d9ed5e06749a814de49b4c0a8aebf324c0e9e2fd1cf", // 1.00m, // 0.0001m) // }, // { // 1002, new Shift(1, 1535295740, pubMogAddressHex, // 1002, "0000000033dbfc3cc9f3671ba28b41ecab6f547219bb43174cc97bf23269fa88", // 1, "db5639553f9727c42f80c22311bd8025608edcfbcfc262c0c2afe9fc3f0bcb29", // 0.01040003m, // 0.00001002m) // }, // { // 1003, new Shift(2, pubMogAddressHex, // 1003, "0000000033dbfc3cc9f3671ba28b41ecab6f547219bb43174cc97bf2163d2e38") // }, // { // 1004, new Shift(3, pubMogAddressHex, // 1004, "0000000033dbfc163df3671ba28b41ecab6f547219bb43174cc97bf2164d2e38") // }, // { // 1005, new Shift(4, pubMogAddressHex, // 1005, "0000000033dbfc163de3671ba28b41ecab6f547219bb43174cc97bf2164d2e38") // }, // { // 1006, new Shift(5, pubMogAddressHex, // 1006, "0000000033dbfc163dc3671ba28b41ecab6f547219bb43174cc97bf2164d2e38") // }, // { // 1007, new Shift(6, pubMogAddressHex, // 1007, "0000000033dbfc163db3671ba28b41ecab6f547219bb43174cc97bf2164d2e38") // }, // { // 1008, new Shift(7, pubMogAddressHex, // 1008, "0000000033dbfc163def671ba28b41ecab6f547219bb43174cc97bf2164d2e38") // }, // { // 1009, new Shift(8, pubMogAddressHex, // 1009, "0000000033dbfc163dff671ba28b41ecab6f547219bb43174cc97bf2164d2e38") // }, // { // 1010, new Shift(9, 1555295740, pubMogAddressHex, // 1010, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", // 1, "cbcd39553f9727c434343222f1bd8025608edcfbcfc262c0c2afe9fc3f0bcb29", // lvlAction.GetValue1(), // lvlAction.GetValue2()) // }, // { // 1011, new Shift(10, pubMogAddressHex, // 1011, "0000000033dbfc163dff671ba28b41ecab6f547219bb43174cc97bf2164d2e38") // }, // { // 1012, new Shift(11, 1555299745, pubMogAddressHex, // 1012, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", // 1, "bbcd39553a9727c434343242f9bd8025608edcfbcfc262c0c2afe9fc3f0bcf29", // dungAction.GetValue1(), // dungAction.GetValue2()) // }, // { // 1013, new Shift(12, 1555309745, pubMogAddressHex, // 1013, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", // 1, "bbcd39553a9727c434343242f9bd8025608edcfbcfc262c0c2afe9fc3f0bdf29", // revivingAction.GetValue1(), // revivingAction.GetValue2()) // }, // { // 1014, new Shift(13, 1555329745, pubMogAddressHex, // 1014, "0000000044db5c3cc943271b324b31ecab6f547219bb43174cc97bf23269fa88", // 1, "bbcd39553a9727c434343242f9bd8025608edcfbcfc262c0c2afe9fc3f0bff29", // healAction.GetValue1(), // healAction.GetValue2()) // }, // { // 1015, new Shift(14, 1539810141, "328b742623b139b29553d0c2cc2c785ed8feff324a37a6bc41", // 75422, "000000004eb637ffbdb8674dbe5ff5c339a50b0dac1723f1df44b7b790746a6e", // 1, "7876fde772cae5684ad133a007c92f5f209cc91fdc1814fe3dab2c6174557ea7", // 0.01042002m, // 0.00020002m) // } //}; var mogwai = new Mogwai("MJHYMxu2kyR1Bi4pYwktbeCM7yjZyVxt2i", shifts); return(new MogwaiKeys { Mogwai = mogwai, Balance = 2.1234m, IsUnwatched = false, LastUpdated = DateTime.Now, MogwaiKeysState = MogwaiKeysState.Bound, Shifts = shifts }); }