@@ -20,6 +20,7 @@ type ContractCreateTransaction struct {
2020 gas int64
2121 initialBalance int64
2222 autoRenewPeriod * time.Duration
23+ autoRenewPeriodSeconds * int64
2324 parameters []byte
2425 memo string
2526 initcode []byte
@@ -175,13 +176,24 @@ func (tx *ContractCreateTransaction) GetInitialBalance() Hbar {
175176func (tx * ContractCreateTransaction ) SetAutoRenewPeriod (autoRenewPeriod time.Duration ) * ContractCreateTransaction {
176177 tx ._RequireNotFrozen ()
177178 tx .autoRenewPeriod = & autoRenewPeriod
179+ tx .autoRenewPeriodSeconds = nil
180+ return tx
181+ }
182+
183+ func (tx * ContractCreateTransaction ) SetAutoRenewPeriodSeconds (autoRenewPeriod int64 ) * ContractCreateTransaction {
184+ tx ._RequireNotFrozen ()
185+ tx .autoRenewPeriodSeconds = & autoRenewPeriod
186+ tx .autoRenewPeriod = nil
178187 return tx
179188}
180189
181190func (tx * ContractCreateTransaction ) GetAutoRenewPeriod () time.Duration {
182191 if tx .autoRenewPeriod != nil {
183192 return * tx .autoRenewPeriod
184193 }
194+ if tx .autoRenewPeriodSeconds != nil {
195+ return time .Duration (* tx .autoRenewPeriodSeconds ) * time .Second
196+ }
185197
186198 return time .Duration (0 )
187199}
@@ -273,6 +285,7 @@ func (tx *ContractCreateTransaction) GetMaxAutomaticTokenAssociations() int32 {
273285func (tx * ContractCreateTransaction ) SetStakedAccountID (id AccountID ) * ContractCreateTransaction {
274286 tx ._RequireNotFrozen ()
275287 tx .stakedAccountID = & id
288+ tx .stakedNodeID = nil
276289 return tx
277290}
278291
@@ -289,6 +302,7 @@ func (tx *ContractCreateTransaction) GetStakedAccountID() AccountID {
289302func (tx * ContractCreateTransaction ) SetStakedNodeID (id int64 ) * ContractCreateTransaction {
290303 tx ._RequireNotFrozen ()
291304 tx .stakedNodeID = & id
305+ tx .stakedAccountID = nil
292306 return tx
293307}
294308
@@ -376,13 +390,19 @@ func (tx ContractCreateTransaction) buildProtoBody() *services.ContractCreateTra
376390 body .AutoRenewPeriod = _DurationToProtobuf (* tx .autoRenewPeriod )
377391 }
378392
393+ if tx .autoRenewPeriodSeconds != nil {
394+ body .AutoRenewPeriod = & services.Duration {
395+ Seconds : * tx .autoRenewPeriodSeconds ,
396+ }
397+ }
398+
379399 if tx .adminKey != nil {
380400 body .AdminKey = tx .adminKey ._ToProtoKey ()
381401 }
382402
383403 if tx .byteCodeFileID != nil {
384404 body .InitcodeSource = & services.ContractCreateTransactionBody_FileID {FileID : tx .byteCodeFileID ._ToProtobuf ()}
385- } else if len ( tx .initcode ) != 0 {
405+ } else if tx .initcode != nil {
386406 body .InitcodeSource = & services.ContractCreateTransactionBody_Initcode {Initcode : tx .initcode }
387407 }
388408
0 commit comments