https://github.com/jeiwan/makeos
EOS blockchain interaction automation tool (Proof of Concept)
https://github.com/jeiwan/makeos
blockchain eos eosio golang
Last synced: 3 months ago
JSON representation
EOS blockchain interaction automation tool (Proof of Concept)
- Host: GitHub
- URL: https://github.com/jeiwan/makeos
- Owner: Jeiwan
- Created: 2019-03-05T13:14:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T13:09:03.000Z (about 6 years ago)
- Last Synced: 2025-01-20T09:11:24.882Z (5 months ago)
- Topics: blockchain, eos, eosio, golang
- Language: Go
- Size: 44.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## makeos – EOS automation and contract testing tool (early development)
[](https://godoc.org/github.com/Jeiwan/makeos)### WARNING!
It's still in earliest development stage, APIs are not final, many useful and necessary things are missing, but it works! The name is also not final.### Usage example
```go
package token_testimport (
"testing". "github.com/Jeiwan/makeos"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)// `keosd` must already be running, `makeos` doesn't start it automatically.
func TestIssue(t *testing.T) {
DevEnvironment.Wallet = "default"
DevEnvironment.WalletPassword = "password"token := NewContract("/path/to/eosio.token")
token.Build()t.Run("ok", func(tt *testing.T) {
WithEnvironment(DevEnvironment, func(node *Node) {
tokenAcc := CreateAccount("eosio.token", EOSIO)
user := CreateAccount("user", EOSIO)token.Deploy(tokenAcc)
require.Nil(tt, node.LastError())token.PushAction(
"create",
map[string]interface{}{
"issuer": tokenAcc.Name,
"maximum_supply": "1000000.0000 EOS",
},
token.Account.Permission("active"),
)
require.Nil(tt, node.LastError())token.PushAction(
"issue",
map[string]interface{}{
"to": user.Name,
"quantity": "10.0000 EOS",
"memo": "testing",
},
token.Account.Permission("active"),
)
require.Nil(tt, node.LastError())rows := token.ReadTable("accounts", user.Name)
require.Nil(tt, node.LastError())
require.Len(tt, rows, 1)
assert.Equal(tt, "10.0000 EOS", rows[0]["balance"].(string))rows = token.ReadTable("stat", "EOS")
require.Nil(tt, node.LastError())
require.Len(tt, rows, 1)
assert.Equal(tt, "10.0000 EOS", rows[0]["supply"].(string))
})
})
}
```