|
|
@ -1,19 +1,11 @@ |
|
|
|
"use strict"; |
|
|
|
"use strict"; |
|
|
|
import TransactionBase from "../TransactionBase.js" |
|
|
|
import TransactionBase from "../TransactionBase.js" |
|
|
|
|
|
|
|
import { QORT_DECIMALS } from "../../constants.js" |
|
|
|
|
|
|
|
|
|
|
|
export default class CreateGroupTransaction extends TransactionBase { |
|
|
|
export default class CreateGroupTransaction extends TransactionBase { |
|
|
|
constructor() { |
|
|
|
constructor() { |
|
|
|
super() |
|
|
|
super() |
|
|
|
this.type = 22 |
|
|
|
this.type = 22 |
|
|
|
this.fee = 0.001 |
|
|
|
|
|
|
|
// this.tests.push(
|
|
|
|
|
|
|
|
// () => {
|
|
|
|
|
|
|
|
// if (!(this._registrantAddress instanceof Uint8Array && this._registrantAddress.length == 25)) {
|
|
|
|
|
|
|
|
// return "Invalid Registrant " + Base58.encode(this._registrantAddress)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return true
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// )
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render(html) { |
|
|
|
render(html) { |
|
|
@ -30,20 +22,19 @@ export default class CreateGroupTransaction extends TransactionBase { |
|
|
|
` |
|
|
|
` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// set registrantAddress(registrantAddress) {
|
|
|
|
set fee(fee) { |
|
|
|
// this._registrantAddress = registrantAddress instanceof Uint8Array ? registrantAddress : this.constructor.Base58.decode(registrantAddress);
|
|
|
|
this._fee = fee * QORT_DECIMALS |
|
|
|
// }
|
|
|
|
this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
set rGroupName(rGroupName) { |
|
|
|
set rGroupName(rGroupName) { |
|
|
|
this._rGroupName = rGroupName; |
|
|
|
this._rGroupName = rGroupName; |
|
|
|
|
|
|
|
|
|
|
|
this._rGroupNameBytes = this.constructor.utils.stringtoUTF8Array(this._rGroupName.toLocaleLowerCase()) |
|
|
|
this._rGroupNameBytes = this.constructor.utils.stringtoUTF8Array(this._rGroupName.toLocaleLowerCase()) |
|
|
|
this._rGroupNameLength = this.constructor.utils.int32ToBytes(this._rGroupNameBytes.length) |
|
|
|
this._rGroupNameLength = this.constructor.utils.int32ToBytes(this._rGroupNameBytes.length) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
set rGroupDesc(rGroupDesc) { |
|
|
|
set rGroupDesc(rGroupDesc) { |
|
|
|
this._rGroupDesc = rGroupDesc; |
|
|
|
this._rGroupDesc = rGroupDesc; |
|
|
|
|
|
|
|
|
|
|
|
this._rGroupDescBytes = this.constructor.utils.stringtoUTF8Array(this._rGroupDesc.toLocaleLowerCase()) |
|
|
|
this._rGroupDescBytes = this.constructor.utils.stringtoUTF8Array(this._rGroupDesc.toLocaleLowerCase()) |
|
|
|
this._rGroupDescLength = this.constructor.utils.int32ToBytes(this._rGroupDescBytes.length) |
|
|
|
this._rGroupDescLength = this.constructor.utils.int32ToBytes(this._rGroupDescBytes.length) |
|
|
|
} |
|
|
|
} |
|
|
@ -61,20 +52,17 @@ export default class CreateGroupTransaction extends TransactionBase { |
|
|
|
|
|
|
|
|
|
|
|
set rGroupMinimumBlockDelay(rGroupMinimumBlockDelay) { |
|
|
|
set rGroupMinimumBlockDelay(rGroupMinimumBlockDelay) { |
|
|
|
this._rGroupMinimumBlockDelay = rGroupMinimumBlockDelay; |
|
|
|
this._rGroupMinimumBlockDelay = rGroupMinimumBlockDelay; |
|
|
|
|
|
|
|
|
|
|
|
this._rGroupMinimumBlockDelayBytes = this.constructor.utils.int32ToBytes(this._rGroupMinimumBlockDelay) |
|
|
|
this._rGroupMinimumBlockDelayBytes = this.constructor.utils.int32ToBytes(this._rGroupMinimumBlockDelay) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
set rGroupMaximumBlockDelay(rGroupMaximumBlockDelay) { |
|
|
|
set rGroupMaximumBlockDelay(rGroupMaximumBlockDelay) { |
|
|
|
this._rGroupMaximumBlockDelay = rGroupMaximumBlockDelay; |
|
|
|
this._rGroupMaximumBlockDelay = rGroupMaximumBlockDelay; |
|
|
|
|
|
|
|
|
|
|
|
this._rGroupMaximumBlockDelayBytes = this.constructor.utils.int32ToBytes(this._rGroupMaximumBlockDelay) |
|
|
|
this._rGroupMaximumBlockDelayBytes = this.constructor.utils.int32ToBytes(this._rGroupMaximumBlockDelay) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
get params() { |
|
|
|
get params() { |
|
|
|
const params = super.params; |
|
|
|
const params = super.params; |
|
|
|
params.push( |
|
|
|
params.push( |
|
|
|
// this._registrantAddress,
|
|
|
|
|
|
|
|
this._rGroupNameLength, |
|
|
|
this._rGroupNameLength, |
|
|
|
this._rGroupNameBytes, |
|
|
|
this._rGroupNameBytes, |
|
|
|
this._rGroupDescLength, |
|
|
|
this._rGroupDescLength, |
|
|
|