修正一些流程上的bug
This commit is contained in:
parent
04a5efc13d
commit
9c7d0af9c1
22558
src/abis/ERC20.json
22558
src/abis/ERC20.json
File diff suppressed because one or more lines are too long
@ -65,14 +65,15 @@ export class BlockChain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async generateFunAbi(reqData: any) {
|
public async generateFunAbi(reqData: any) {
|
||||||
let taskType = reqData.type
|
let taskType = parseInt(reqData.type)
|
||||||
|
reqData.encodeABI = true
|
||||||
let abi
|
let abi
|
||||||
switch (taskType) {
|
switch (taskType) {
|
||||||
case TaskType.MINT_FT:
|
case TaskType.MINT_FT:
|
||||||
abi = await this.erc20Reactor.mint(reqData)
|
abi = await this.erc20Reactor.mint(reqData)
|
||||||
break
|
break
|
||||||
case TaskType.MINT_NFT:
|
case TaskType.MINT_NFT:
|
||||||
abi = await this.erc721Reactor.batchMint(reqData)
|
abi = await this.erc721Reactor.mint(reqData)
|
||||||
break
|
break
|
||||||
case TaskType.TRANSFER_FT:
|
case TaskType.TRANSFER_FT:
|
||||||
abi = await this.erc20Reactor.transfer(reqData)
|
abi = await this.erc20Reactor.transfer(reqData)
|
||||||
|
@ -98,7 +98,7 @@ export class WalletReactor {
|
|||||||
genOperation({ targets, values, datas, predecessor, salt }: IOperationData): IOperationData {
|
genOperation({ targets, values, datas, predecessor, salt }: IOperationData): IOperationData {
|
||||||
const scheduleId = this.web3.utils.keccak256(
|
const scheduleId = this.web3.utils.keccak256(
|
||||||
this.web3.eth.abi.encodeParameters(
|
this.web3.eth.abi.encodeParameters(
|
||||||
['[address]', '[uint256]', '[bytes]', 'uint256', 'bytes32'],
|
['address[]', 'uint256[]', 'bytes[]', 'uint256', 'bytes32'],
|
||||||
[targets, values, datas, predecessor, salt],
|
[targets, values, datas, predecessor, salt],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -48,10 +48,12 @@ class WorkFlowController extends BaseController {
|
|||||||
@role('anon')
|
@role('anon')
|
||||||
@router('get /workflow/test')
|
@router('get /workflow/test')
|
||||||
async test(req, res) {
|
async test(req, res) {
|
||||||
let file_path = '/Users/zhl/Documents/workspace/tools/excel2json/test.xlsx'
|
// let file_path = '/Users/zhl/Documents/workspace/tools/excel2json/test.xlsx'
|
||||||
let fileId = 'WWME_g-oYEAAAzSUkPNpznkoGbgD2f1bDCA.xlsx'
|
// let fileId = 'WWME_g-oYEAAAzSUkPNpznkoGbgD2f1bDCA.xlsx'
|
||||||
await new WechatWorkService().fetchFile(fileId)
|
// await new WechatWorkService().fetchFile(fileId)
|
||||||
console.log('11')
|
// console.log('11')
|
||||||
|
let spNo = '202304070010'
|
||||||
|
new TaskQueue().addTaskToQueue(spNo)
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ export class ChainTaskClass extends BaseModule {
|
|||||||
predecessor: ZERO_BYTES32,
|
predecessor: ZERO_BYTES32,
|
||||||
salt: generateRandomBytes32(),
|
salt: generateRandomBytes32(),
|
||||||
})
|
})
|
||||||
subTasks.push(subTasks)
|
subTasks.push(subTask)
|
||||||
}
|
}
|
||||||
subTask.reqDatas.push(sub)
|
subTask.reqDatas.push(sub)
|
||||||
subTask.targets.push(sub.address)
|
subTask.targets.push(sub.address)
|
||||||
|
@ -45,7 +45,7 @@ export class RequestTaskClass extends BaseModule {
|
|||||||
public maxTryCount: number
|
public maxTryCount: number
|
||||||
|
|
||||||
@prop({ type: mongoose.Schema.Types.Mixed })
|
@prop({ type: mongoose.Schema.Types.Mixed })
|
||||||
public reqData: any
|
public reqDatas: any
|
||||||
|
|
||||||
@prop({ enum: ReqTaskStatus, default: ReqTaskStatus.NOTSTART })
|
@prop({ enum: ReqTaskStatus, default: ReqTaskStatus.NOTSTART })
|
||||||
public status: ReqTaskStatus
|
public status: ReqTaskStatus
|
||||||
|
@ -9,7 +9,7 @@ export function queryNftTxCount(address: string) {
|
|||||||
id: 1,
|
id: 1,
|
||||||
params: ['token_transfer_tx', address],
|
params: ['token_transfer_tx', address],
|
||||||
}
|
}
|
||||||
let url = `${process.env.RANGERS_RPC_URL}`
|
let url = `${process.env.EXPLOR_RPC_URL}`
|
||||||
let reqConfig: any = {
|
let reqConfig: any = {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url,
|
url,
|
||||||
@ -28,7 +28,7 @@ export function queryNftTx(address: string, page: number, limit: number = 100) {
|
|||||||
id: 1,
|
id: 1,
|
||||||
params: ['token_transfer_tx', page, limit, address],
|
params: ['token_transfer_tx', page, limit, address],
|
||||||
}
|
}
|
||||||
let url = `${process.env.RANGERS_RPC_URL}`
|
let url = `${process.env.EXPLOR_RPC_URL}`
|
||||||
let reqConfig: any = {
|
let reqConfig: any = {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
url,
|
url,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { renderFromTokenMinimalUnit } from './number.util'
|
import { renderFromTokenMinimalUnit } from './number.util'
|
||||||
|
import { asciiToHex } from 'web3-utils'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes IPFS protocol prefix from input string.
|
* Removes IPFS protocol prefix from input string.
|
||||||
@ -120,5 +121,5 @@ export function formatMoney(balance: number | string, symbol: string) {
|
|||||||
export function generateRandomBytes32() {
|
export function generateRandomBytes32() {
|
||||||
const v1 = (Math.random() * 9000000 + 1000000) | 0
|
const v1 = (Math.random() * 9000000 + 1000000) | 0
|
||||||
const v2 = (Math.random() * 900000 + 100000) | 0
|
const v2 = (Math.random() * 900000 + 100000) | 0
|
||||||
return this.web3.utils.asciiToHex(v1 + '' + v2)
|
return asciiToHex(v1 + '' + v2)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user