Pass chain params explicitely to EncodeSecret and DecodeSecret
Summary: As per title. In general, we want to avoid snooping on global state implicitely.
Test Plan: Added unit tests for the new functions.
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D8780