Skip to content

Commit

Permalink
chore: develop -> main (#370)
Browse files Browse the repository at this point in the history
* revert: cosmos submodule only (#362)

* revert: cosmos submodule only

* fix: rem

* fix: rem

* fix: update

* feat: add msg client

* fix: paths

* fix: try chaosnet ibc

* fix: path again

* fix: try hm

* fix: fixes to pass

* feat: eth protos (#366)

* fix: eth protos

* fix: client

* fix: fixes

* fix: try older nibiru

* fix: index

* fix: mainnet

* fix: import

* revert: build change

* chore: tests (#367)

* fix: all query tests

* chore: final tests

* fix: buf

* fix: fix

* fix: pull latest

* fix: build

* fix: build

* refactor(faucet)!: set default tokens (#369)

* chore: develop -> main (#368)

* revert: cosmos submodule only (#362)

* revert: cosmos submodule only

* fix: rem

* fix: rem

* fix: update

* feat: add msg client

* fix: paths

* fix: try chaosnet ibc

* fix: path again

* fix: try hm

* fix: fixes to pass

* feat: eth protos (#366)

* fix: eth protos

* fix: client

* fix: fixes

* fix: try older nibiru

* fix: index

* fix: mainnet

* fix: import

* revert: build change

* chore: tests (#367)

* fix: all query tests

* chore: final tests

* fix: buf

* fix: fix

* fix: pull latest

* fix: build

* fix: build

* chore(release): 4.5.1

### [4.5.1](v4.5.0...v4.5.1) (2024-08-09)

### Miscellaneous Chores

* develop -> main ([#368](#368)) ([c6d6570](c6d6570)), closes [#362](#362) [#366](#366) [#367](#367)

 [skip ci]

* fix(faucet): remove unused tokens from default faucet request

* fix: bump test

---------

Co-authored-by: Cameron Gilbert <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>

---------

Co-authored-by: Kevin Yang <[email protected]>
Co-authored-by: semantic-release-bot <[email protected]>
  • Loading branch information
3 people authored Aug 15, 2024
1 parent ead8b15 commit ec2a25b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
7 changes: 3 additions & 4 deletions src/sdk/utils/faucet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe("useFaucet", () => {
test("should request funds from faucet with default amounts", async () => {
await useFaucet({ address, chain, grecaptcha })

const expectedCoins = ["11000000unibi", "100000000unusd", "100000000uusdt"]
const expectedCoins = ["10000000unibi"]

expect(fetch).toHaveBeenCalledWith(expectedUrl, {
method: "POST",
Expand All @@ -91,10 +91,9 @@ describe("useFaucet", () => {
})

test("should request funds from faucet with custom amounts", async () => {
const amts = { nibi: 5, nusd: 50, usdt: 50 }
await useFaucet({ address, chain, amts, grecaptcha })
await useFaucet({ address, chain, grecaptcha })

const expectedCoins = ["5000000unibi", "50000000unusd", "50000000uusdt"]
const expectedCoins = ["10000000unibi"]

expect(fetch).toHaveBeenCalledWith(expectedUrl, {
method: "POST",
Expand Down
19 changes: 2 additions & 17 deletions src/sdk/utils/faucet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,18 @@ import { fetch } from "cross-fetch"
import { Chain, chainToParts } from "."

/**
* Sends 11 NIBI, 100 NUSD, and 100 USDT to the given address from the testnet faucet.
* Sends 10 NIBI to the given address from the testnet faucet.
*/
export async function useFaucet({
address,
chain,
amts,
grecaptcha,
}: {
address: string
chain: Chain
amts?: { nibi: number; nusd: number; usdt: number }
grecaptcha: string
}): Promise<Response | undefined> {
if (!amts) {
// default values
amts = {
nibi: 11,
nusd: 100,
usdt: 100,
}
}

const coins: string[] = [
`${amts.nibi * 1e6}unibi`,
`${amts.nusd * 1e6}unusd`,
`${amts.usdt * 1e6}uusdt`,
]
const coins: string[] = [`${10e6}unibi`]
const faucetUrl = faucetUrlFromChain(chain)

// Execute faucet request
Expand Down

0 comments on commit ec2a25b

Please sign in to comment.