Skip to content

Commit

Permalink
chore: add test injector
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <[email protected]>
  • Loading branch information
n0izn0iz committed May 7, 2024
1 parent ab86c8b commit c2478ce
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/gno.land/r/demo/teritori/inject_project/gno.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module gno.land/r/demo/teritori/inject_project

require gno.land/r/demo/teritori/projects_manager v0.0.0-latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package inject_project

import (
"std"

"gno.land/r/demo/teritori/projects_manager"
)

func CreateDemoProject() {
projects_manager.CreateContract(
std.Address(""),
std.CurrentRealm().Addr(),
"ugnot",
`{
"shortDescData": {
"name": "My Awesome Blog",
"desc": "A blog about my awesome life",
"tags": "frontend,ui,ux",
"coverImg": "ipfs://bafybeihlfopxuwgrjjgkxn46j73dse4g3v5qcpv6z7ycaujpnu2qzpdaiq"
},
"teamAndLinkData": {
"websiteLink": "https://website.com",
"twitterProfile": "https://twitter.com",
"discordLink": "https://discord.com",
"githubLink": "https://github.com",
"teamDesc": "This is long team description"
}
}`,
200000,
"Bootstrap repository,Create Home page",
"Create a GitHub repository with\n- These\n- Tech\n- Requirements,Create the Home page with\n- These\n- UI/UX\n- Requirements",
"42,420",
"3600,36000",
",",
"MS_PRIORITY_HIGH,MS_PRIORITY_MEDIUM",
"g108cszmcvs4r3k67k7h5zuhm4el3qhlrxzhshtv",
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ func CreateContract(
sent := std.GetOrigSend()
amount := sent.AmountOf(paymentDenom)
if amount != projectBudget {
panic("funder should send all the needed funds at instantiation")
panic(ufmt.Sprintf("funder `%s` should send `%d%s`, got `%d%s`", caller, amount, paymentDenom, sent, paymentDenom))
}
funded = true
}
Expand Down

0 comments on commit c2478ce

Please sign in to comment.