Skip to content

Commit

Permalink
Move Config struct and related functions to pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-senechal committed Jul 24, 2024
1 parent 05b9b8e commit 3c2494d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions cmd/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/massalabs/DeWeb/int/config"
"github.com/massalabs/DeWeb/int/utils"
pkgConfig "github.com/massalabs/DeWeb/pkg/config"
"github.com/massalabs/DeWeb/pkg/website"
"github.com/massalabs/station/pkg/logger"
)
Expand All @@ -23,7 +24,7 @@ func main() {
logger.Fatalf("usage: %s <website.zip>", os.Args[0])
}

config := config.DefaultConfig("fullpower", "https://buildnet.massa.net/api/v2")
config := pkgConfig.DefaultConfig("fullpower", "https://buildnet.massa.net/api/v2")

address, err := deployWebsite(config)
if err != nil {
Expand All @@ -33,7 +34,7 @@ func main() {
logger.Infof("Website uploaded successfully to address: %s", address)
}

func deployWebsite(config *config.Config) (string, error) {
func deployWebsite(config *pkgConfig.Config) (string, error) {
logger.Debugf("Deploying website contract with config: %+v", config)

deploymentResult, err := website.Deploy(config)
Expand All @@ -58,7 +59,7 @@ func deployWebsite(config *config.Config) (string, error) {
return deploymentResult.Address, nil
}

func uploadChunks(chunks [][]byte, address string, config *config.Config) error {
func uploadChunks(chunks [][]byte, address string, config *pkgConfig.Config) error {
for i, chunk := range chunks {
logger.Debugf("Uploading chunk %d with size: %d", i, len(chunk))

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pkg/website/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
_ "embed"
"fmt"

"github.com/massalabs/DeWeb/int/config"
"github.com/massalabs/DeWeb/pkg/config"
"github.com/massalabs/station/pkg/node/sendoperation"
"github.com/massalabs/station/pkg/node/sendoperation/signer"
"github.com/massalabs/station/pkg/onchain"
Expand Down
2 changes: 1 addition & 1 deletion pkg/website/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package website
import (
"fmt"

"github.com/massalabs/DeWeb/int/config"
"github.com/massalabs/DeWeb/pkg/config"
mwUtils "github.com/massalabs/station-massa-wallet/pkg/utils"
"github.com/massalabs/station/pkg/convert"
"github.com/massalabs/station/pkg/logger"
Expand Down

0 comments on commit 3c2494d

Please sign in to comment.