interest: refactor nonce handling

Nonce is a sequence of 4 bytes, not a 32-bit unsigned integer.
This also fixes various endianness bugs in unit tests.

Refs: #3294
Change-Id: I057b7b771fecb0bc997b0b11a03e6660c9b7a826
diff --git a/tests/make-interest-data.hpp b/tests/make-interest-data.hpp
index 10381fd..2d12011 100644
--- a/tests/make-interest-data.hpp
+++ b/tests/make-interest-data.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2019 Regents of the University of California.
+ * Copyright (c) 2013-2020 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -24,21 +24,17 @@
 
 #include "ndn-cxx/data.hpp"
 #include "ndn-cxx/interest.hpp"
-#include "ndn-cxx/link.hpp"
 #include "ndn-cxx/lp/nack.hpp"
 
 namespace ndn {
 namespace tests {
 
 /** \brief create an Interest
- *  \param name Interest name
- *  \param canBePrefix CanBePrefix setting
- *  \param lifetime InterestLifetime
- *  \param nonce if non-zero, set Nonce to this value (useful for creating Nack with same Nonce)
  */
 shared_ptr<Interest>
 makeInterest(const Name& name, bool canBePrefix = false,
-             time::milliseconds lifetime = DEFAULT_INTEREST_LIFETIME, uint32_t nonce = 0);
+             time::milliseconds lifetime = DEFAULT_INTEREST_LIFETIME,
+             optional<Interest::Nonce> nonce = nullopt);
 
 /** \brief create a Data with fake signature
  *  \note Data may be modified afterwards without losing the fake signature.
@@ -62,11 +58,9 @@
 }
 
 /** \brief create a Nack
- *  \param interest Interest
- *  \param reason Nack reason
  */
 lp::Nack
-makeNack(const Interest& interest, lp::NackReason reason);
+makeNack(Interest interest, lp::NackReason reason);
 
 /** \brief replace a name component in a packet
  *  \param[inout] pkt the packet