Skip to content

Instantly share code, notes, and snippets.

View JakeHartnell's full-sized avatar
:shipit:

Jake Hartnell JakeHartnell

:shipit:
View GitHub Profile
@JakeHartnell
JakeHartnell / README.md
Created February 1, 2023 00:00
Encoding, Signing, and Broadcasting transactions with CosmJS

Encoding, Signing, and Broadcasting transactions with CosmJS

By default, CosmJS builds, signs, and broadcasts a transactions in a single function call. Often, it's useful to separate these steps.

This gist explores a simple way of doing so in TypeScript, and may also be useful for those wanting to dive deeper into how Cosmos messages are composed and signed.

Setup

You will need a few dependencies:

@JakeHartnell
JakeHartnell / README.md
Last active March 19, 2024 16:46
Include README.md files in rust documentation generation

Include README.md in documentation generation and tests

Recentely, I was trying to make sure our README.md files for DAO DAO were included in the documentation generated by cargo doc or rustdoc. Moreover, I wanted code examples in our README.md files to be tested.

Here's a quick gist...

There is of course the doc attribute, and the rust book contains the following example which you are meant to include in your lib.rs or main.rs: