Skip to content

Commit

Permalink
differentiate signer from signer entry
Browse files Browse the repository at this point in the history
  • Loading branch information
CreatureDev committed May 26, 2023
1 parent 77f9600 commit 6c0f486
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion model/client/account/account_objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestAccountObjectsResponse(t *testing.T) {
PreviousTxnID: "abc",
PreviousTxnLgrSeq: 123,
OwnerNode: "bob",
SignerEntries: []ledger.SignerEntry{},
SignerEntries: []ledger.SignerEntryWrapper{},
SignerListID: 213,
SignerQuorum: 0,
},
Expand Down
15 changes: 0 additions & 15 deletions model/ledger/signer_entry.go

This file was deleted.

14 changes: 13 additions & 1 deletion model/ledger/signer_list.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package ledger

import "github.com/xyield/xrpl-go/model/transactions/types"

type SignerListFlags uint32

const (
Expand All @@ -12,11 +14,21 @@ type SignerList struct {
PreviousTxnID string
PreviousTxnLgrSeq uint64
OwnerNode string
SignerEntries []SignerEntry
SignerEntries []SignerEntryWrapper
SignerListID uint64
SignerQuorum uint64
}

type SignerEntryWrapper struct {
SignerEntry SignerEntry
}

type SignerEntry struct {
Account types.Address
SignerWeight uint64
WalletLocator types.Hash256 `json:",omitempty"`
}

func (*SignerList) EntryType() LedgerEntryType {
return SignerListEntry
}
8 changes: 4 additions & 4 deletions model/ledger/signer_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ func TestSignerList(t *testing.T) {
OwnerNode: "0000000000000000",
PreviousTxnID: "5904C0DC72C58A83AEFED2FFC5386356AA83FCA6A88C89D00646E51E687CDBE4",
PreviousTxnLgrSeq: 16061435,
SignerEntries: []SignerEntry{
SignerEntries: []SignerEntryWrapper{
{
SignerEntry: Signer{
SignerEntry: SignerEntry{
Account: "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
SignerWeight: 2,
},
},
{
SignerEntry: Signer{
SignerEntry: SignerEntry{
Account: "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
SignerWeight: 1,
},
},
{
SignerEntry: Signer{
SignerEntry: SignerEntry{
Account: "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v",
SignerWeight: 1,
},
Expand Down
2 changes: 1 addition & 1 deletion model/transactions/signer_list_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
type SignerListSet struct {
BaseTx
SignerQuorum uint
SignerEntries []ledger.SignerEntry
SignerEntries []ledger.SignerEntryWrapper
}

func (*SignerListSet) TxType() TxType {
Expand Down
8 changes: 4 additions & 4 deletions model/transactions/signer_list_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ func TestSignerListSetTx(t *testing.T) {
Fee: types.XRPCurrencyAmount(12),
},
SignerQuorum: 3,
SignerEntries: []ledger.SignerEntry{
SignerEntries: []ledger.SignerEntryWrapper{
{
SignerEntry: ledger.Signer{
SignerEntry: ledger.SignerEntry{
Account: "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
SignerWeight: 2,
},
},
{
SignerEntry: ledger.Signer{
SignerEntry: ledger.SignerEntry{
Account: "rUpy3eEg8rqjqfUoLeBnZkscbKbFsKXC3v",
SignerWeight: 1,
},
},
{
SignerEntry: ledger.Signer{
SignerEntry: ledger.SignerEntry{
Account: "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n",
SignerWeight: 1,
},
Expand Down

0 comments on commit 6c0f486

Please sign in to comment.