Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upstream #2

Open
wants to merge 334 commits into
base: portto
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
334 commits
Select commit Hold shift + click to select a range
ee513b4
feat: refactor get block time
yihau Oct 6, 2021
cdccf32
feat: replace 'WithCfg' to 'WithConfig'
yihau Oct 6, 2021
23c9b62
feat: refactor get identity
yihau Oct 6, 2021
98d7d65
feat: refactor get genesis hash
yihau Oct 6, 2021
0be21fa
feat(rpc, client): refactor get first available block
yihau Oct 6, 2021
a187807
feat(rpc,client): refactor get version
yihau Oct 6, 2021
a52b8ab
feat(rpc,client): refactor request airdrop
yihau Oct 6, 2021
dfba35f
feat(rpc,client): refactor minimum ledger slot
yihau Oct 6, 2021
5456098
feat(rpc,client): refactor get transaction count
yihau Oct 6, 2021
97a89fe
feat(rpc,client): refactor get token supply
yihau Oct 6, 2021
1207ec3
feat(rpc): remove deprecated api
yihau Oct 8, 2021
0fa7645
feat(rpc): refactor get signatures for address
yihau Oct 9, 2021
e48af24
feat(rpc): refactor getSignatureStatues
yihau Oct 9, 2021
2024217
feat(rpc): refoctor get blocks
yihau Oct 11, 2021
89bc572
feat(rpc): refactor get blocks with limit
yihau Oct 11, 2021
b0482c4
feat(rpc): refactor get inflaction rate
yihau Oct 11, 2021
37f0882
feat(rpc): refactor get block commitment
yihau Oct 11, 2021
e7c344e
feat(rpc): refactor get epoch info
yihau Oct 11, 2021
60252b4
feat(rpc): remove some old function
yihau Oct 14, 2021
2a5d10b
feat(client): rename SendTransaction to QuickSendTransaction
yihau Oct 14, 2021
3e2c24c
feat(client): rename SendTransaction2 => SendTransaction
yihau Oct 14, 2021
40c9d23
feat(sysprog): refine CreateAccount's arguments
yihau Oct 17, 2021
15a113e
feat(sysprog): refine Assign's arguments
yihau Oct 17, 2021
699eb02
feat(sysprog): refine Transfer's arguments
yihau Oct 17, 2021
ee43dcc
feat(sysprog): refine CreateAccountWithSeed's arguments
yihau Oct 17, 2021
51f9225
feat(sysprog): refine AdvanceNonceAccount's arguments
yihau Oct 17, 2021
feb86fd
feat(sysprog): refine WithdrawNonceAccount's arguments
yihau Oct 17, 2021
7b52f68
feat(sysprog): refine InitializeNonceAccount's arguments
yihau Oct 17, 2021
21e692b
feat(sysprog): refine AuthorizeNonceAccount's arguments
yihau Oct 17, 2021
e0e3063
feat(sysprog): refine Allocate's arguments
yihau Oct 17, 2021
082cf84
feat(sysprog): refine AllocateWithSeed's arguments
yihau Oct 17, 2021
0c1ebee
feat(sysprog): refine AssignWithSeed's arguments
yihau Oct 17, 2021
1824454
feat(sysprog): refine TransferWithSeed's arguments
yihau Oct 17, 2021
c82997b
feat(tokenprog): refine InitializeMint's arguments
yihau Oct 17, 2021
3a75491
feat(tokenprog): refine InitializeAccount's arguments
yihau Oct 17, 2021
2b59305
feat(tokenprog): refine InitializeMultisig's arguments
yihau Oct 17, 2021
b3698c3
feat(tokenprog): refine Transfer's arguments
yihau Oct 17, 2021
bee16b4
feat(tokenprog): refine Approve's arguments
yihau Oct 17, 2021
d7da5a2
feat(tokenprog): refine Revoke's arguments
yihau Oct 17, 2021
9f1fbfc
feat(tokenprog): refine SetAuthority's arguments
yihau Oct 17, 2021
5c37b97
feat(tokenprog): refine MintTo's arguments
yihau Oct 17, 2021
b2cf1d1
feat(tokenprog): refine Burn's arguments
yihau Oct 17, 2021
4be63fe
feat(tokenprog): refine CloseAccount's arguments
yihau Oct 17, 2021
a8a643e
feat(tokenprog): refine FreezeAccount's arguments
yihau Oct 17, 2021
885ea5d
feat(tokenprog): refine ThawAccount's arguments
yihau Oct 17, 2021
0517eb2
feat(tokenprog): refine TransferChecked's arguments
yihau Oct 17, 2021
6085c22
feat(tokenprog): refine ApproveChecked's arguments
yihau Oct 17, 2021
b29101a
feat(tokenprog): refine MintToChecked's arguments
yihau Oct 17, 2021
85ec6ec
feat(tokenprog): refine BurnChecked's arguments
yihau Oct 17, 2021
b344f65
feat(asstokenprog): refine CreateAssociatedTokenAccount's arguments
yihau Oct 17, 2021
6342cc0
feat(stakeprog): extract instruction's arguments
yihau Oct 17, 2021
b6f1bce
feat(tokenprog): refine InitializeAccount2's arguments
yihau Oct 17, 2021
22929a2
feat(tokenprog): refine SyncNative's arguments
yihau Oct 17, 2021
d4acf3d
feat(tokenprog): add InitializeAccount3
yihau Oct 17, 2021
43d22ce
feat(tokenprog): add InitializeMultisig2
yihau Oct 17, 2021
570e93e
feat(tokenprog): add InitializeMint2
yihau Oct 17, 2021
fb379ec
feat(tokenmeta): extract CreateMetadataAccount
yihau Oct 17, 2021
9d11076
feat(rpc): add get token account by owner
yihau Oct 17, 2021
4513a7a
feat: update version
yihau Oct 17, 2021
6eb1e30
feat(client): don't wrapped rpc client
yihau Oct 19, 2021
2d962c0
feat(client): remove SendRawTransaction
yihau Oct 19, 2021
66c0133
feat(types): update ambiguous transaction and message api
yihau Oct 19, 2021
3d27492
feat(examples): update examples endpoints
yihau Oct 19, 2021
d26d685
feat(types): remove accounts deprecated func
yihau Oct 19, 2021
95ce65f
feat: go mod tidy
yihau Oct 19, 2021
14acd5b
feat: update readme
yihau Oct 19, 2021
154c764
feat: fix v2 issue
yihau Oct 20, 2021
7e04aa1
feat(rpc,client): add get cluster nodes
yihau Oct 26, 2021
0799f72
feat(rpc): add get block production
yihau Oct 26, 2021
c4c29a2
feat(rpc): add get epoch schedule
yihau Oct 26, 2021
423ecdf
feat(rpc): fix test name
yihau Oct 26, 2021
2c23eb4
feat(rpc): add get fee calculator for blockhash
yihau Oct 26, 2021
96b0517
feat(rpc): add getFeeRateGovernor
yihau Oct 26, 2021
7b258b3
feat(rpc): add getFees
yihau Oct 26, 2021
0baa73b
feat(rpc): add getInflationGovernor
yihau Oct 26, 2021
ae61274
feat(common): add IsOnCurve
yihau Oct 27, 2021
10987d7
feat: remove unused type
yihau Oct 27, 2021
23f8b3c
feat(client): add sendTransactionWithConfig
yihau Oct 27, 2021
e88b6c0
feat(rpc): add getInflationReward
yihau Oct 27, 2021
e6823ca
fix(rpc): getVersion type mismatch
yihau Oct 27, 2021
e5dadde
docs: update sdk version
yihau Oct 27, 2021
30573f0
docs: update release badge
yihau Oct 27, 2021
4368cea
fix: handle bs58 decode zero length data
yihau Nov 3, 2021
b49d588
docs: v1.10.1
yihau Nov 3, 2021
9ca9171
fix: issue #31
yihau Nov 7, 2021
cb2a703
docs: v1.10.2
yihau Nov 7, 2021
a7e8eca
Add KeccakSecp256k1 instructions and test
Aphoh Nov 8, 2021
9c7f5a1
Merge branch 'portto:main' into main
Aphoh Nov 8, 2021
67d3769
Swap `go-ethereum` for `ipsn/go-secp256k1`,`sha3`
Aphoh Nov 9, 2021
5577159
Change `Sign` to private
Aphoh Nov 9, 2021
0c6f9ae
TransactionMetaTokenBalance add optinal owner
crossle Nov 12, 2021
95b9f0f
Merge pull request #34 from crossle/main
yihau Nov 12, 2021
555bc27
fix(rpc, client): handle not found tx
yihau Nov 18, 2021
57a7afe
feat: add more tokenmeta program instruction
yihau Nov 22, 2021
d9d1c71
feat(client): add getAccountWithConfig
yihau Nov 22, 2021
3a1628a
feat(clinet): add GetSignatureStatus, GetSignatureStatusWithConfig, G…
yihau Nov 22, 2021
c0fc897
fix(rpc): simulate tx account info is a nullable value
yihau Nov 22, 2021
6929470
feat(client): add simulate transaction
yihau Nov 22, 2021
916c629
feat(types): add account from seed
yihau Nov 23, 2021
7c4e000
docs: update version
yihau Nov 23, 2021
20d0fb8
Merge pull request #33 from Aphoh/main
yihau Dec 9, 2021
d8ed999
feat: bump to v1.12.0
yihau Dec 9, 2021
858cc1f
Add getMultipleAccounts RPC method
Aphoh Dec 9, 2021
8b1d3c9
Merge pull request #36 from Aphoh/main
yihau Dec 10, 2021
ef04e86
Remove ipsn/go-secp256k1 and related code
Aphoh Dec 10, 2021
5a2b48e
Merge pull request #37 from Aphoh/main
yihau Dec 11, 2021
130caad
feat(rpc): add getLatestBlockhash
yihau Jan 14, 2022
7b2992e
docs: add deprecated hint for getRecentBlockhash
yihau Jan 14, 2022
97a407b
feat(rpc): add getFeeForMessage
yihau Jan 14, 2022
3f11c5f
feat(rpc): add isBlockhashValid
yihau Jan 14, 2022
b3e7379
feat(rpc): add deprecated hint for getFeeRateGovernor
yihau Jan 14, 2022
165044d
docs: update some outdated hint
yihau Jan 14, 2022
0d563ec
feat(client): add get latest blockhash
yihau Jan 14, 2022
e831a6b
feat(client): add isBlockhashValid
yihau Jan 14, 2022
421d648
feat(client): add getFeeForMessage
yihau Jan 14, 2022
74e414a
Merge pull request #43 from portto/rpc-update
yihau Jan 14, 2022
5c2c30e
docs: update version
yihau Jan 14, 2022
bb8f82a
feat: ata program should carry data
yihau Feb 10, 2022
c2451c2
docs: update version
yihau Feb 10, 2022
080f3d5
feat: add memo program
yihau Feb 16, 2022
8b988ea
Merge pull request #46 from portto/memo-program
yihau Feb 16, 2022
f9dea11
feat: add compute budget program
yihau Feb 22, 2022
a2edb0c
feat: add hdwallet derived function
yihau Feb 26, 2022
55b476d
feat: init gh page docs
yihau Feb 28, 2022
088b63b
v1.14.0
yihau Feb 28, 2022
6e70a6f
feat(client): add get signatures for address
yihau Mar 2, 2022
d5fff63
feat(tokenmeta): add update metadata instruction
yihau Mar 2, 2022
126a9a8
feat(tokenmeta): add sign metadata instruciton
yihau Mar 2, 2022
6ddfc33
feat(tokenmeta): add create metadata account v2 and create master edi…
yihau Mar 2, 2022
30b97e9
feat: update docs
yihau Mar 2, 2022
b1234a6
feat: update readme
yihau Mar 2, 2022
75c12f9
feat(client): add get nonce account and get nonce from nonce account
yihau Mar 10, 2022
4af558a
docs: add durable nonce and memo
yihau Mar 10, 2022
11d8797
feat(rpc): print error body
yihau Mar 10, 2022
5c28584
Update spelling to executable
pyvirus Mar 12, 2022
2dd08f2
Merge pull request #49 from leecarney/patch/typo-executable
yihau Mar 12, 2022
8d12895
feat: add get account info test case
yihau Mar 15, 2022
62cb696
Add support for Metaplex Token Metadata Standard v1.2.0 fields.
omarkilani Apr 8, 2022
ffb708d
Merge pull request #50 from omarkilani/main
yihau Apr 12, 2022
8116043
feat: add SetComputeUnitLimit and SetComputeUnitPrice to Compute Budg…
yihau May 25, 2022
e795bea
docs: example use getLatestBlockash instaed of getRecentBlockhash
yihau May 25, 2022
29a831f
feat: add upgrade nonce account
yihau Jun 15, 2022
2c3ecad
docs: add some nonce account operation example
yihau Jun 15, 2022
3379219
docs: update page
yihau Jun 15, 2022
6eab649
Add support for Metaplex Token Metadata Standard v1.3.0. (#69)
omarkilani Jul 24, 2022
6f4f75e
Implement SDK options and add support for a custom http client (#66)
adelowo Jul 24, 2022
6dd891e
docs: add get signatures for address (#73)
yihau Jul 24, 2022
2155cc3
add DeserializeTokenAccount
yihau Aug 4, 2022
76b9192
add get token account
yihau Aug 4, 2022
6866e83
change account owner type from string to pubkey
yihau Aug 4, 2022
dd58faf
extract accountInfo type
yihau Aug 4, 2022
29e242a
add get token accounts by owner
yihau Aug 4, 2022
2cf82b2
Merge pull request #80 from portto/add-get-token-account-method
yihau Aug 4, 2022
e75107a
use latest borsh-go
yihau Aug 4, 2022
2251848
Allow deserialization of corrupt on-chain metadata. (#81)
omarkilani Aug 9, 2022
1aa7068
fix FindProgramAddress and FindAssociatedTokenAddress return type
yihau Aug 14, 2022
3e7515c
add address lookup program (#83)
yihau Aug 14, 2022
0c57d52
bump go v1.19 (#85)
yihau Aug 23, 2022
85b64a5
feat(rpc): get blocks with limit use generic
yihau Aug 23, 2022
c798b92
support v0 transaction/message (#86)
yihau Aug 23, 2022
ef30251
use io instead of ioutils
yihau Aug 23, 2022
45ed133
audit fix
yihau Aug 23, 2022
d68dd55
use readable names as program package names (#87)
yihau Aug 24, 2022
12a7c45
pointer pkg uses generic function (#88)
yihau Aug 24, 2022
28415e0
chore: update ci script (#89)
yihau Aug 24, 2022
3bcd858
add tx/message bench test (#90)
yihau Aug 24, 2022
e930b95
ParentSLot -> ParentSlot (#93)
omarkilani Sep 1, 2022
6c0fc52
removed unused struct (#98)
yihau Sep 16, 2022
bc7b9ab
make jsonRpcError fit to error type (#97)
yihau Sep 19, 2022
8b95bf6
add pointer pkg test (#100)
yihau Sep 25, 2022
b8c054d
add slot hashes (#101)
yihau Sep 30, 2022
f805c11
Add maxSupportedTransactionVersion to getBlock RPC (#103)
thiagosantana-mb Sep 30, 2022
89d25af
add loaded addresses (#104)
yihau Sep 30, 2022
f486936
make get transaction use []any
yihau Oct 4, 2022
0f84378
revert make get transaction use []any. make instruction slice as an a…
yihau Oct 4, 2022
a6e8107
fix encoding
yihau Oct 12, 2022
9330f26
support multiple account lookup address (#106)
yihau Oct 23, 2022
516edb6
feat(rpc, client): simulate transaction support return data
yihau Oct 27, 2022
9037880
feat(rpc): get transaction support version tag
yihau Oct 27, 2022
ee0e20c
feat(rpc): get transaction support get data
yihau Oct 27, 2022
583ec7e
feat(rpc): get block support return data
yihau Oct 27, 2022
fd4434b
feat(rpc): get block/transaction support compute units comsumed
yihau Oct 27, 2022
3170b73
chore: remove unnecessary type arguments
yihau Oct 30, 2022
865ab0c
Implement GetBlockWithConfig, which is a version of GetBlock that all…
ffc0 Nov 1, 2022
53a144c
chore: use private call method (#109)
yihau Nov 2, 2022
efe4f10
feat(rpc): add get vote accounts (#110)
yihau Nov 3, 2022
1b6a85f
feat(rpc): rename VoteAccountInfo => VoteAccount
yihau Nov 5, 2022
25fc86c
Return error on parse error (#113)
ffc0 Nov 16, 2022
9928d96
Remove `omitempty` from `DataSlice` fields. (#114)
omarkilani Dec 13, 2022
c29fbc3
Propagate `MaxSupportedTransactionVersion` (#115)
omarkilani Dec 14, 2022
ee428fc
Expose `LoadedAddresses`, `ReturnData` and `ComputeUnitsConsumed` on …
omarkilani Dec 14, 2022
de37d65
chore: add client_test (#118)
yihau Dec 20, 2022
44a9b88
chore: use ValueWithContext type (#119)
yihau Dec 27, 2022
85089d3
feat: error handling for empty message (#120)
andy74139 Jan 9, 2023
3774646
refactor(client): get balance
yihau Dec 29, 2022
b13bab4
refactor(client): get account info
yihau Jan 8, 2023
836bbc6
refactor(client): get latest blockhash
yihau Jan 8, 2023
4380746
refactor(client): get slot
yihau Jan 8, 2023
a91343d
refactor(client): get token supply
yihau Jan 8, 2023
0e6519d
refactor(client): get token amount
yihau Jan 8, 2023
a0fef6b
refactor(client): is blockhash valid
yihau Jan 8, 2023
a84857c
refactor(client): send transaction
yihau Jan 8, 2023
0512429
refactor(client): get signatures for address
yihau Jan 8, 2023
6d281d0
refactor(client): get multiple accounts
yihau Jan 8, 2023
081c8a4
refactor(client): get fee for message
yihau Jan 9, 2023
3f8952a
refactor(client): simulate transaction
yihau Jan 9, 2023
d3875bf
refactor(client): get minimum balance for rent exemption
yihau Jan 9, 2023
f786a4c
refactor(client): get first available block
yihau Jan 9, 2023
337aa99
refactor(client): get genesis hash
yihau Jan 9, 2023
6515d0e
refactor(client): get version
yihau Jan 9, 2023
d4826d3
refactor(client): minimum ledger slot
yihau Jan 9, 2023
5caf171
refactor(client): get transaction count
yihau Jan 9, 2023
66be2a2
refactor(client): request airdrop
yihau Jan 9, 2023
b07831e
fix(rpc): get block time may be null
yihau Jan 9, 2023
ffff519
refactor(client): get block time
yihau Jan 9, 2023
c3ccad3
refactor(client): get identity
yihau Jan 9, 2023
310b0de
refactor(client): get cluster nodes
yihau Jan 9, 2023
5d3c7ed
chore: clean deprecated functions
yihau Jan 11, 2023
cf12400
chore: add deprecated tag to QuickSendTransaction
yihau Jan 11, 2023
8ced0d2
refactor(client): get transaction (#123)
yihau Feb 4, 2023
7ac1716
Add `ProgrammableNonFungible` to `Metadata.TokenStandard`. (#124)
omarkilani Feb 8, 2023
d528ca0
feat: support more ATA instructions (#127)
yihau Mar 5, 2023
53d485d
docs: add program 101 (#130)
yihau May 30, 2023
9ba0558
refactor(client): get token accounts by owner
yihau May 30, 2023
5131630
add token2022 program id
yihau May 30, 2023
7101332
rpc: return nil block when no block
yihau Jun 16, 2023
1c3eed8
use same reward type
yihau Jun 16, 2023
a115a5a
refactor(client): get block
yihau Jun 19, 2023
f442c24
chore: remove oudated files
yihau Jun 19, 2023
acf7916
chore: extend a function
yihau Jun 20, 2023
ef6b589
extend JsonRpcResponse[ValueWithContext[SignatureStatuses]
yihau Jun 22, 2023
3e1ef41
feat(client): refactor rpc get signature statuses
yihau Jun 22, 2023
746b694
feat: add CreateMetadataAccountV3 (#135)
yihau Jun 23, 2023
2bc7efe
chore: org renaming
yihau Jul 7, 2023
093a419
Add `ProgrammableConfig` to token metadata struct. (#137)
omarkilani Aug 2, 2023
0f36048
feat: use a custom token account struct in client (#141)
yihau Aug 10, 2023
558c81b
fix json marshal/unmarshal (#143)
yihau Aug 12, 2023
22328cd
rpc: add get health
yihau Nov 14, 2023
5702662
feat(client): add get health
yihau Nov 14, 2023
9b2c2b9
feat(client): add get epoch info
yihau Nov 14, 2023
d91633d
feat: add get recent prioritization fees
yihau Dec 22, 2023
ddd0f37
client: port get vote account
yihau Feb 14, 2024
adeb9e3
add stake docs
yihau Feb 14, 2024
7a2802c
add upgradeable program id
yihau Feb 14, 2024
e9fcffc
add update metadata v2 method
yihau Feb 26, 2024
08bc9af
add UnitConsumed to simulateTransaction RPC method
yihau Apr 13, 2024
6943fb5
add getSlotLeader
yihau May 5, 2024
dd8ae18
add get slot leaders
yihau May 7, 2024
b0b5702
Add verify collection instruction (#167)
Trisato May 15, 2024
d16de8d
fix option account of verify collection (#168)
Trisato May 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(sysprog): refine CreateAccountWithSeed's arguments
  • Loading branch information
yihau committed Oct 17, 2021
commit ee43dcc9ad22480e41448388400fdd868a950eac
30 changes: 20 additions & 10 deletions program/sysprog/instruction.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,17 @@ func Transfer(param TransferParam) types.Instruction {
}
}

func CreateAccountWithSeed(fromPubkey, newAccountPubkey, basePubkey, programID common.PublicKey, seed string, lamports, space uint64) types.Instruction {
type CreateAccountWithSeedParam struct {
From common.PublicKey
New common.PublicKey
Base common.PublicKey
Owner common.PublicKey
Seed string
Lamports uint64
Space uint64
}

func CreateAccountWithSeed(param CreateAccountWithSeedParam) types.Instruction {
data, err := bincode.SerializeData(struct {
Instruction Instruction
Base common.PublicKey
Expand All @@ -121,23 +131,23 @@ func CreateAccountWithSeed(fromPubkey, newAccountPubkey, basePubkey, programID c
ProgramID common.PublicKey
}{
Instruction: InstructionCreateAccountWithSeed,
Base: basePubkey,
Seed: seed,
Lamports: lamports,
Space: space,
ProgramID: programID,
Base: param.Base,
Seed: param.Seed,
Lamports: param.Lamports,
Space: param.Space,
ProgramID: param.Owner,
})
if err != nil {
panic(err)
}

accounts := make([]types.AccountMeta, 0, 3)
accounts = append(accounts,
types.AccountMeta{PubKey: fromPubkey, IsSigner: true, IsWritable: true},
types.AccountMeta{PubKey: newAccountPubkey, IsSigner: false, IsWritable: true},
types.AccountMeta{PubKey: param.From, IsSigner: true, IsWritable: true},
types.AccountMeta{PubKey: param.New, IsSigner: false, IsWritable: true},
)
if basePubkey != fromPubkey {
accounts = append(accounts, types.AccountMeta{PubKey: basePubkey, IsSigner: true, IsWritable: false})
if param.Base != param.From {
accounts = append(accounts, types.AccountMeta{PubKey: param.Base, IsSigner: true, IsWritable: false})
}

return types.Instruction{
Expand Down
42 changes: 20 additions & 22 deletions program/sysprog/instruction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,7 @@ func TestTransfer(t *testing.T) {

func TestCreateAccountWithSeed(t *testing.T) {
type args struct {
fromPubkey common.PublicKey
newAccountPubkey common.PublicKey
basePubkey common.PublicKey
programID common.PublicKey
seed string
lamports uint64
space uint64
param CreateAccountWithSeedParam
}
tests := []struct {
name string
Expand All @@ -141,13 +135,15 @@ func TestCreateAccountWithSeed(t *testing.T) {
}{
{
args: args{
fromPubkey: common.PublicKeyFromString("EvN4kgKmCmYzdbd5kL8Q8YgkUW5RoqMTpBczrfLExtx7"),
newAccountPubkey: common.PublicKeyFromString("DTA7FmUNYuQs2mScj2Lx8gQV63SEL1zGtzCSvPxtijbi"),
basePubkey: common.PublicKeyFromString("EvN4kgKmCmYzdbd5kL8Q8YgkUW5RoqMTpBczrfLExtx7"),
programID: common.SystemProgramID,
seed: "0",
lamports: 0,
space: 0,
param: CreateAccountWithSeedParam{
From: common.PublicKeyFromString("EvN4kgKmCmYzdbd5kL8Q8YgkUW5RoqMTpBczrfLExtx7"),
New: common.PublicKeyFromString("DTA7FmUNYuQs2mScj2Lx8gQV63SEL1zGtzCSvPxtijbi"),
Base: common.PublicKeyFromString("EvN4kgKmCmYzdbd5kL8Q8YgkUW5RoqMTpBczrfLExtx7"),
Owner: common.SystemProgramID,
Seed: "0",
Lamports: 0,
Space: 0,
},
},
want: types.Instruction{
ProgramID: common.SystemProgramID,
Expand All @@ -160,13 +156,15 @@ func TestCreateAccountWithSeed(t *testing.T) {
},
{
args: args{
fromPubkey: common.PublicKeyFromString("EvN4kgKmCmYzdbd5kL8Q8YgkUW5RoqMTpBczrfLExtx7"),
newAccountPubkey: common.PublicKeyFromString("FtvD2ymcAFh59DGGmJkANyJzEpLDR1GLgqDrUxfe2dPm"),
basePubkey: common.PublicKeyFromString("BkXBQ9ThbQffhmG39c2TbXW94pEmVGJAvxWk6hfxRvUJ"),
programID: common.SystemProgramID,
seed: "0",
lamports: 0,
space: 0,
param: CreateAccountWithSeedParam{
From: common.PublicKeyFromString("EvN4kgKmCmYzdbd5kL8Q8YgkUW5RoqMTpBczrfLExtx7"),
New: common.PublicKeyFromString("FtvD2ymcAFh59DGGmJkANyJzEpLDR1GLgqDrUxfe2dPm"),
Base: common.PublicKeyFromString("BkXBQ9ThbQffhmG39c2TbXW94pEmVGJAvxWk6hfxRvUJ"),
Owner: common.SystemProgramID,
Seed: "0",
Lamports: 0,
Space: 0,
},
},
want: types.Instruction{
ProgramID: common.SystemProgramID,
Expand All @@ -181,7 +179,7 @@ func TestCreateAccountWithSeed(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := CreateAccountWithSeed(tt.args.fromPubkey, tt.args.newAccountPubkey, tt.args.basePubkey, tt.args.programID, tt.args.seed, tt.args.lamports, tt.args.space); !reflect.DeepEqual(got, tt.want) {
if got := CreateAccountWithSeed(tt.args.param); !reflect.DeepEqual(got, tt.want) {
t.Errorf("CreateAccountWithSeed() = %v, want %v", got, tt.want)
}
})
Expand Down