From 721c330f3c71a85e4b3cff47b31c1c0a47aef62b Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 3 Jun 2021 16:26:09 +0200 Subject: [PATCH 1/6] WIP Rename contributorId to recipientId --- app/components/add-reimbursement/component.js | 8 ++++---- app/services/kredits.js | 4 ++-- app/utils/process-reimbursement-data.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/components/add-reimbursement/component.js b/app/components/add-reimbursement/component.js index ca2c5a4..f74d738 100644 --- a/app/components/add-reimbursement/component.js +++ b/app/components/add-reimbursement/component.js @@ -15,7 +15,7 @@ export default class AddReimbursementComponent extends Component { @alias('kredits.contributorsSorted') contributors; - @tracked contributorId = null; + @tracked recipientId = null; @tracked title = ''; @tracked total = '0'; @tracked expenses = A([]); @@ -86,7 +86,7 @@ export default class AddReimbursementComponent extends Component { @action updateContributor(event) { - this.contributorId = event.target.value; + this.recipientId = event.target.value; } @action @@ -118,12 +118,12 @@ export default class AddReimbursementComponent extends Component { if (!this.kredits.currentUser) { window.alert('You need to connect your Ethereum account first.'); return false } if (!this.kredits.currentUserIsCore) { window.alert('Only core contributors can submit reimbursements.'); return false } - const contributor = this.contributors.findBy('id', this.contributorId); + const contributor = this.contributors.findBy('id', this.recipientId); const attributes = { amount: parseInt(parseFloat(this.total) * 100000000), // convert to sats token: config.tokens['WBTC'], - contributorId: parseInt(this.contributorId), + recipientId: parseInt(this.recipientId), title: `Expenses covered by ${contributor.name}`, description: this.description, url: this.url, diff --git a/app/services/kredits.js b/app/services/kredits.js index 776b7d0..23a4b0f 100644 --- a/app/services/kredits.js +++ b/app/services/kredits.js @@ -575,7 +575,7 @@ export default Service.extend({ loadReimbursementFromData(data) { const obj = Reimbursement.create(processReimbursementData(data)); - obj.set('contributor', this.contributors.findBy('id', data.contributorId.toString())); + obj.set('contributor', this.contributors.findBy('id', data.recipientId.toString())); this.removeObjectFromCollectionIfLoaded('reimbursements', obj.id); this.reimbursements.pushObject(obj); return obj; @@ -589,7 +589,7 @@ export default Service.extend({ console.debug('[kredits] add reimbursement response', data); const reimbursement = Reimbursement.create(attributes); reimbursement.setProperties({ - contributor: this.contributors.findBy('id', attributes.contributorId.toString()), + contributor: this.contributors.findBy('id', attributes.recipientId.toString()), pendingTx: data, confirmedAt: this.currentBlock + 40320 }); diff --git a/app/utils/process-reimbursement-data.js b/app/utils/process-reimbursement-data.js index a66287c..3586194 100644 --- a/app/utils/process-reimbursement-data.js +++ b/app/utils/process-reimbursement-data.js @@ -10,7 +10,7 @@ export default function processReimbursementData(data) { } const otherProperties = [ - 'id', 'contributorId', 'token', 'vetoed', 'ipfsHash', + 'id', 'recipientId', 'token', 'vetoed', 'ipfsHash', 'expenses', 'pendingTx' ]; From 466354cff774e2fd662e3893d30d0e00385c24dc Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 1 May 2022 14:19:45 +0200 Subject: [PATCH 2/6] Update/improve README Especially the local-contracts part. --- README.md | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index d04e618..4e2cb35 100644 --- a/README.md +++ b/README.md @@ -5,23 +5,24 @@ This README outlines the details of collaborating on this Ember application. A short introduction of this app could easily go here. -## Prerequisites +## Development + +### Prerequisites You will need the following things properly installed on your computer. * [Git](https://git-scm.com/) * [Node.js](https://nodejs.org/) (with npm) * [Ember CLI](https://ember-cli.com/) -* [Google Chrome](https://google.com/chrome/) +* [Google Chrome](https://google.com/chrome/) (only for running tests) -## Installation +### Installation * `git clone git@github.com:67P/kredits-web.git` this repository * `cd kredits-web` * `npm install` -## Running / Development - +### Building/running for development * `ember serve` - by default kredits-web connects to the Ethreum Kovan network * Visit your app at [http://localhost:4200](http://localhost:4200). @@ -29,11 +30,11 @@ You will need the following things properly installed on your computer. See [working with locally deployed contracts](https://github.com/67P/kredits-web#working-with-locally-deployed-contracts) for details on how to develop with locally deployed contracts. -### Code Generators +### Code generators Make use of the many generators for code, try `ember help generate` for more details -### Running Tests +### Running tests * `ember test` * `ember test --server` @@ -55,17 +56,15 @@ _(You need collaborator permissions on the 5apps Deploy project.)_ `npm run deploy` -## Working with locally deployed contracts +### Working with locally deployed contracts The smart contracts and their JavaScript wrapper library are developed in the [kredits-contracts](https://github.com/67P/kredits-contracts) repo/package. -You can run `kredits-web` on your machine, against a local, simulated Ethereum -network, provided e.g. by [ganache](http://truffleframework.com/ganache/). - -[kredits-contracts](https://github.com/67P/kredits-contracts) holds all the tools -to start and set up such a simulated network, as well as to deploy smart -contracts to it. +You can run `kredits-web` on your machine, against a local, simulated +blockchain. [kredits-contracts](https://github.com/67P/kredits-contracts) +contains all the tools to start and set up such a simulated network, as well as +to deploy the Kredits smart contracts to it. These are the basic steps to get up and running: @@ -78,31 +77,33 @@ Run a local IPFS deamon. #### 2. kredits-contracts -Get your local Ethereum development node running. (See [kredits-contracts README](https://github.com/67P/kredits-contracts) -for details. +Run a local devchain with test data. (See [kredits-contracts +README](https://github.com/67P/kredits-contracts) for details. * Clone [kredits-contracts](https://github.com/67P/kredits-contracts) * `npm install` * `npm run devchain` - runs a local development chain - * `npm run bootstrap` - bootstrap runs deploys all the contracts - * `npm link` - make the `kredits-contracts` module linkable as `kredits-contracts` on your machine (currently broken :( ) + * `npm run bootstrap` - deploys all contracts and seeds test data + * `npm link` - makes the `kredits-contracts` module linkable as `kredits-contracts` on your machine #### 3. kredits-web -With IPFS and Ethereum/ganache running, you can now start this Ember app. +With IPFS and the local devchain running, you can now link the contracts and +start the Ember app: - * `npm link kredits-contracts` - link the local `kredits-contracts` package - * `npm run start:local` - WEB3_PROVIDER_URL=http://localhost:8545 must be set for local settings + * `npm link kredits-contracts` - links the local `kredits-contracts` package (has to be done again after every `npm install`) + * `npm run start:local` - runs the Ember app with WEB3_PROVIDER_URL=http://localhost:8545 set #### 4. Metamask network -Switch the network in Metamask to "Custom RPC" with the RPC URL `http://localhost:8545`. +If you want to interact with the local contracts via a Web3 wallet, switch the +network to a "Custom RPC" one, with the RPC URL `http://localhost:8545`. #### IPFS -Install IPFS with your favorite package manager and run +If you haven't configured your IPFS node for CORS yet, you can do so by running +the following commands: - ipfs init (on initial installation) ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["localhost:4200"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]' ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]' From 4c749bca355da18cd964c88c1169d660fa998483 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sat, 21 May 2022 18:16:26 +0200 Subject: [PATCH 3/6] Use integer for contributor ID everywhere closes #145 --- app/components/add-contribution/component.js | 12 +++++++- app/components/add-contribution/template.hbs | 2 +- app/components/contribution-list/component.js | 7 ++--- app/models/contribution.js | 2 -- app/models/contributor.js | 1 - app/routes/contributions/resubmit.js | 8 ++---- app/services/kredits.js | 28 ++++++++++--------- app/utils/process-contribution-data.js | 5 ++-- app/utils/process-contributor-data.js | 3 +- tests/fixtures/contributions.js | 2 +- tests/fixtures/contributors.js | 6 ++-- .../contribution-list/component-test.js | 6 ++-- .../components/user-avatar/component-test.js | 6 ++-- .../utils/process-contributor-data-test.js | 2 +- 14 files changed, 47 insertions(+), 43 deletions(-) diff --git a/app/components/add-contribution/component.js b/app/components/add-contribution/component.js index 96c4f48..5ae1d56 100644 --- a/app/components/add-contribution/component.js +++ b/app/components/add-contribution/component.js @@ -9,7 +9,15 @@ export default Component.extend({ kredits: service(), attributes: null, - contributors: alias('kredits.contributorsSorted'), + + contributors: computed('kredits.contributorsSorted.[]', function() { + return this.kredits.contributorsSorted.map(c => { + return { + id: c.id.toString(), + name: c.name + } + }) + }), isValidContributor: notEmpty('contributorId'), isValidKind: notEmpty('kind'), @@ -57,6 +65,8 @@ export default Component.extend({ const attributes = this.getProperties(Object.keys(this.attributes)); + attributes.contributorId = parseInt(this.contributorId); + let dateInput = (attributes.date instanceof Array) ? attributes.date[0] : attributes.date; diff --git a/app/components/add-contribution/template.hbs b/app/components/add-contribution/template.hbs index 05ce592..3727c5d 100644 --- a/app/components/add-contribution/template.hbs +++ b/app/components/add-contribution/template.hbs @@ -4,7 +4,7 @@

diff --git a/app/components/contribution-list/component.js b/app/components/contribution-list/component.js index e297444..444d813 100644 --- a/app/components/contribution-list/component.js +++ b/app/components/contribution-list/component.js @@ -24,10 +24,9 @@ export default Component.extend({ contributors: sort('kredits.contributors', 'contributorsSorting'), contributorsActive: computed('contributors.[]', 'contributions', function() { - const activeIds = new Set(this.contributions.mapBy('contributorId') - .map(id => id.toString())); + const activeIds = new Set(this.contributions.mapBy('contributorId')); - return this.contributors.filter(c => activeIds.has(c.id.toString())); + return this.contributors.filter(c => activeIds.has(c.id)); }), contributionKinds: computed('contributions.[]', function() { @@ -42,7 +41,7 @@ export default Component.extend({ c.amount <= 500) { included = false; } if (isPresent(this.contributorId) && - c.contributorId.toString() !== this.contributorId.toString()) { included = false; } + c.contributorId !== parseInt(this.contributorId)) { included = false; } if (isPresent(this.contributionKind) && c.kind !== this.contributionKind) { included = false; } diff --git a/app/models/contribution.js b/app/models/contribution.js index 3fde117..f57bbed 100644 --- a/app/models/contribution.js +++ b/app/models/contribution.js @@ -3,7 +3,6 @@ import { isEmpty, isPresent } from '@ember/utils'; import moment from 'moment'; export default EmberObject.extend({ - // Contract id: null, contributorId: null, @@ -48,5 +47,4 @@ export default EmberObject.extend({ serialize () { return JSON.stringify(this); } - }); diff --git a/app/models/contributor.js b/app/models/contributor.js index 9485d0f..40f6448 100644 --- a/app/models/contributor.js +++ b/app/models/contributor.js @@ -22,5 +22,4 @@ export default EmberObject.extend({ serialize () { return JSON.stringify(this); } - }); diff --git a/app/routes/contributions/resubmit.js b/app/routes/contributions/resubmit.js index 2de1d5a..c375323 100644 --- a/app/routes/contributions/resubmit.js +++ b/app/routes/contributions/resubmit.js @@ -6,19 +6,15 @@ export default Route.extend({ kredits: service(), model(params) { - const contribution = this.kredits.contributions.findBy('id', parseInt(params.id)); - contribution.contributorId = contribution.contributorId.toString(); - - return contribution; + return this.kredits.contributions.findBy('id', parseInt(params.id)); }, setupController (controller, model) { this._super(controller, model); controller.set('attributes', model.getProperties([ - 'kind', 'amount', 'description', 'url', 'details' + 'contributorId', 'kind', 'amount', 'description', 'url', 'details' ])); - controller.set('attributes.contributorId', model.contributorId.toString()); controller.set('attributes.date', model.jsDate); } diff --git a/app/services/kredits.js b/app/services/kredits.js index 23a4b0f..cc55354 100644 --- a/app/services/kredits.js +++ b/app/services/kredits.js @@ -160,12 +160,12 @@ export default Service.extend({ kreditsByContributor: computed('contributionsUnconfirmed.@each.vetoed', 'contributors.[]', function() { const contributionsUnconfirmed = this.contributionsUnconfirmed.filterBy('vetoed', false); const contributionsGrouped = groupBy(contributionsUnconfirmed, 'contributorId'); - const contributorsWithUnconfirmed = contributionsGrouped.map(c => c.value.toString()); + const contributorsWithUnconfirmed = contributionsGrouped.map(c => c.value); const contributorsWithOnlyConfirmed = this.contributors.reject(c => contributorsWithUnconfirmed.includes(c.id)) const kreditsByContributor = contributionsGrouped.map(c => { const amountUnconfirmed = c.items.mapBy('amount').reduce((a, b) => a + b); - const contributor = this.contributors.findBy('id', c.value.toString()); + const contributor = this.contributors.findBy('id', c.value); return EmberObject.create({ contributor: contributor, @@ -275,7 +275,7 @@ export default Service.extend({ }); }, - loadContributorFromData(data) { + loadContributorFromData (data) { const contributor = Contributor.create(processContributorData(data)); const loadedContributor = this.contributors.findBy('id', contributor.id); if (loadedContributor) { this.contributors.removeObject(loadedContributor); } @@ -285,7 +285,7 @@ export default Service.extend({ async cacheLoadedContributors () { for (const c of this.contributors) { - await this.browserCache.contributors.setItem(c.id, c.serialize()); + await this.browserCache.contributors.setItem(c.id.toString(), c.serialize()); } console.debug(`[kredits] Cached ${this.contributors.length} contributors in browser storage`); return Promise.resolve(); @@ -340,7 +340,7 @@ export default Service.extend({ loadContributionFromData(data) { const contribution = Contribution.create(processContributionData(data)); - contribution.set('contributor', this.contributors.findBy('id', data.contributorId.toString())); + contribution.set('contributor', this.contributors.findBy('id', data.contributorId)); const loadedContribution = this.contributions.findBy('id', contribution.id); if (loadedContribution) { this.contributions.removeObject(loadedContribution); } this.contributions.pushObject(contribution); @@ -349,7 +349,7 @@ export default Service.extend({ async cacheLoadedContributions () { for (const c of this.contributions) { - await this.browserCache.contributions.setItem(c.id, c.serialize()); + await this.browserCache.contributions.setItem(c.id.toString(), c.serialize()); } console.debug(`[kredits] Cached ${this.contributions.length} contributions in browser storage`); return Promise.resolve(); @@ -575,7 +575,7 @@ export default Service.extend({ loadReimbursementFromData(data) { const obj = Reimbursement.create(processReimbursementData(data)); - obj.set('contributor', this.contributors.findBy('id', data.recipientId.toString())); + obj.set('contributor', this.contributors.findBy('id', data.recipientId)); this.removeObjectFromCollectionIfLoaded('reimbursements', obj.id); this.reimbursements.pushObject(obj); return obj; @@ -589,7 +589,7 @@ export default Service.extend({ console.debug('[kredits] add reimbursement response', data); const reimbursement = Reimbursement.create(attributes); reimbursement.setProperties({ - contributor: this.contributors.findBy('id', attributes.recipientId.toString()), + contributor: this.contributors.findBy('id', attributes.recipientId), pendingTx: data, confirmedAt: this.currentBlock + 40320 }); @@ -645,13 +645,15 @@ export default Service.extend({ const contributorData = await this.kredits.Contributor.getById(contributorId); const newContributor = Contributor.create(contributorData); - const oldContributor = this.contributors.findBy('id', contributorId.toString()); + // TODO check for actual differences in the contributor data first + + const oldContributor = this.contributors.findBy('id', contributorId); if (oldContributor) { - console.debug('[kredits] old contributor', oldContributor); + // console.debug('[kredits] cached contributor', oldContributor); this.contributors.removeObject(oldContributor); } - console.debug('[kredits] new contributor', newContributor); + // console.debug('[kredits] incoming contributor data', newContributor); this.contributors.pushObject(newContributor); }, @@ -660,13 +662,13 @@ export default Service.extend({ const pendingContribution = this.contributions.find(c => { return (c.id === null) && - (c.contributorId.toString() === contributorId.toString()) && + (c.contributorId === contributorId) && (c.amount.toString() === amount.toString()); }); if (pendingContribution) { const attributes = await this.kredits.Contribution.getById(id); - attributes.contributor = this.contributors.findBy('id', attributes.contributorId.toString()); + attributes.contributor = this.contributors.findBy('id', attributes.contributorId); const newContribution = Contribution.create(attributes); this.contributions.addObject(newContribution); this.contributions.removeObject(pendingContribution); diff --git a/app/utils/process-contribution-data.js b/app/utils/process-contribution-data.js index 0a3f18d..a12395e 100644 --- a/app/utils/process-contribution-data.js +++ b/app/utils/process-contribution-data.js @@ -8,9 +8,8 @@ export default function processContributionData(data) { } const otherProperties = [ - 'id', 'contributorId', 'amount', 'vetoed', - 'ipfsHash', 'kind', 'description', 'details', - 'url', 'date', 'time', 'pendingTx' + 'id', 'contributorId', 'amount', 'vetoed', 'ipfsHash', 'kind', + 'description', 'details', 'url', 'date', 'time', 'pendingTx' ]; otherProperties.forEach(prop => { diff --git a/app/utils/process-contributor-data.js b/app/utils/process-contributor-data.js index 48074fb..47e6b66 100644 --- a/app/utils/process-contributor-data.js +++ b/app/utils/process-contributor-data.js @@ -1,13 +1,12 @@ export default function processContributorData(data) { const processed = { - id: data.id.toString(), balance: data.balanceInt, totalKreditsEarned: data.totalKreditsEarned, contributionsCount: data.contributionsCount?.toNumber() } const otherProperties = [ - 'account', 'accounts', 'ipfsHash', 'isCore', 'kind', 'name', 'url', + 'id', 'account', 'accounts', 'ipfsHash', 'isCore', 'kind', 'name', 'url', 'github_username', 'github_uid', 'wiki_username', 'zoom_display_name' ]; diff --git a/tests/fixtures/contributions.js b/tests/fixtures/contributions.js index 75a1270..5a809f0 100644 --- a/tests/fixtures/contributions.js +++ b/tests/fixtures/contributions.js @@ -18,7 +18,7 @@ const data = [ data.forEach(attrs => { const c = Model.create(processContributionData(attrs)); - c.set('contributor', contributors.findBy('id', attrs.contributorId.toString())); + c.set('contributor', contributors.findBy('id', attrs.contributorId)); items.push(c); }); diff --git a/tests/fixtures/contributors.js b/tests/fixtures/contributors.js index ebe261e..2ddb787 100644 --- a/tests/fixtures/contributors.js +++ b/tests/fixtures/contributors.js @@ -4,9 +4,9 @@ import processContributorData from 'kredits-web/utils/process-contributor-data'; const contributors = []; const data = [ - { id: '1', name: 'Bumi', totalKreditsEarned: 11500, github_uid: 318 }, - { id: '2', name: 'Râu Cao', totalKreditsEarned: 3000, github_uid: 842 }, - { id: '3', name: 'Manuel', totalKreditsEarned: 0, github_uid: 54812 } + { id: 1, name: 'Bumi', totalKreditsEarned: 11500, github_uid: 318 }, + { id: 2, name: 'Râu Cao', totalKreditsEarned: 3000, github_uid: 842 }, + { id: 3, name: 'Manuel', totalKreditsEarned: 0, github_uid: 54812 } ]; data.forEach(attrs => { diff --git a/tests/integration/components/contribution-list/component-test.js b/tests/integration/components/contribution-list/component-test.js index 995ad69..9892cf2 100644 --- a/tests/integration/components/contribution-list/component-test.js +++ b/tests/integration/components/contribution-list/component-test.js @@ -16,8 +16,10 @@ module('Integration | Component | contribution-list', function(hooks) { }); test('it renders filtered contributions', async function(assert) { - let service = this.owner.lookup('service:kredits'); - service.set('contributors', contributors); + let kredits = this.owner.lookup('service:kredits'); + kredits.set('contributors', contributors); + + debugger; this.set('fixtures', contributions); await render(hbs`{{contribution-list contributions=fixtures showQuickFilter=true}}`); diff --git a/tests/integration/components/user-avatar/component-test.js b/tests/integration/components/user-avatar/component-test.js index 1275f21..674f263 100644 --- a/tests/integration/components/user-avatar/component-test.js +++ b/tests/integration/components/user-avatar/component-test.js @@ -8,14 +8,14 @@ module('Integration | Component | user-avatar', function(hooks) { setupRenderingTest(hooks); test('it renders', async function(assert) { - this.set('bumi', contributors.findBy('id', '1')); + this.set('bumi', contributors.findBy('id', 1)); await render(hbs`{{user-avatar contributor=bumi}}`); assert.dom(this.element).hasText(''); }); test('default image source URL', async function(assert) { - this.set('bumi', contributors.findBy('id', '1')); + this.set('bumi', contributors.findBy('id', 1)); await render(hbs`{{user-avatar contributor=bumi}}`); assert.equal(this.element.querySelector('img').src, @@ -23,7 +23,7 @@ module('Integration | Component | user-avatar', function(hooks) { }); test('size-specific image source URLs', async function(assert) { - this.set('bumi', contributors.findBy('id', '1')); + this.set('bumi', contributors.findBy('id', 1)); this.set('size', 'medium'); await render(hbs`{{user-avatar contributor=bumi size=size}}`); diff --git a/tests/unit/utils/process-contributor-data-test.js b/tests/unit/utils/process-contributor-data-test.js index f81a58d..f164316 100644 --- a/tests/unit/utils/process-contributor-data-test.js +++ b/tests/unit/utils/process-contributor-data-test.js @@ -8,7 +8,7 @@ module('Unit | Utility | process-contributor-data', function() { test('formats the data correctly', function(assert) { // TODO use integers everywhere for IDs - assert.ok(typeof result.id === 'string'); + assert.ok(typeof result.id === 'number'); assert.ok(typeof result.balance === 'number'); assert.ok(typeof result.totalKreditsEarned === 'number'); assert.ok(typeof result.contributionsCount === 'number'); From 6cd62d3764d590184b62eb6a0b138834d7c5c6c4 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 22 May 2022 17:03:31 +0200 Subject: [PATCH 4/6] Fix looking up contributor by ID string --- app/components/add-reimbursement/component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/add-reimbursement/component.js b/app/components/add-reimbursement/component.js index f74d738..ae31e55 100644 --- a/app/components/add-reimbursement/component.js +++ b/app/components/add-reimbursement/component.js @@ -118,7 +118,7 @@ export default class AddReimbursementComponent extends Component { if (!this.kredits.currentUser) { window.alert('You need to connect your Ethereum account first.'); return false } if (!this.kredits.currentUserIsCore) { window.alert('Only core contributors can submit reimbursements.'); return false } - const contributor = this.contributors.findBy('id', this.recipientId); + const contributor = this.contributors.findBy('id', parseInt(this.recipientId)); const attributes = { amount: parseInt(parseFloat(this.total) * 100000000), // convert to sats From 44b631c6881303419c9959c5da9755f87e2e64d7 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 22 May 2022 17:02:54 +0200 Subject: [PATCH 5/6] Switch from ETH/WBTC to RBTC/BTC --- app/components/add-reimbursement/component.js | 4 ++-- app/components/add-reimbursement/template.hbs | 2 +- app/components/reimbursement-list/template.hbs | 2 +- app/helpers/fmt-crypto-currency.js | 4 ++-- app/services/community-funds.js | 4 ++-- config/environment.js | 6 +++--- .../integration/helpers/fmt-crypto-currency-test.js | 12 ++++++------ 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/components/add-reimbursement/component.js b/app/components/add-reimbursement/component.js index ae31e55..fd00dea 100644 --- a/app/components/add-reimbursement/component.js +++ b/app/components/add-reimbursement/component.js @@ -115,14 +115,14 @@ export default class AddReimbursementComponent extends Component { @action submit (e) { e.preventDefault(); - if (!this.kredits.currentUser) { window.alert('You need to connect your Ethereum account first.'); return false } + if (!this.kredits.currentUser) { window.alert('You need to connect your RSK account first.'); return false } if (!this.kredits.currentUserIsCore) { window.alert('Only core contributors can submit reimbursements.'); return false } const contributor = this.contributors.findBy('id', parseInt(this.recipientId)); const attributes = { amount: parseInt(parseFloat(this.total) * 100000000), // convert to sats - token: config.tokens['WBTC'], + token: config.tokens['BTC'], recipientId: parseInt(this.recipientId), title: `Expenses covered by ${contributor.name}`, description: this.description, diff --git a/app/components/add-reimbursement/template.hbs b/app/components/add-reimbursement/template.hbs index 7360686..6c1c06a 100644 --- a/app/components/add-reimbursement/template.hbs +++ b/app/components/add-reimbursement/template.hbs @@ -12,7 +12,7 @@