Skip to content

Commit

Permalink
feat: data null
Browse files Browse the repository at this point in the history
  • Loading branch information
AbigailDeng authored and AbigailDeng committed Sep 29, 2024
1 parent 5a989ac commit 910cb0e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/contract/contractMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,26 +328,32 @@ export default class ContractMethod {
const url = 'gateway/sendUserSignedMultiTransaction';
if (argsObject.isSync) {
const params = this.multiPrepareParameters(args);
const { data } = httpProvider.send({
const { data, message, code } = httpProvider.send({
url,
method: 'POST',
params: {
RawMultiTransaction: params
}
});
return data;
if (data != null && code === 200) {
return data;
}
throw new Error(message);
}
// eslint-disable-next-line arrow-body-style
return this.multiPrepareParametersAsync(args).then(async params => {
const { data } = await httpProvider.sendAsync({
const { data, message, code } = await httpProvider.sendAsync({
url,
method: 'POST',
params: {
RawMultiTransaction: params
}
});
argsObject.callback(data);
return data;
if (data != null && code === 200) {
argsObject.callback(data);
return data;
}
throw new Error(message);
});
}

Expand Down

0 comments on commit 910cb0e

Please sign in to comment.