Skip to content

Commit

Permalink
feat(apps/playground-api): change owner address of consortium in pg (#…
Browse files Browse the repository at this point in the history
…1981)

<!--  Thanks for sending a pull request! -->

#### What this PR does / why we need it:
- To be able to mint/burn as a consortium member in PG, the owner
address
[here](https://github.com/JellyfishSDK/jellyfish/blob/main/packages/jellyfish-network/src/RegTestFoundationKeys.ts#L91)
is set as the consortium member. This will allow anyone (e.g bridge api
local) to be able to mint/burn as a consortium member using its private
key

#### Which issue(s) does this PR fixes?:
<!--
(Optional) Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes BirthdayResearch/quantum#197

#### Additional comments?:
  • Loading branch information
pierregee authored Jan 20, 2023
1 parent 4c8fdf4 commit fb842b2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
10 changes: 6 additions & 4 deletions apps/playground-api/__tests__/modules/PlaygroundModule.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { RegTestFoundationKeys } from '@defichain/jellyfish-network'
import { ConsortiumKey } from '../../src/ConsortiumKey'
import { PlaygroundApiTesting } from '../../testing/PlaygroundApiTesting'

const pg = PlaygroundApiTesting.create()
Expand Down Expand Up @@ -67,15 +69,15 @@ it('should have gov set', async () => {
mintLimit: 50,
mintLimitDaily: 5,
name: 'Waves HQ',
ownerAddress: 'bcrt1qc2g87p4pehe0pnfsmph63m00f38gh76tjpuuf9',
ownerAddress: ConsortiumKey.address,
status: 0
},
'02': {
backingId: 'backing_address_btc_1_br, backing_address_btc_2_br',
mintLimit: 50,
mintLimitDaily: 5,
name: 'Alexandria',
ownerAddress: 'bcrt1qwg4n6520y64ajkl9nhul9jc0dpqhhrunwnmt4t',
ownerAddress: RegTestFoundationKeys[RegTestFoundationKeys.length - 1].owner.address,
status: 0
}
},
Expand All @@ -85,15 +87,15 @@ it('should have gov set', async () => {
mintLimit: 10,
mintLimitDaily: 5,
name: 'Waves HQ',
ownerAddress: 'bcrt1qc2g87p4pehe0pnfsmph63m00f38gh76tjpuuf9',
ownerAddress: ConsortiumKey.address,
status: 0
},
'02': {
backingId: 'backing_address_eth_1_br, backing_address_eth_2_br',
mintLimit: 10,
mintLimitDaily: 5,
name: 'Alexandria',
ownerAddress: 'bcrt1qwg4n6520y64ajkl9nhul9jc0dpqhhrunwnmt4t',
ownerAddress: RegTestFoundationKeys[RegTestFoundationKeys.length - 1].owner.address,
status: 0
}
},
Expand Down
3 changes: 3 additions & 0 deletions apps/playground-api/src/ConsortiumKey.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const ConsortiumKey = {
address: 'mwsZw8nF7pKxWH8eoKL9tPxTpaFkz7QeLU'
}
13 changes: 9 additions & 4 deletions apps/playground-api/src/setups/setup.gov.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { PlaygroundSetup } from '../setups/setup'
import { Injectable } from '@nestjs/common'
import { RegTestFoundationKeys } from '@defichain/jellyfish-network'
import { ConsortiumKey } from '../ConsortiumKey'

@Injectable()
export class SetupGov extends PlaygroundSetup<Record<string, any>> {
consortiumOwnerAddress1: string = ConsortiumKey.address
consortiumOwnerAddress2: string = RegTestFoundationKeys[RegTestFoundationKeys.length - 1].owner.address

list (): Array<Record<string, any>> {
return [
{
Expand Down Expand Up @@ -72,14 +77,14 @@ export class SetupGov extends PlaygroundSetup<Record<string, any>> {
'v0/consortium/1/members': {
'01': {
name: 'Waves HQ',
ownerAddress: 'bcrt1qc2g87p4pehe0pnfsmph63m00f38gh76tjpuuf9',
ownerAddress: this.consortiumOwnerAddress1,
backingId: 'backing_address_btc_1_c',
mintLimitDaily: '5.00000000',
mintLimit: '50.00000000'
},
'02': {
name: 'Alexandria',
ownerAddress: 'bcrt1qwg4n6520y64ajkl9nhul9jc0dpqhhrunwnmt4t',
ownerAddress: this.consortiumOwnerAddress2,
backingId: 'backing_address_btc_1_br, backing_address_btc_2_br',
mintLimitDaily: '5.00000000',
mintLimit: '50.00000000'
Expand All @@ -94,14 +99,14 @@ export class SetupGov extends PlaygroundSetup<Record<string, any>> {
'v0/consortium/2/members': {
'01': {
name: 'Waves HQ',
ownerAddress: 'bcrt1qc2g87p4pehe0pnfsmph63m00f38gh76tjpuuf9',
ownerAddress: this.consortiumOwnerAddress1,
backingId: 'backing_address_eth_1_c',
mintLimitDaily: '5.00000000',
mintLimit: '10.00000000'
},
'02': {
name: 'Alexandria',
ownerAddress: 'bcrt1qwg4n6520y64ajkl9nhul9jc0dpqhhrunwnmt4t',
ownerAddress: this.consortiumOwnerAddress2,
backingId: 'backing_address_eth_1_br, backing_address_eth_2_br',
mintLimitDaily: '5.00000000',
mintLimit: '10.00000000'
Expand Down

0 comments on commit fb842b2

Please sign in to comment.