detect backnotarisation by KMD symbol

This commit is contained in:
Scott Sadler
2018-05-27 11:03:38 -03:00
parent 9de5ae87cf
commit f937f44e10
3 changed files with 26 additions and 1 deletions

View File

@@ -10,7 +10,8 @@ komodo_test_SOURCES = \
test-komodo/test_coinimport.cpp \
test-komodo/test_eval_bet.cpp \
test-komodo/test_eval_notarisation.cpp \
test-komodo/test_crosschain.cpp
test-komodo/test_crosschain.cpp \
test-komodo/test_parse_notarisation.cpp
komodo_test_CPPFLAGS = $(komodod_CPPFLAGS)

View File

@@ -182,6 +182,7 @@ public:
{
if (ASSETCHAINS_SYMBOL[0]) return 1;
if (s.size() >= 72 && strcmp("BTC", &s[68]) == 0) return 1;
if (s.size() >= 72 && strcmp("KMD", &s[68]) == 0) return 1;
return 0;
}

View File

@@ -0,0 +1,23 @@
#include <gtest/gtest.h>
#include "cc/eval.h"
#include "core_io.h"
#include "key.h"
#include "testutils.h"
namespace TestParseNotarisation {
class TestParseNotarisation : public ::testing::Test, public Eval {};
TEST(TestParseNotarisation, test_ee2fa)
{
// ee2fa47820a31a979f9f21cb3fedbc484bf9a8957cb6c9acd0af28ced29bdfe1
std::vector<uint8_t> opret = ParseHex("c349ff90f3bce62c1b7b49d1da0423b1a3d9b733130cce825b95b9e047c729066e020d00743a06fdb95ad5775d032b30bbb3680dac2091a0f800cf54c79fd3461ce9b31d4b4d4400");
NotarisationData nd;
ASSERT_TRUE(E_UNMARSHAL(opret, ss >> nd));
}
}