Add BufferReader to Transaction and fix tests

This commit is contained in:
junderw 2020-01-15 10:50:33 +09:00
parent 91e6c8abc3
commit 06674b19fe
No known key found for this signature in database
GPG key ID: B256185D3A971908
5 changed files with 40 additions and 113 deletions

View file

@ -52,7 +52,7 @@ export function reverseBuffer(buffer: Buffer): Buffer {
* Helper class for serialization of bitcoin data types into a pre-allocated buffer.
*/
export class BufferWriter {
constructor(private buffer: Buffer, public offset: number = 0) {
constructor(public buffer: Buffer, public offset: number = 0) {
typeforce(types.tuple(types.Buffer, types.UInt32), [buffer, offset]);
}
@ -96,7 +96,7 @@ export class BufferWriter {
* Helper class for serialization of bitcoin data types into a pre-allocated buffer.
*/
export class BufferReader {
constructor(private buffer: Buffer, public offset: number = 0) {
constructor(public buffer: Buffer, public offset: number = 0) {
typeforce(types.tuple(types.Buffer, types.UInt32), [buffer, offset]);
}