Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/content/cre/getting-started/snippets/part-1-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ func main() {
// The runner is initialized with our Config struct.
// It will automatically parse the config.json file into this struct.
wasm.NewRunner(cre.ParseJSON[Config]).Run(InitWorkflow)
}
}
4 changes: 2 additions & 2 deletions src/content/cre/getting-started/snippets/part-2-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// Add the ApiUrl to your config struct
type Config struct {
Schedule string `json:"schedule"`
ApiUrl string `json:"apiUrl"`
ApiUrl string `json:"apiUrl"`
}

type MyResult struct {
Expand Down Expand Up @@ -83,4 +83,4 @@ func onCronTrigger(config *Config, runtime cre.Runtime, trigger *cron.Payload) (

func main() {
wasm.NewRunner(cre.ParseJSON[Config]).Run(InitWorkflow)
}
}
3 changes: 2 additions & 1 deletion src/content/cre/getting-started/snippets/part-3-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Config struct {
ApiUrl string `json:"apiUrl"`
Evms []EvmConfig `json:"evms"`
}

// highlight-end

type MyResult struct {
Expand Down Expand Up @@ -108,4 +109,4 @@ func onCronTrigger(config *Config, runtime cre.Runtime, trigger *cron.Payload) (

func main() {
wasm.NewRunner(cre.ParseJSON[Config]).Run(InitWorkflow)
}
}
5 changes: 4 additions & 1 deletion src/content/cre/getting-started/snippets/part-4-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type EvmConfig struct {
CalculatorConsumerAddress string `json:"calculatorConsumerAddress"`
GasLimit uint64 `json:"gasLimit"`
}

// highlight-end

type Config struct {
Expand All @@ -42,6 +43,7 @@ type MyResult struct {
FinalResult *big.Int
TxHash string
}

// highlight-end

func InitWorkflow(config *Config, logger *slog.Logger, secretsProvider cre.SecretsProvider) (cre.Workflow[*Config], error) {
Expand Down Expand Up @@ -169,8 +171,9 @@ func updateCalculatorResult(config *Config, runtime cre.Runtime, chainSelector u
logger.Info("View transaction at", "url", fmt.Sprintf("https://sepolia.etherscan.io/tx/%s", txHash))
return txHash, nil
}

// highlight-end

func main() {
wasm.NewRunner(cre.ParseJSON[Config]).Run(InitWorkflow)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,3 @@ func InitWorkflow(config *Config, logger *slog.Logger, secretsProvider cre.Secre
func main() {
wasm.NewRunner(cre.ParseJSON[Config]).Run(InitWorkflow)
}

Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ func InitWorkflow(config *Config, logger *slog.Logger, secretsProvider cre.Secre
func main() {
wasm.NewRunner(cre.ParseJSON[Config]).Run(InitWorkflow)
}