Skip to content

Conversation

@zone117x
Copy link
Contributor

@zone117x zone117x commented Jul 21, 2020

Depends on stacks-archive/stacks-transactions-js#99

This PR updates the sidecar to support processing and returning sponsored tx data.

Testing

The /sidecar/v1/debug/broadcast endpoints now have a checkbox to create and broadcast a sponsored transaction.

For example:

  • Visit http://localhost:3999/sidecar/v1/debug/broadcast/contract-deploy
  • Check [x] Create sponsored transaction and click Submit
  • The tx response will then contain sponsored tx info, for example:
// localhost:3999/sidecar/v1/tx/0x2537c7090545c01db3f86300efb75b72e07695c6d4bf5358d218242d2da859a1
{
  ...
  "sponsored": true,
  "sponsor_address": "STRYYQQ9M8KAF4NS7WNZQYY59X93XEKR31JP64CP",
  ...
}

@zone117x zone117x requested review from hstove and kyranjamie July 21, 2020 14:26
@zone117x zone117x self-assigned this Jul 21, 2020
@zone117x zone117x added this to the 2020 W29-W31 milestone Jul 21, 2020
@codecov
Copy link

codecov bot commented Jul 21, 2020

Codecov Report

Merging #176 into master will decrease coverage by 0.01%.
The diff coverage is 34.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #176      +/-   ##
==========================================
- Coverage   58.37%   58.36%   -0.02%     
==========================================
  Files          42       43       +1     
  Lines        2722     2757      +35     
  Branches      429      435       +6     
==========================================
+ Hits         1589     1609      +20     
- Misses       1131     1146      +15     
  Partials        2        2              
Impacted Files Coverage Δ
src/api/controllers/db-controller.ts 59.74% <ø> (ø)
src/api/init.ts 84.76% <ø> (ø)
src/api/routes/debug.ts 31.45% <0.00%> (-4.33%) ⬇️
src/datastore/common.ts 67.05% <ø> (ø)
src/event-stream/core-node-message.ts 0.00% <ø> (ø)
src/event-stream/event-server.ts 0.00% <0.00%> (ø)
src/migrations/1593415759720_add-txs-raw-result.ts 100.00% <ø> (ø)
src/event-stream/reader.ts 32.72% <20.00%> (-1.28%) ⬇️
src/datastore/postgres-store.ts 84.01% <80.00%> (+0.13%) ⬆️
src/migrations/1595337815840_sponsored_tx.ts 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a2b200...1518743. Read the comment docs.

INSERT INTO txs(
${TX_COLUMNS}
) values($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27)
) values($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way to do this without having to manually type out a series of numbers? Seems like a hassle 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'd think the sql driver would support a spread operator or something (maybe it does and I haven't found it idk).

At this point, probably makes sense to make a helper function that generates this string based off the array of input values.

@zone117x zone117x force-pushed the feat/sponsored-tx branch from c0385d8 to 2f69e17 Compare July 28, 2020 14:56
@zone117x zone117x merged commit 3679652 into master Jul 28, 2020
@zone117x zone117x deleted the feat/sponsored-tx branch July 28, 2020 15:16
@blockstack-devops
Copy link
Contributor

🎉 This PR is included in version 0.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants