Skip to content

Commit

Permalink
Merge pull request #607 from ElrondNetwork/reimport-mandos-fmted-tests
Browse files Browse the repository at this point in the history
mandos fmt tests
  • Loading branch information
alyn509 committed Sep 14, 2022
2 parents 7d1d20d + 7774ce8 commit 85ca12a
Show file tree
Hide file tree
Showing 430 changed files with 1,349 additions and 1,342 deletions.
3 changes: 2 additions & 1 deletion mandos-go/json/integrationTests/example.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@
}
},
"code": "file:smart-contract.wasm",
"owner": "address:alice"
"owner": "address:alice",
"developerRewards": "100"
}
},
"newAddresses": [
Expand Down
6 changes: 6 additions & 0 deletions mandos-go/json/write/writeAccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func AccountsToOJ(accounts []*mj.Account) oj.OJsonObject {
if len(account.Owner.Value) > 0 {
acctOJ.Put("owner", bytesFromStringToOJ(account.Owner))
}
if len(account.DeveloperReward.Original) > 0 {
acctOJ.Put("developerRewards", bigIntToOJ(account.DeveloperReward))
}
if len(account.AsyncCallData) > 0 {
acctOJ.Put("asyncCallData", stringToOJ(account.AsyncCallData))
}
Expand Down Expand Up @@ -95,6 +98,9 @@ func checkAccountsToOJ(checkAccounts *mj.CheckAccounts) oj.OJsonObject {
if !checkAccount.Owner.IsUnspecified() {
acctOJ.Put("owner", checkBytesToOJ(checkAccount.Owner))
}
if !checkAccount.DeveloperReward.IsUnspecified() {
acctOJ.Put("developerRewards", checkBigIntToOJ(checkAccount.DeveloperReward))
}
if !checkAccount.AsyncCallData.IsUnspecified() {
acctOJ.Put("asyncCallData", checkBytesToOJ(checkAccount.AsyncCallData))
}
Expand Down
6 changes: 3 additions & 3 deletions test/adder/mandos/adder.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
{
"step": "scDeploy",
"txId": "1",
"id": "1",
"tx": {
"from": "address:owner",
"contractCode": "file:../output/adder.wasm",
Expand All @@ -41,7 +41,7 @@
},
{
"step": "scQuery",
"txId": "2",
"id": "2",
"tx": {
"to": "sc:adder",
"function": "getSum",
Expand All @@ -57,7 +57,7 @@
},
{
"step": "scCall",
"txId": "3",
"id": "3",
"tx": {
"from": "address:owner",
"to": "sc:adder",
Expand Down
23 changes: 8 additions & 15 deletions test/crowdfunding-esdt/mandos/_generated_fund.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"accounts": {
"0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -15,8 +14,7 @@
"accounts": {
"0x2b32db6c2c0a6235fb1397e8225ea85e0f0e6e8c7b126d0016ccbde0e667151e": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -25,8 +23,7 @@
"accounts": {
"0x12771355e46cd47c71ed1721fd5319b383cca3a1f9fce3aa1c8cd3bd37af20d7": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -37,8 +34,7 @@
"nonce": "0",
"balance": "0",
"code": "file:../output/crowdfunding-esdt.wasm",
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925",
"developerRewards": "0"
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925"
}
}
},
Expand All @@ -59,8 +55,7 @@
}
]
}
},
"developerRewards": "0"
}
}
}
},
Expand All @@ -81,8 +76,7 @@
}
]
}
},
"developerRewards": "0"
}
}
}
},
Expand All @@ -98,14 +92,13 @@
"str:tokenIdentifier": "0x43524f57442d313233343536"
},
"code": "file:../output/crowdfunding-esdt.wasm",
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925",
"developerRewards": "0"
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925"
}
}
},
{
"step": "scCall",
"txId": "0",
"id": "0",
"tx": {
"from": "0x2b32db6c2c0a6235fb1397e8225ea85e0f0e6e8c7b126d0016ccbde0e667151e",
"to": "0x0000000000000000d720a08b839a004c2e6386f5aecc19ec74807d1920cb6aeb",
Expand Down
21 changes: 7 additions & 14 deletions test/crowdfunding-esdt/mandos/_generated_init.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"accounts": {
"0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -15,8 +14,7 @@
"accounts": {
"0x2b32db6c2c0a6235fb1397e8225ea85e0f0e6e8c7b126d0016ccbde0e667151e": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -25,8 +23,7 @@
"accounts": {
"0x12771355e46cd47c71ed1721fd5319b383cca3a1f9fce3aa1c8cd3bd37af20d7": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -37,8 +34,7 @@
"nonce": "0",
"balance": "0",
"code": "file:../output/crowdfunding-esdt.wasm",
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925",
"developerRewards": "0"
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925"
}
}
},
Expand All @@ -59,8 +55,7 @@
}
]
}
},
"developerRewards": "0"
}
}
}
},
Expand All @@ -81,8 +76,7 @@
}
]
}
},
"developerRewards": "0"
}
}
}
},
Expand All @@ -98,8 +92,7 @@
"str:tokenIdentifier": "0x43524f57442d313233343536"
},
"code": "file:../output/crowdfunding-esdt.wasm",
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925",
"developerRewards": "0"
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925"
}
}
}
Expand Down
23 changes: 8 additions & 15 deletions test/crowdfunding-esdt/mandos/_generated_query_status.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"accounts": {
"0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -15,8 +14,7 @@
"accounts": {
"0x2b32db6c2c0a6235fb1397e8225ea85e0f0e6e8c7b126d0016ccbde0e667151e": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -25,8 +23,7 @@
"accounts": {
"0x12771355e46cd47c71ed1721fd5319b383cca3a1f9fce3aa1c8cd3bd37af20d7": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -37,8 +34,7 @@
"nonce": "0",
"balance": "0",
"code": "file:../output/crowdfunding-esdt.wasm",
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925",
"developerRewards": "0"
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925"
}
}
},
Expand All @@ -59,8 +55,7 @@
}
]
}
},
"developerRewards": "0"
}
}
}
},
Expand All @@ -81,8 +76,7 @@
}
]
}
},
"developerRewards": "0"
}
}
}
},
Expand All @@ -98,14 +92,13 @@
"str:tokenIdentifier": "0x43524f57442d313233343536"
},
"code": "file:../output/crowdfunding-esdt.wasm",
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925",
"developerRewards": "0"
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925"
}
}
},
{
"step": "scQuery",
"txId": "0",
"id": "0",
"tx": {
"to": "0x0000000000000000d720a08b839a004c2e6386f5aecc19ec74807d1920cb6aeb",
"function": "status",
Expand Down
26 changes: 9 additions & 17 deletions test/crowdfunding-esdt/mandos/_generated_sc_err.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"accounts": {
"0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -15,8 +14,7 @@
"accounts": {
"0x2b32db6c2c0a6235fb1397e8225ea85e0f0e6e8c7b126d0016ccbde0e667151e": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -25,8 +23,7 @@
"accounts": {
"0x12771355e46cd47c71ed1721fd5319b383cca3a1f9fce3aa1c8cd3bd37af20d7": {
"nonce": "0",
"balance": "0",
"developerRewards": "0"
"balance": "0"
}
}
},
Expand All @@ -37,8 +34,7 @@
"nonce": "0",
"balance": "0",
"code": "file:../output/crowdfunding-esdt.wasm",
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925",
"developerRewards": "0"
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925"
}
}
},
Expand All @@ -59,8 +55,7 @@
}
]
}
},
"developerRewards": "0"
}
}
}
},
Expand All @@ -81,8 +76,7 @@
}
]
}
},
"developerRewards": "0"
}
}
}
},
Expand All @@ -98,8 +92,7 @@
"str:tokenIdentifier": "0x43524f57442d313233343536"
},
"code": "file:../output/crowdfunding-esdt.wasm",
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925",
"developerRewards": "0"
"owner": "0x66687aadf862bd776c8fc18b8e9f8e20089714856ee233b3902a591d0d5f2925"
}
}
},
Expand All @@ -120,14 +113,13 @@
}
]
}
},
"developerRewards": "0"
}
}
}
},
{
"step": "scCall",
"txId": "0",
"id": "0",
"tx": {
"from": "0x2b32db6c2c0a6235fb1397e8225ea85e0f0e6e8c7b126d0016ccbde0e667151e",
"to": "0x0000000000000000d720a08b839a004c2e6386f5aecc19ec74807d1920cb6aeb",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
{
"step": "scCall",
"txId": "fund-2",
"id": "fund-2",
"tx": {
"from": "address:donor2",
"to": "sc:crowdfunding",
Expand Down Expand Up @@ -91,7 +91,7 @@
},
{
"step": "scCall",
"txId": "claim-donor1",
"id": "claim-donor1",
"tx": {
"from": "address:donor1",
"to": "sc:crowdfunding",
Expand Down Expand Up @@ -122,7 +122,7 @@
},
{
"step": "scCall",
"txId": "claim-donor2",
"id": "claim-donor2",
"tx": {
"from": "address:donor2",
"to": "sc:crowdfunding",
Expand Down
Loading

0 comments on commit 85ca12a

Please sign in to comment.