add docs to file append transaction
@@ -5,11 +5,16 @@ import (
"time"
)
+// FileAppendTransaction appends the given contents to the end of the file. If a file is too big to create with a single
+// FileCreateTransaction, then it can be created with the first part of its contents, and then appended multiple times
+// to create the entire file.
type FileAppendTransaction struct {
TransactionBuilder
pb *proto.FileAppendTransactionBody
}
+// NewFileAppendTransaction creates a FileAppendTransaction builder which can be
+// used to construct and execute a File Append Transaction.
func NewFileAppendTransaction() FileAppendTransaction {
pb := &proto.FileAppendTransactionBody{}
@@ -21,11 +26,13 @@ func NewFileAppendTransaction() FileAppendTransaction {
return builder
}
+// SetFileID sets the FileID of the file to which the bytes are appended to.
func (builder FileAppendTransaction) SetFileID(id FileID) FileAppendTransaction {
builder.pb.FileID = id.toProto()
return builder
}
+// SetContents sets the bytes to append to the contents of the file.
func (builder FileAppendTransaction) SetContents(contents []byte) FileAppendTransaction {
builder.pb.Contents = contents
return builder
