Created
February 19, 2020 15:56
-
-
Save JhonatanHern/5aee4ab389ec8630eeb0cb363e54d2d6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const { | |
getDNA, | |
buildConfig, | |
buildRunner, | |
} = require('../init') | |
const runner = buildRunner() | |
const config = buildConfig({ | |
proposal: getDNA('proposal'), | |
}) | |
const agentAddress = 'RANDOMAGENADDRESSESDEJOSEJFEOFJESFOI' | |
const exampleProposal = { | |
name: '"String"', | |
hasBeginning: '2019-11-19T00:00:00.056Z', | |
hasEnd: '2019-11-19T00:00:00.056Z', | |
inScopeOf: null, | |
unitBased: true, | |
created: '2019-11-19T00:00:00.056Z', | |
note: 'note' | |
} | |
const grepMe = obj => console.log('grepme: ', JSON.stringify(obj)) | |
runner.registerScenario('fields with default values set are stored on creation', async (s, t) => { | |
const { proposal } = await s.players({ proposal: config }, true) | |
const createProposalResponse = await proposal.call('proposal', 'proposal', 'create_proposal', { proposal: exampleProposal }) | |
grepMe(createProposalResponse) | |
await s.consistency() | |
const proposalID = createProposalResponse.Ok.proposal.id | |
const proposeToCreateRequest = { | |
proposed: proposalID, | |
proposedTo: agentAddress, | |
} | |
const createProposedToResponse = await proposal.call('proposal', 'proposed_to', 'create_proposed_to', { proposed_to: proposeToCreateRequest }) | |
grepMe(createProposedToResponse) | |
const proposalResponse = await proposal.call('proposal', 'proposal', 'get_proposal', { address: proposalID }) | |
grepMe(proposalResponse) | |
}) | |
runner.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment