修正一些流程上的bug

This commit is contained in:
zhl 2023-04-07 17:26:27 +08:00
parent 04a5efc13d
commit 9c7d0af9c1
8 changed files with 4979 additions and 17577 deletions

File diff suppressed because one or more lines are too long

View File

@ -65,14 +65,15 @@ export class BlockChain {
}
public async generateFunAbi(reqData: any) {
let taskType = reqData.type
let taskType = parseInt(reqData.type)
reqData.encodeABI = true
let abi
switch (taskType) {
case TaskType.MINT_FT:
abi = await this.erc20Reactor.mint(reqData)
break
case TaskType.MINT_NFT:
abi = await this.erc721Reactor.batchMint(reqData)
abi = await this.erc721Reactor.mint(reqData)
break
case TaskType.TRANSFER_FT:
abi = await this.erc20Reactor.transfer(reqData)

View File

@ -98,7 +98,7 @@ export class WalletReactor {
genOperation({ targets, values, datas, predecessor, salt }: IOperationData): IOperationData {
const scheduleId = this.web3.utils.keccak256(
this.web3.eth.abi.encodeParameters(
['[address]', '[uint256]', '[bytes]', 'uint256', 'bytes32'],
['address[]', 'uint256[]', 'bytes[]', 'uint256', 'bytes32'],
[targets, values, datas, predecessor, salt],
),
)

View File

@ -48,10 +48,12 @@ class WorkFlowController extends BaseController {
@role('anon')
@router('get /workflow/test')
async test(req, res) {
let file_path = '/Users/zhl/Documents/workspace/tools/excel2json/test.xlsx'
let fileId = 'WWME_g-oYEAAAzSUkPNpznkoGbgD2f1bDCA.xlsx'
await new WechatWorkService().fetchFile(fileId)
console.log('11')
// let file_path = '/Users/zhl/Documents/workspace/tools/excel2json/test.xlsx'
// let fileId = 'WWME_g-oYEAAAzSUkPNpznkoGbgD2f1bDCA.xlsx'
// await new WechatWorkService().fetchFile(fileId)
// console.log('11')
let spNo = '202304070010'
new TaskQueue().addTaskToQueue(spNo)
return {}
}
}

View File

@ -128,7 +128,7 @@ export class ChainTaskClass extends BaseModule {
predecessor: ZERO_BYTES32,
salt: generateRandomBytes32(),
})
subTasks.push(subTasks)
subTasks.push(subTask)
}
subTask.reqDatas.push(sub)
subTask.targets.push(sub.address)

View File

@ -45,7 +45,7 @@ export class RequestTaskClass extends BaseModule {
public maxTryCount: number
@prop({ type: mongoose.Schema.Types.Mixed })
public reqData: any
public reqDatas: any
@prop({ enum: ReqTaskStatus, default: ReqTaskStatus.NOTSTART })
public status: ReqTaskStatus

View File

@ -9,7 +9,7 @@ export function queryNftTxCount(address: string) {
id: 1,
params: ['token_transfer_tx', address],
}
let url = `${process.env.RANGERS_RPC_URL}`
let url = `${process.env.EXPLOR_RPC_URL}`
let reqConfig: any = {
method: 'post',
url,
@ -28,7 +28,7 @@ export function queryNftTx(address: string, page: number, limit: number = 100) {
id: 1,
params: ['token_transfer_tx', page, limit, address],
}
let url = `${process.env.RANGERS_RPC_URL}`
let url = `${process.env.EXPLOR_RPC_URL}`
let reqConfig: any = {
method: 'post',
url,

View File

@ -1,4 +1,5 @@
import { renderFromTokenMinimalUnit } from './number.util'
import { asciiToHex } from 'web3-utils'
/**
* Removes IPFS protocol prefix from input string.
@ -120,5 +121,5 @@ export function formatMoney(balance: number | string, symbol: string) {
export function generateRandomBytes32() {
const v1 = (Math.random() * 9000000 + 1000000) | 0
const v2 = (Math.random() * 900000 + 100000) | 0
return this.web3.utils.asciiToHex(v1 + '' + v2)
return asciiToHex(v1 + '' + v2)
}