<p>Another way I have thought about this refactor and why I think it is a good path moving forward is that all of these instance methods are equivalent to just testable static methods that operate on final variables. For example, you could just have a bunch of helper functions that look like this:</p>
<pre><code>public static void isValidForAddOperation(ProtectedStorageEntry entry) {
  // check signature
  Sig.verify(entry.getPubKey(), hash(entry.getProtectedPayload()))

// check key matches... etc...
}
</code></pre>
<p>BUT, by using them as instance methods you get the benefit of being able to mock them easily for testing which I think outweighs the anxiety around hiding these checks behind an interface. It may make sense in the future to guarantee that these types of functions only operate on <code>final</code> variables so they are equivalent to static methods with test benefits.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/3583?email_source=notifications&email_token=AJFFTNWOOS4JBWELYINPM4LQT3NBPA5CNFSM4JLCP7CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEGFLRQ#issuecomment-554456518">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNVPM35SR7QNFF7TMZDQT3NBPANCNFSM4JLCP7CA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNV4X3K2LW5NKOL5Z7DQT3NBPA5CNFSM4JLCP7CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEGFLRQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/3583?email_source=notifications\u0026email_token=AJFFTNWOOS4JBWELYINPM4LQT3NBPA5CNFSM4JLCP7CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEGFLRQ#issuecomment-554456518",
"url": "https://github.com/bisq-network/bisq/pull/3583?email_source=notifications\u0026email_token=AJFFTNWOOS4JBWELYINPM4LQT3NBPA5CNFSM4JLCP7CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEGFLRQ#issuecomment-554456518",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>