Refactor Tx, Validator, and Account structure

This commit is contained in:
Jae Kwon
2014-12-09 18:49:04 -08:00
parent 4424a85fbd
commit 83d313cbe5
56 changed files with 1922 additions and 2027 deletions

View File

@ -4,9 +4,9 @@ import "io"
// String
func WriteString(w io.Writer, s string, n *int64, err *error) {
WriteUInt32(w, uint32(len(s)), n, err)
WriteTo(w, []byte(s), n, err)
func WriteString(s string, w io.Writer, n *int64, err *error) {
WriteUInt32(uint32(len(s)), w, n, err)
WriteTo([]byte(s), w, n, err)
}
func ReadString(r io.Reader, n *int64, err *error) string {
@ -15,6 +15,6 @@ func ReadString(r io.Reader, n *int64, err *error) string {
return ""
}
buf := make([]byte, int(length))
ReadFull(r, buf, n, err)
ReadFull(buf, r, n, err)
return string(buf)
}