This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/ecdsa" | |
"crypto/rand" | |
"fmt" | |
"log" | |
"github.com/ethereum/go-ethereum/common" | |
"github.com/ethereum/go-ethereum/common/hexutil" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"github.com/defiweb/go-eth/rpc" | |
"github.com/defiweb/go-eth/rpc/transport" | |
"github.com/defiweb/go-eth/types" | |
"github.com/defiweb/go-eth/wallet" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package state is for implementing a simple state machine. | |
// In a [tea.Model.Update] method one can use a `case` for a [Transition] message to change the state. | |
// | |
// case state.Transition: | |
// if !msg.Used() { | |
// m.State = msg.State() | |
// return m, msg.AsUsed() | |
// } | |
package state |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func must[t any](c t, err error) t { | |
if err != nil { | |
log.Fatalln(err) | |
} | |
return c | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is an example for: | |
// https://www.tegh.net/2021/12/12/homemade-cli-tools/ | |
package main | |
import ( | |
"errors" | |
"fmt" | |
"io" | |
"log" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"sync" | |
"time" | |
) | |
type SemaphoredWaitGroup struct { | |
sem chan bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM bash | |
COPY test*.sh ./ | |
RUN bash test_scenario.sh |