Skip to content

Commit

Permalink
Merge pull request #1045 from bitholla/testnet
Browse files Browse the repository at this point in the history
Testnet
  • Loading branch information
abeikverdi committed Nov 11, 2021
2 parents 4eca7b4 + 0984b01 commit 6e76950
Show file tree
Hide file tree
Showing 114 changed files with 2,347 additions and 1,310 deletions.
18 changes: 18 additions & 0 deletions Dockerfile.webtest
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:10.15.3-stretch-slim

RUN apt-get update && \
apt-get install -y --no-install-recommends git python build-essential && \
rm -rf /var/lib/apt/lists/* && \
npm config set unsafe-perm true && \
npm install mocha -g --loglevel=error

ENV NODE_ENV=production

COPY . /app

WORKDIR /app

RUN npm install --save chai

ENTRYPOINT ["mocha"]
CMD ["test/selenium/Scenario/newUser.js"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Join us on the [Forum](https://forum.hollaex.com) and [Discord](https://discord.

## Useful Links

- Exchange Dashboard: https://dash.bitholla.com
- Exchange Dashboard: https://dash.hollaex.com
- HollaEx Whitepaper: https://hollaex.com/docs/whitepaper.html
- HollaEx Live Exchange: https://hollaex.com
- Discord Community: https://discord.gg/RkRHU8RbyM
Expand Down
47 changes: 45 additions & 2 deletions server/api/controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { loggerAdmin } = require('../../config/logger');
const toolsLib = require('hollaex-tools-lib');
const { cloneDeep } = require('lodash');
const { cloneDeep, pick } = require('lodash');
const { all } = require('bluebird');
const { USER_NOT_FOUND } = require('../../messages');
const { sendEmail } = require('../../mail');
Expand Down Expand Up @@ -1739,6 +1739,48 @@ const getNetworkPairs = (req, res) => {
});
};

const putUserInfo = (req, res) => {
loggerAdmin.verbose(
req.uuid,
'controllers/admin/putUserInfo auth',
req.auth
);

const user_id = req.swagger.params.user_id.value;
const updateData = pick(
req.swagger.params.data.value,
[
'full_name',
'gender',
'nationality',
'phone_number',
'dob',
'address'
]
);

loggerAdmin.info(
req.uuid,
'controllers/admin/putUserInfo user_id:',
user_id,
'updateData:',
updateData
);

toolsLib.user.updateUserInfo(user_id, updateData)
.then((data) => {
return res.json(data);
})
.catch((err) => {
loggerAdmin.error(
req.uuid,
'controllers/admin/putUserInfo err',
err.message
);
return res.status(err.statusCode || 400).json({ message: errorMessageConverter(err) });
});
};

module.exports = {
createInitialAdmin,
getAdminKit,
Expand Down Expand Up @@ -1781,5 +1823,6 @@ module.exports = {
getExchange,
getNetworkCoins,
getNetworkPairs,
updateExchange
updateExchange,
putUserInfo
};
56 changes: 55 additions & 1 deletion server/api/swagger/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
swagger: "2.0"
info:
version: "2.2.2"
version: "2.2.3"
title: HollaEx Kit
host: api.hollaex.com
basePath: /v2
Expand Down Expand Up @@ -2809,6 +2809,60 @@ paths:
- supervisor
- support
- kyc
/admin/user:
x-swagger-router-controller: admin
put:
operationId: putUserInfo
description: Update a user's info
tags:
- Admin
parameters:
- name: user_id
in: query
required: true
type: integer
- name: data
in: body
required: true
schema:
type: object
properties:
full_name:
type: string
gender:
type: boolean
nationality:
type: string
phone_number:
type: string
dob:
type: ['string', 'null']
format: date-time
address:
type: object
properties:
country:
type: string
address:
type: string
postal_code:
type: string
city:
type: string
responses:
200:
description: Success
schema:
$ref: "#/definitions/UserResponse"
default:
description: Error
schema:
$ref: "#/definitions/MessageResponse"
security:
- Bearer: []
x-security-scopes:
- admin
- supervisor
/admin/user/role:
x-swagger-router-controller: admin
put:
Expand Down
17 changes: 17 additions & 0 deletions server/db/migrations/20211107113037-change-login-device-length.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict';

const TABLE = 'Logins';
const COLUMN = 'device';

module.exports = {
up: (queryInterface, Sequelize) =>
queryInterface.changeColumn(TABLE, COLUMN, {
type: Sequelize.STRING(1000),
allowNull: true
}),
down: (queryInterface, Sequelize) =>
queryInterface.changeColumn(TABLE, COLUMN, {
type: Sequelize.STRING,
allowNull: false
})
};
2 changes: 1 addition & 1 deletion server/db/models/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = function(sequelize, DataTypes) {
allowNull: false
},
device: {
type: DataTypes.STRING,
type: DataTypes.STRING(1000),
allowNull: true,
defaultValue: ''
},
Expand Down
1 change: 1 addition & 0 deletions server/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const checkStatus = () => {
name: exchange.name,
active: exchange.active,
exchange_id: exchange.id,
user_id: exchange.user_id,
url: exchange.url,
is_trial: exchange.is_trial,
created_at: exchange.created_at,
Expand Down
6 changes: 3 additions & 3 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.2.2",
"version": "2.2.3",
"private": false,
"description": "HollaEx Kit",
"keywords": [
Expand Down Expand Up @@ -29,8 +29,8 @@
"flat": "5.0.0",
"geoip-lite": "1.4.1",
"helmet": "3.12.0",
"hollaex-node-lib": "github:bitholla/hollaex-node-lib#2.10",
"hollaex-tools-lib": "github:bitholla/hollaex-tools-lib#2.14",
"hollaex-node-lib": "github:bitholla/hollaex-node-lib#2.11",
"hollaex-tools-lib": "github:bitholla/hollaex-tools-lib#2.15",
"http": "0.0.0",
"install": "0.10.4",
"json2csv": "4.5.4",
Expand Down
2 changes: 1 addition & 1 deletion server/tools/nginx/proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Origin $http_origin;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 20m;
client_max_body_size 6m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
Expand Down
2 changes: 1 addition & 1 deletion templates/local/nginx/proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-Origin $http_origin;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 20m;
client_max_body_size 6m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
Expand Down
24 changes: 0 additions & 24 deletions test/.env

This file was deleted.

25 changes: 0 additions & 25 deletions test/selenium/.env

This file was deleted.

2 changes: 1 addition & 1 deletion test/selenium/Onboarding/LogIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ async function LogIn () {
}
describe('Main Test', function () {

LogIn();
//LogIn();
})
module.exports.LogIn = LogIn;
2 changes: 1 addition & 1 deletion test/selenium/Onboarding/ResendVerificationEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,6 @@ async function ResendVerificationEmail(){
}
describe('Main Test', function () {

ResendVerificationEmail();
//ResendVerificationEmail();
})
module.exports.ResendVerificationEmail = ResendVerificationEmail
2 changes: 1 addition & 1 deletion test/selenium/Onboarding/ResetPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ async function ResetPassword(){
}
describe('Main Test', function () {

ResetPassword();
// ResetPassword();
})
module.exports.ResetPassword = ResetPassword;
2 changes: 1 addition & 1 deletion test/selenium/Onboarding/SignUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,6 @@ async function SignUp(){
}
describe('Main Test', function () {

SignUp();
//SignUp();
})
module.exports.SignUp = SignUp;
11 changes: 6 additions & 5 deletions test/selenium/Onboarding/security.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,16 @@ async function Security(){

console.log(step++,' | click | css=form |')
await driver.findElement(By.css('form')).click();
await sleep(4000);
await sleep(5000);

console.log(step++,' | click | xpath/div[5]/div/div/div[2]/div[4]/form/button | ');
await driver.findElement(By.xpath('//div[5]/div/div/div[2]/div[4]/form/button')).click();
console.log(step++,' | click | xpath//*[@id="root"]/div/div[2]/div/div/div[3]/div[2]/div/div/div/div[4]/div[2]/div | ');
await driver.findElement(By.xpath('//*[@id="root"]/div/div[2]/div/div/div[3]/div[2]/div/div/div/div[4]/div[2]/div')).click();
await sleep(4000);

console.log (' 16 | assertText | css=.success_display-content-text > .edit-wrapper__container | You have successfully activated 2FA');
assert(await driver.findElement(By.css('.success_display-content-text > .edit-wrapper__container')).getText() == 'You have successfully activated 2FA');

await sleep(5000);

console.log(step++,' | click | css=.holla-button | ');
await driver.findElement(By.css('.holla-button')).click();
await sleep(4000);
Expand Down Expand Up @@ -461,6 +462,6 @@ async function Security(){
}
describe('Main Test', function () {

Security();
//Security();
})
module.exports.Security = Security;
2 changes: 1 addition & 1 deletion test/selenium/Onboarding/verification.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,6 @@ async function Verification(){
}
describe('Main Test', function () {

Verification();
// Verification();
})
module.exports.Verification = Verification;
2 changes: 1 addition & 1 deletion test/selenium/Roles/Communicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ async function Communicator(){
}
describe('Main Test', function () {

Communicator();
//Communicator();
})
module.exports.Communicator = Communicator;
2 changes: 1 addition & 1 deletion test/selenium/Roles/Kyc.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,6 @@ async function Kyc(){
}
describe('Main Test', function () {

Kyc();
// Kyc();
})
module.exports.Kyc = Kyc;
2 changes: 1 addition & 1 deletion test/selenium/Roles/Supervisor.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,6 @@ async function Supervisor(){
}
describe('Main Test', function () {

Supervisor();
// Supervisor();
})
module.exports.Supervisor = Supervisor;
2 changes: 1 addition & 1 deletion test/selenium/Roles/Support.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,6 @@ async function Support(){
}
describe('Main Test', function () {

Support();
// Support();
})
module.exports.Support = Support;
Loading

0 comments on commit 6e76950

Please sign in to comment.