guardian Set Index stored at global var now.
This commit is contained in:
parent
8bd8218d2d
commit
b93fe26905
|
@ -1,3 +1,10 @@
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Pricecaster Service Utility Library.
|
||||||
|
* (c) 2021-22 Randlabs, Inc.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
const algosdk = require('algosdk')
|
const algosdk = require('algosdk')
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
// eslint-disable-next-line camelcase
|
// eslint-disable-next-line camelcase
|
||||||
|
@ -231,7 +238,7 @@ class PricecasterLib {
|
||||||
this.createVaaProcessorApp = async function (sender, gexpTime, gkeys, signCallback) {
|
this.createVaaProcessorApp = async function (sender, gexpTime, gkeys, signCallback) {
|
||||||
const localInts = 0
|
const localInts = 0
|
||||||
const localBytes = 0
|
const localBytes = 0
|
||||||
const globalInts = 2
|
const globalInts = 4
|
||||||
const globalBytes = 20
|
const globalBytes = 20
|
||||||
|
|
||||||
// declare onComplete as NoOp
|
// declare onComplete as NoOp
|
||||||
|
@ -544,7 +551,7 @@ class PricecasterLib {
|
||||||
* @param {*} gksubset An hex string containing the keys for the guardian subset in this step.
|
* @param {*} gksubset An hex string containing the keys for the guardian subset in this step.
|
||||||
* @param {*} totalguardians The total number of known guardians.
|
* @param {*} totalguardians The total number of known guardians.
|
||||||
*/
|
*/
|
||||||
this.addVerifyTx = async function (sender, payload, gksubset, totalguardians) {
|
this.addVerifyTx = function (sender, payload, gksubset, totalguardians) {
|
||||||
const appArgs = []
|
const appArgs = []
|
||||||
appArgs.push(new Uint8Array(Buffer.from(gksubset, 'hex')), algosdk.encodeUint64(parseInt(totalguardians)))
|
appArgs.push(new Uint8Array(Buffer.from(gksubset, 'hex')), algosdk.encodeUint64(parseInt(totalguardians)))
|
||||||
this.groupTx.push(algosdk.makeApplicationNoOpTxn(sender,
|
this.groupTx.push(algosdk.makeApplicationNoOpTxn(sender,
|
||||||
|
|
|
@ -77,8 +77,10 @@ VAA_RECORD_EMITTER_ADDR_LEN = 32
|
||||||
|
|
||||||
|
|
||||||
@Subroutine(TealType.uint64)
|
@Subroutine(TealType.uint64)
|
||||||
# Bootstrap with the initial list of guardians packed in first argument.
|
# Arg0: Bootstrap with the initial list of guardians packed.
|
||||||
# Expiration time in second argument.
|
# Arg1: Expiration time in second argument.
|
||||||
|
# Arg2: Guardian set Index.
|
||||||
|
#
|
||||||
# Guardian public keys are 20-bytes wide, so
|
# Guardian public keys are 20-bytes wide, so
|
||||||
# using arguments a maximum 1000/20 ~ 200 public keys can be specified in this version.
|
# using arguments a maximum 1000/20 ~ 200 public keys can be specified in this version.
|
||||||
def bootstrap():
|
def bootstrap():
|
||||||
|
@ -97,6 +99,7 @@ def bootstrap():
|
||||||
),
|
),
|
||||||
App.globalPut(Bytes("gscount"), guardian_count.load()),
|
App.globalPut(Bytes("gscount"), guardian_count.load()),
|
||||||
App.globalPut(Bytes("gsexp"), Btoi(Txn.application_args[1])),
|
App.globalPut(Bytes("gsexp"), Btoi(Txn.application_args[1])),
|
||||||
|
App.globalPut(Bytes("gsindex"), Btoi(Txn.application_args[2])),
|
||||||
App.globalPut(Bytes("vssize"), Int(MAX_SIGNATURES_PER_VERIFICATION_STEP)),
|
App.globalPut(Bytes("vssize"), Int(MAX_SIGNATURES_PER_VERIFICATION_STEP)),
|
||||||
Approve()
|
Approve()
|
||||||
])
|
])
|
||||||
|
|
Loading…
Reference in New Issue