1
This commit is contained in:
parent
073fdb018d
commit
1d0b6e42dc
@ -11,6 +11,8 @@ async function buy(session) {
|
||||
const seller = bcutils.toNormalAddress(session.request('seller', ''));
|
||||
const netId = session.request('net_id');
|
||||
const price = session.request('price');
|
||||
const currencyName = session.request('currency_name');
|
||||
const orderId = session.request('order_id');
|
||||
const bc = serviceFactory.create('BlockChain');
|
||||
{
|
||||
const ret = await bc.init(netId);
|
||||
@ -32,11 +34,11 @@ async function buy(session) {
|
||||
}
|
||||
}
|
||||
|
||||
const currency = bc.getContractAddressByName(contract.CEG_INSTANCE_NAME);
|
||||
const currency = bc.getCurrencyAddressByName(currencyName);
|
||||
const userAddress = bc.getUserAddress();
|
||||
{
|
||||
if (!bc.isValidAddress(currency)) {
|
||||
session.rspErr(500, 'ceg error');
|
||||
session.rspErr(500, 'currency error');
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -66,7 +68,6 @@ async function buy(session) {
|
||||
['trans_id', transId]
|
||||
]);
|
||||
const nonce = transId;
|
||||
const orderId = transId;
|
||||
const signature = await bc.soliditySha3Sign(
|
||||
account,
|
||||
seller,
|
||||
|
Loading…
x
Reference in New Issue
Block a user