Skip to content

Commit

Permalink
Merge pull request #7 from quiknode-labs/sergen/fix-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsergen authored Sep 9, 2024
2 parents 891db2e + 2e7ae86 commit 36b04d0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/migrations/20230313124654-create-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('Accounts', {
await queryInterface.createTable('accounts', {
id: {
allowNull: false,
autoIncrement: true,
Expand Down Expand Up @@ -31,6 +31,6 @@ module.exports = {
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('Accounts');
await queryInterface.dropTable("accounts");
}
};
4 changes: 2 additions & 2 deletions src/migrations/20230313124715-create-endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('Endpoints', {
await queryInterface.createTable('endpoints', {
id: {
allowNull: false,
autoIncrement: true,
Expand Down Expand Up @@ -44,6 +44,6 @@ module.exports = {
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable('Endpoints');
await queryInterface.dropTable("endpoints");
}
};
8 changes: 4 additions & 4 deletions src/routes/provisioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ router.post('/provision', basicAuth(authInfo), async (request, response) => {
plan: request.body['plan'],
chain: request.body['chain'],
network: request.body['network'],
wss_url: request.body['wss_url'],
http_url: request.body['http_url'],
wss_url: request.body['wss-url'],
http_url: request.body['http-url'],
}
});
console.log("Upserted endpoint with id: " + endpoint.get('id'))
Expand Down Expand Up @@ -86,8 +86,8 @@ router.put('/update', basicAuth(authInfo), async (request, response) => {
endpoint.plan = request.body['plan']
endpoint.chain = request.body['chain']
endpoint.network = request.body['network']
endpoint.wss_url = request.body['wss_url']
endpoint.http_url = request.body['http_url']
endpoint.wss_url = request.body['wss-url']
endpoint.http_url = request.body['http-url']
endpoint.is_test = request.headers['X-QN-TESTING'] === 'true'
await endpoint.save();

Expand Down
18 changes: 10 additions & 8 deletions src/seeders/20230313124606-demo-accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up (queryInterface, Sequelize) {
return queryInterface.bulkInsert('Accounts', [{
quicknode_id: '1234567890',
plan: 'discover',
is_test: true,
createdAt: new Date(),
updatedAt: new Date()
}]);
return queryInterface.bulkInsert("accounts", [
{
quicknode_id: "1234567890",
plan: "discover",
is_test: true,
createdAt: new Date(),
updatedAt: new Date(),
},
]);
},

async down (queryInterface, Sequelize) {
return queryInterface.bulkDelete('Accounts', null, {});
return queryInterface.bulkDelete("accounts", null, {});
}
};
28 changes: 16 additions & 12 deletions src/seeders/20230313124607-demo-endpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up (queryInterface, Sequelize) {
return queryInterface.bulkInsert('Endpoints', [{
quicknode_id: '1234567890',
account_id: 1,
chain: 'ethereum',
network: 'mainnet',
is_test: true,
wss_url: 'wss://long-late-firefly.quiknode.pro/4bb1e6b2dec8294938b6fdfdb7cf0cf70c4e97a2/',
http_url: 'https://long-late-firefly.quiknode.pro/4bb1e6b2dec8294938b6fdfdb7cf0cf70c4e97a2/',
createdAt: new Date(),
updatedAt: new Date()
}]);
return queryInterface.bulkInsert("endpoints", [
{
quicknode_id: "1234567890",
account_id: 1,
chain: "ethereum",
network: "mainnet",
is_test: true,
wss_url:
"wss://long-late-firefly.quiknode.pro/4bb1e6b2dec8294938b6fdfdb7cf0cf70c4e97a2/",
http_url:
"https://long-late-firefly.quiknode.pro/4bb1e6b2dec8294938b6fdfdb7cf0cf70c4e97a2/",
createdAt: new Date(),
updatedAt: new Date(),
},
]);
},

async down (queryInterface, Sequelize) {
return queryInterface.bulkDelete('Endpoints', null, {});
return queryInterface.bulkDelete("endpoints", null, {});
}
};

0 comments on commit 36b04d0

Please sign in to comment.