2018-11-07 11:08:42 -08:00
|
|
|
import json
|
|
|
|
import random
|
2018-11-13 05:58:02 -08:00
|
|
|
|
2018-11-07 11:08:42 -08:00
|
|
|
from grant.proposal.models import CATEGORIES
|
|
|
|
|
|
|
|
message = {
|
2018-11-27 11:07:09 -08:00
|
|
|
"sig": "0x7b3a85e9f158c2ae2a9ffba986a7dcb9108cf8ea9691080f80eadb506719f14925c89777aade3fabc5f9730ea389abdf7ffb0da16babdf1a1ea710b1e998cb891c",
|
2018-11-07 11:08:42 -08:00
|
|
|
"data": {
|
|
|
|
"domain": {
|
2018-11-27 11:07:09 -08:00
|
|
|
"name": "Grant.io",
|
|
|
|
"version": 1,
|
|
|
|
"chainId": 1543277948575
|
2018-11-07 11:08:42 -08:00
|
|
|
},
|
2018-11-27 11:07:09 -08:00
|
|
|
"types": {
|
|
|
|
"authorization": [
|
|
|
|
{
|
|
|
|
"name": "Message Proof",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Time",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"EIP712Domain": [
|
|
|
|
{
|
|
|
|
"name": "name",
|
|
|
|
"type": "string"
|
2018-11-07 11:08:42 -08:00
|
|
|
},
|
2018-11-27 11:07:09 -08:00
|
|
|
{
|
|
|
|
"name": "version",
|
|
|
|
"type": "string"
|
2018-11-07 11:08:42 -08:00
|
|
|
},
|
2018-11-27 11:07:09 -08:00
|
|
|
{
|
|
|
|
"name": "chainId",
|
|
|
|
"type": "uint256"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"message": {
|
|
|
|
"message": "I am proving the identity of 0x6bEeA1Cef016c23e292381b6FcaeC092960e41aa on Grant.io",
|
|
|
|
"time": "Tue, 27 Nov 2018 19:02:04 GMT"
|
|
|
|
},
|
|
|
|
"primaryType": "authorization"
|
|
|
|
}
|
2018-11-07 11:08:42 -08:00
|
|
|
}
|
|
|
|
|
2018-11-13 05:58:02 -08:00
|
|
|
test_user = {
|
2018-11-27 11:07:09 -08:00
|
|
|
"accountAddress": '0x6bEeA1Cef016c23e292381b6FcaeC092960e41aa',
|
2018-11-07 11:08:42 -08:00
|
|
|
"displayName": 'Groot',
|
|
|
|
"emailAddress": 'iam@groot.com',
|
|
|
|
"title": 'I am Groot!',
|
|
|
|
"avatar": {
|
|
|
|
"link": 'https://avatars2.githubusercontent.com/u/1393943?s=400&v=4'
|
|
|
|
},
|
|
|
|
"socialMedias": [
|
|
|
|
{
|
|
|
|
"link": 'https://github.com/groot'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"signedMessage": message["sig"],
|
|
|
|
"rawTypedData": json.dumps(message["data"])
|
|
|
|
}
|
|
|
|
|
2018-11-13 05:58:02 -08:00
|
|
|
test_team = [test_user]
|
2018-11-07 11:08:42 -08:00
|
|
|
|
|
|
|
milestones = [
|
|
|
|
{
|
|
|
|
"title": "All the money straightaway",
|
|
|
|
"description": "cool stuff with it",
|
|
|
|
"date": "June 2019",
|
|
|
|
"payoutPercent": "100",
|
|
|
|
"immediatePayout": False
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
2018-11-13 05:58:02 -08:00
|
|
|
test_proposal = {
|
|
|
|
"team": test_team,
|
2018-11-07 11:08:42 -08:00
|
|
|
"crowdFundContractAddress": "0x20000",
|
|
|
|
"content": "## My Proposal",
|
|
|
|
"title": "Give Me Money",
|
|
|
|
"milestones": milestones,
|
|
|
|
"category": random.choice(CATEGORIES)
|
2018-11-13 05:58:02 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
milestones = [
|
|
|
|
{
|
|
|
|
"title": "All the money straightaway",
|
|
|
|
"description": "cool stuff with it",
|
|
|
|
"date": "June 2019",
|
|
|
|
"payoutPercent": "100",
|
|
|
|
"immediatePayout": False
|
|
|
|
}
|
|
|
|
]
|