-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { DelegatorNamePipe } from './delegator-name.pipe'; | ||
|
||
describe('DelegatorNamePipe', () => { | ||
it('create an instance', () => { | ||
const pipe = new DelegatorNamePipe(); | ||
expect(pipe).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
|
||
@Pipe({ | ||
name: 'delegatorName' | ||
}) | ||
export class DelegatorNamePipe implements PipeTransform { | ||
map: Map<string, string> = new Map([ | ||
['tz1TDSmoZXwVevLTEvKCTHWpomG76oC9S2fJ', 'Tezos.Community'], | ||
['tz1WCd2jm4uSt4vntk4vSuUWoZQGhLcDuR9q', 'Happy Tezos'], | ||
['tz1XQ7SRj4QQWjaeebNd8dFwuTrCot3GGDRF', 'Tz Baker'], | ||
['tz1YKh8T79LAtWxX29N5VedCSmaZGw9LNVxQ', 'Tezos Brazil'], | ||
['tz3bEQoFCZEEfZMskefZ8q8e4eiHH1pssRax', 'Ceibo XTZ'], | ||
['tz1hThMBD8jQjFt78heuCnKxJnJtQo9Ao25X', 'Tezos Chef'], | ||
['tz1L3vFD8mFzBaS8yLHFsd7qDJY1t276Dh8i', 'Zednode'], | ||
['tz1Tnjaxk6tbAeC2TmMApPh8UsrEVQvhHvx5', 'My Crypto Delegate'], | ||
['tz1LesY3S4wfe15SNm1W3qJmQzWxLqVjTruH', 'Xtez.io'], | ||
['tz1L5GqtsKbasq9yD4hvtGC7VprPXDPmeb9V', 'Tezos Bakes'] | ||
]); | ||
transform(pkh: string): any { | ||
console.log('Get delegator name'); | ||
if (!pkh) { | ||
return ''; | ||
} | ||
const name = this.map.get(pkh); | ||
if (name) { | ||
return name; | ||
} else { | ||
return ''; | ||
} | ||
} | ||
} |