Process contributor data
Add util function for processing contributor data, and remove bignums, etc.
This commit is contained in:
Vendored
+64
@@ -0,0 +1,64 @@
|
||||
export default {
|
||||
"0": 1,
|
||||
"1": "0x7E8f313C56F809188313aa274Fa67EE58c31515d",
|
||||
"2": "0x99b8afd7b266e19990924a8be9099e81054b70c36b20937228a77a5cf75723b8",
|
||||
"3": 18,
|
||||
"4": 32,
|
||||
"5": true,
|
||||
"6": {
|
||||
"_hex": "0x09979c0838e8fc880000"
|
||||
},
|
||||
"7": 53500,
|
||||
"8": {
|
||||
"_hex": "0x49"
|
||||
},
|
||||
"9": true,
|
||||
"id": 1,
|
||||
"account": "0x7E8f313C56F809188313aa274Fa67EE58c31515d",
|
||||
"hashDigest": "0x99b8afd7b266e19990924a8be9099e81054b70c36b20937228a77a5cf75723b8",
|
||||
"hashFunction": 18,
|
||||
"hashSize": 32,
|
||||
"isCore": true,
|
||||
"balance": {
|
||||
"_hex": "0x09979c0838e8fc880000"
|
||||
},
|
||||
"totalKreditsEarned": 53500,
|
||||
"contributionsCount": {
|
||||
"_hex": "0x49",
|
||||
"toNumber": function() { return 73; }
|
||||
},
|
||||
"exists": true,
|
||||
"balanceInt": 45298,
|
||||
"ipfsHash": "QmYgiRd1FZ7JjDGBwkmLQNF6XQuyF8AWoFDRvUWhhmxiEj",
|
||||
"name": "Bumi",
|
||||
"kind": "person",
|
||||
"url": "https://michaelbumann.com",
|
||||
"accounts": [
|
||||
{
|
||||
"site": "github.com",
|
||||
"uid": 318,
|
||||
"username": "bumi",
|
||||
"url": "https://github.com/bumi"
|
||||
},
|
||||
{
|
||||
"site": "gitea.kosmos.org",
|
||||
"username": "bumi",
|
||||
"url": "https://gitea.kosmos.org/bumi"
|
||||
},
|
||||
{
|
||||
"site": "wiki.kosmos.org",
|
||||
"username": "Bumi",
|
||||
"url": "https://wiki.kosmos.org/User:Bumi"
|
||||
},
|
||||
{
|
||||
"site": "zoom.us",
|
||||
"username": "bumi"
|
||||
}
|
||||
],
|
||||
"github_uid": 318,
|
||||
"github_username": "bumi",
|
||||
"gitea_username": "bumi",
|
||||
"wiki_username": "Bumi",
|
||||
"zoom_display_name": "bumi",
|
||||
"ipfsData": "{\n \"@context\": \"https://schema.kosmos.org\",\n \"@type\": \"Contributor\",\n \"kind\": \"person\",\n \"name\": \"Bumi\",\n \"accounts\": [\n {\n \"site\": \"github.com\",\n \"uid\": 318,\n \"username\": \"bumi\",\n \"url\": \"https://github.com/bumi\"\n },\n {\n \"site\": \"gitea.kosmos.org\",\n \"username\": \"bumi\",\n \"url\": \"https://gitea.kosmos.org/bumi\"\n },\n {\n \"site\": \"wiki.kosmos.org\",\n \"username\": \"Bumi\",\n \"url\": \"https://wiki.kosmos.org/User:Bumi\"\n },\n {\n \"site\": \"zoom.us\",\n \"username\": \"bumi\"\n }\n ],\n \"url\": \"https://michaelbumann.com\"\n}"
|
||||
}
|
||||
Vendored
+3
-3
@@ -3,9 +3,9 @@ import Contributor from 'kredits-web/models/contributor';
|
||||
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 => contributors.push(Contributor.create(attrs)));
|
||||
|
||||
Reference in New Issue
Block a user