Skip to content

Commit

Permalink
chore: run codespell
Browse files Browse the repository at this point in the history
  • Loading branch information
bojidar-bg committed Dec 26, 2023
1 parent d44ef31 commit a326152
Show file tree
Hide file tree
Showing 39 changed files with 321 additions and 338 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ test/e2e/minikube/run-test.sh teardown

## Development

After editing files in `proto/` or `contracts/`, make sure to run both of the following commands to sync the generated files:
After editing files in `proto/` or `contracts/`, make sure to run the following commands to sync the generated files:

```bash
forge build --root contracts
go generate
npm run -ws generate
```

<!-- Note that while committing generated files is foreign to Nodejs/NPM, it's the usual way of life in the Go ecosystem, as packages are directly cloned from git rather than downloaded from the package manager. Here we are committing both in order to not require forge/protoc for JavaScript development when it's optional for Go development. -->

## Contributing

As it is, this project is still in its infancy, and most non-trivial contributions should be done only after discussing them with the team -- or else risk missing the point. So, if you fancy contributing to the project, please feel free to hop on [our Discord server](https://discord.gg/C4e37Xhvt4) or just open/reply to an issue discussing your concrete ideas for contribution.
Expand Down
2 changes: 1 addition & 1 deletion cmd/tpodserver/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var withdrawContractCmd = &cobra.Command{
if err != nil {
return err
}
log.Println("Amount transfered successfully")
log.Println("Amount transferred successfully")
return nil
},
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tpodserver/listen.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var localOciRegistry string

var listenCmd = &cobra.Command{
Use: "listen",
Short: "Start a service listening for incomming execution requests",
Short: "Start a service listening for incoming execution requests",
RunE: func(cmd *cobra.Command, args []string) error {
ipfs, ipfsMultiaddr, err := tpipfs.GetIpfsClient(ipfsApi)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/tpodserver/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ func init() {

AddConfig("withdraw.address", &withdrawAddressString, "", "ethereum address to withdraw funds to")
AddConfig("withdraw.tolerace", &withdrawTolerance, "10", "tolerance for withdrawing from address")
AddConfig("withdraw.time", &withdrawTime, 100, "time in seconds between sucessive billing checks")
AddConfig("withdraw.time", &withdrawTime, 100, "time in seconds between successive billing checks")

}
2 changes: 1 addition & 1 deletion cmd/tpodserver/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ var subscribeCmd = &cobra.Command{

var registerCmd = &cobra.Command{
Use: "register",
Short: "uplods provider info to ipfs and register in the registry contract",
Short: "uploads provider info to ipfs and register in the registry contract",
RunE: func(cmd *cobra.Command, args []string) error {
ipfs, _, err := tpipfs.GetIpfsClient(ipfsApi)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/trustedpods/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func fetchAndFilterProviders(ipfs *rpc.HttpApi, ethClient *ethclient.Client) (pu
paymentContract := common.HexToAddress(paymentContractAddress)
payment, err := abi.NewPayment(paymentContract, ethClient)
if err != nil {
return nil, fmt.Errorf("Failed instanciating payment contract: %w", err)
return nil, fmt.Errorf("Failed instantiating payment contract: %w", err)
}
tokenContract, err = payment.Token(&bind.CallOpts{})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/trustedpods/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var _ = func() error {
fundFlags.StringVar(&publisherKey, "ethereum-key", "", "account string (private key | http[s]://clef#account | /keystore#account | account (in default keystore))")
fundFlags.StringVar(&paymentContractAddress, "payment-contract", "", "payment contract address")
fundFlags.StringVar(&podId, "pod-id", "", "pod id")
fundFlags.StringVar(&funds, "funds", "0", "intial funds")
fundFlags.StringVar(&funds, "funds", "0", "initial funds")
fundFlags.BoolVar(&debugMintFunds, "mint-funds", false, "Attempt minting funds with a mint(amount) call on the token")
fundFlags.Int64Var(&unlockTime, "unlock-time", 5*60, "time for unlocking tokens (in seconds)")

Expand Down
2 changes: 1 addition & 1 deletion cmd/trustedpods/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var containerName string

var logPodCmd = &cobra.Command{
Use: fmt.Sprintf("log [%s] [deployment.yaml]", publisher.DefaultPodFile),
Short: "get pod conatiner logs",
Short: "get pod container logs",
Args: cobra.ExactArgs(1),
GroupID: "main",
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/trustedpods/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var getTablesCmd = &cobra.Command{
paymentContract := common.HexToAddress(paymentContractAddress)
payment, err := abi.NewPayment(paymentContract, ethClient)
if err != nil {
return fmt.Errorf("Failed instanciating payment contract: %w", err)
return fmt.Errorf("Failed instantiating payment contract: %w", err)
}
tokenContract, err = payment.Token(&bind.CallOpts{})
if err != nil {
Expand Down
16 changes: 8 additions & 8 deletions contracts/src/Payment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ contract Payment {
if (leftoverFunds != 0) token.safeTransfer(publisher, leftoverFunds);
}

// allows the provider to withdraw as many tokens as would be needed to reach totalWithdrawlAmount since the opening of the channel
function withdrawUpTo(address publisher, bytes32 podId, uint256 totalWithdrawlAmount, address transferAddress)
// allows the provider to withdraw as many tokens as would be needed to reach totalWithdrawAmount since the opening of the channel
function withdrawUpTo(address publisher, bytes32 podId, uint256 totalWithdrawAmount, address transferAddress)
public
{
if (transferAddress == address(0)) {
Expand All @@ -124,19 +124,19 @@ contract Payment {

address provider = msg.sender;
Channel storage channel = channels[publisher][provider][podId];
if (totalWithdrawlAmount > channel.investedByPublisher) revert InsufficientFunds();
if (totalWithdrawlAmount <= channel.withdrawnByProvider) revert AmountRequired();
if (totalWithdrawAmount > channel.investedByPublisher) revert InsufficientFunds();
if (totalWithdrawAmount <= channel.withdrawnByProvider) revert AmountRequired();

uint256 transferAmonut = totalWithdrawlAmount - channel.withdrawnByProvider;
channel.withdrawnByProvider = totalWithdrawlAmount;
uint256 transferAmount = totalWithdrawAmount - channel.withdrawnByProvider;
channel.withdrawnByProvider = totalWithdrawAmount;

emit Withdrawn(publisher, provider, podId, transferAmonut);
emit Withdrawn(publisher, provider, podId, transferAmount);

if (channel.unlockedAt != 0) {
channel.unlockedAt = block.timestamp;
}

token.safeTransfer(transferAddress, transferAmonut);
token.safeTransfer(transferAddress, transferAmount);
}

// allows the provider to withdraw amount more tokens
Expand Down
Loading

0 comments on commit a326152

Please sign in to comment.