Skip to content

Commit

Permalink
Cosmetics.
Browse files Browse the repository at this point in the history
  • Loading branch information
abourget committed May 13, 2018
1 parent f9cd953 commit dab5266
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type ActionData struct {

func NewActionData(obj interface{}) ActionData {
return ActionData{
HexData: []byte(""),
HexData: []byte{},
Data: obj,
toServer: true,
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/eosapi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func main() {
for _, key := range []string{
"5JuWeC5KwZRVUQZ4eneYCYQ6Pa132QgvDQzEVJBA7XTgNTBWWRw",
"5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3",
"5K6CAnUcDpJzBJBCve3QfQjEsxHrC8jqYgnYE1tDv4rKbDLG58N", // latest bios boot
"5Hq1ynaptFCkRCiZy4MRyJtHnXivCPBFMDaWw4bcnXpx7YuxQwo", // latest bios boot
} {
if err := keyBag.Add(key); err != nil {
log.Fatalln("Couldn't load private key:", err)
Expand Down Expand Up @@ -105,7 +105,7 @@ func main() {

actionResp, err := api.SignPushActions(

system.NewNewAccount(AC("eosio"), AC("aaaaaaaaaaab"), ecc.MustNewPublicKey("EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV")),
system.NewNewAccount(AC("eosio"), AC("aaaaaaaaaaac"), ecc.MustNewPublicKey("EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV")),

// token.NewTransfer(eos.AccountName("cbillett"), eos.AccountName("bozo"), eos.NewEOSAsset(100), ""),
)
Expand Down
2 changes: 2 additions & 0 deletions encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ func (e *Encoder) writeActionData(actionData ActionData) (err error) {
}
println(fmt.Sprintf("writing action data, %T", actionData.Data))
return e.writeByteArray(raw)
} else if actionData.HexData != nil {
return e.writeByteArray(actionData.HexData)
}

return e.writeByteArray([]byte{})
Expand Down
8 changes: 4 additions & 4 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ type PermissionLevel struct {

type PermissionLevelWeight struct {
Permission PermissionLevel `json:"permission"`
Weight uint16 `json:"weight"`
Weight uint16 `json:"weight"` // weight_type
}

type Authority struct {
Threshold uint32 `json:"threshold"`
Keys []KeyWeight `json:"keys"`
Accounts []PermissionLevelWeight `json:"accounts"`
Waits []WaitWeight `json:"waits"`
Keys []KeyWeight `json:"keys,omitempty"`
Accounts []PermissionLevelWeight `json:"accounts,omitempty"`
Waits []WaitWeight `json:"waits,omitempty"`
}

type KeyWeight struct {
Expand Down

0 comments on commit dab5266

Please sign in to comment.