Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hive
wallet
Commits
e2e6757c
Commit
e2e6757c
authored
Sep 08, 2019
by
/ /\ / /\/
Browse files
remove need for dsteem
parent
f772702f
Changes
1
Show whitespace changes
Inline
Side-by-side
src/app/redux/CommunitySaga.js
View file @
e2e6757c
import
{
call
,
put
,
takeLatest
,
select
}
from
'
redux-saga/effects
'
;
import
{
api
,
broadcast
,
auth
}
from
'
@steemit/steem-js
'
;
import
{
PrivateKey
}
from
'
@steemit/steem-js/lib/auth/ecc
'
;
import
*
as
communityActions
from
'
./CommunityReducer
'
;
import
{
wait
}
from
'
./MarketSaga
'
;
...
...
@@ -8,9 +9,14 @@ const activeKeySelector = state => {
};
const
generateAuth
=
(
user
,
pass
,
type
)
=>
{
const
key
=
dsteem
.
PrivateKey
.
fromLogin
(
user
,
pass
,
type
).
createPublic
();
if
(
type
==
'
memo
'
)
return
key
;
return
{
weight_threshold
:
1
,
account_auths
:
[],
key_auths
:
[[
key
,
1
]]
};
const
key
=
auth
.
getPrivateKeys
(
user
,
pass
,
[
type
]);
const
publicKey
=
auth
.
wifToPublic
(
Object
.
values
(
key
)[
0
]);
if
(
type
==
'
memo
'
)
return
Object
.
values
(
key
)[
0
];
return
{
weight_threshold
:
1
,
account_auths
:
[],
key_auths
:
[[
publicKey
,
1
]],
};
};
const
generateHivemindOperation
=
(
action
,
params
,
actor_name
)
=>
{
...
...
@@ -73,7 +79,6 @@ export function* createCommunityAccount(createCommunityAction) {
),
json_metadata
:
''
,
};
yield
call
(
[
api
,
broadcast
.
accountCreate
],
creatorActiveKey
,
...
...
@@ -88,7 +93,6 @@ export function* createCommunityAccount(createCommunityAction) {
// The client cannot submit custom_json and account_create in the same block. The easiest way around this, for now, is to pause for 3 seconds after the account is created before submitting the ops.
yield
call
(
wait
,
3000
);
const
communityOwnerPosting
=
auth
.
getPrivateKeys
(
communityOwnerName
,
communityOwnerWifPassword
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment