diff --git a/neo3-gui/neo3-gui/ClientApp/package-lock.json b/neo3-gui/neo3-gui/ClientApp/package-lock.json index 6771a28..67f5135 100644 --- a/neo3-gui/neo3-gui/ClientApp/package-lock.json +++ b/neo3-gui/neo3-gui/ClientApp/package-lock.json @@ -1,6 +1,6 @@ { "name": "neo-gui", - "version": "1.2.1", + "version": "1.2.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/neo3-gui/neo3-gui/ClientApp/package.json b/neo3-gui/neo3-gui/ClientApp/package.json index 703f470..8bbb880 100644 --- a/neo3-gui/neo3-gui/ClientApp/package.json +++ b/neo3-gui/neo3-gui/ClientApp/package.json @@ -1,6 +1,6 @@ { "name": "neo-gui", - "version": "1.2.2", + "version": "1.2.3", "private": true, "main": "main.js", "homepage": "./", diff --git a/neo3-gui/neo3-gui/Helpers.cs b/neo3-gui/neo3-gui/Helpers.cs index 352672e..de086da 100644 --- a/neo3-gui/neo3-gui/Helpers.cs +++ b/neo3-gui/neo3-gui/Helpers.cs @@ -305,10 +305,10 @@ public static string SafeSerialize(this ContractParametersContext signContext) /// /// /// - public static Transaction InitTransaction(this Wallet wallet, byte[] script, params UInt160[] signers) + public static Transaction InitTransaction(this Wallet wallet, byte[] script, UInt160 sender = null, params UInt160[] signers) { var cosigners = signers.Select(account => new Signer { Account = account, Scopes = WitnessScope.Global }).ToArray(); - return InitTransaction(wallet, script, cosigners); + return InitTransaction(wallet, script, sender, cosigners); } /// @@ -316,11 +316,12 @@ public static Transaction InitTransaction(this Wallet wallet, byte[] script, par /// /// /// + /// /// /// - public static Transaction InitTransaction(this Wallet wallet, byte[] script, params Signer[] signers) + public static Transaction InitTransaction(this Wallet wallet, byte[] script, UInt160 sender = null, params Signer[] signers) { - var tx = wallet.MakeTransaction(GetDefaultSnapshot(), script, null, signers, maxGas: 2000_00000000); + var tx = wallet.MakeTransaction(GetDefaultSnapshot(), script, sender, signers, maxGas: 2000_00000000); return tx; } diff --git a/neo3-gui/neo3-gui/Models/ErrorCode.cs b/neo3-gui/neo3-gui/Models/ErrorCode.cs index 67a1501..2ff64e1 100644 --- a/neo3-gui/neo3-gui/Models/ErrorCode.cs +++ b/neo3-gui/neo3-gui/Models/ErrorCode.cs @@ -64,7 +64,7 @@ public enum ErrorCode UnknownContract = 20028, [Description("Contract already onchain.")] ContractAlreadyExist = 20029, - [Description("Validator already exits.")] + [Description("Validator already exists.")] ValidatorAlreadyExist = 20030, [Description("No gas for claim.")] NoNeedClaimGas = 20031, diff --git a/neo3-gui/neo3-gui/Services/ApiService.cs b/neo3-gui/neo3-gui/Services/ApiService.cs index 653c16f..b80b42f 100644 --- a/neo3-gui/neo3-gui/Services/ApiService.cs +++ b/neo3-gui/neo3-gui/Services/ApiService.cs @@ -37,14 +37,12 @@ protected WsError Error(int code, string message) return new WsError() { Code = code, Message = message }; } - - - protected async Task SignAndBroadcastTx(byte[] script, params UInt160[] signers) + protected async Task SignAndBroadcastTxWithSender(byte[] script, UInt160 sender, params UInt160[] signers) { Transaction tx; try { - tx = CurrentWallet.InitTransaction(script, signers); + tx = CurrentWallet.InitTransaction(script, sender, signers); } catch (InvalidOperationException ex) { @@ -68,5 +66,10 @@ protected async Task SignAndBroadcastTx(byte[] script, params UInt160[] result.TxId = tx.Hash; return result; } + + protected async Task SignAndBroadcastTx(byte[] script, params UInt160[] signers) + { + return await SignAndBroadcastTxWithSender(script, null, signers); + } } } \ No newline at end of file diff --git a/neo3-gui/neo3-gui/Services/ApiServices/ContractApiService.cs b/neo3-gui/neo3-gui/Services/ApiServices/ContractApiService.cs index 09505e6..bbc7dd9 100644 --- a/neo3-gui/neo3-gui/Services/ApiServices/ContractApiService.cs +++ b/neo3-gui/neo3-gui/Services/ApiServices/ContractApiService.cs @@ -185,7 +185,7 @@ public async Task InvokeContract(InvokeContractParameterModel para) try { - tx = CurrentWallet.InitTransaction(sb.ToArray(), signers.ToArray()); + tx = CurrentWallet.InitTransaction(sb.ToArray(), null, signers.ToArray()); } catch (InvalidOperationException ex) { @@ -428,8 +428,7 @@ public async Task ApplyForValidator(string pubkey) var account = contract.ScriptHash; using ScriptBuilder sb = new ScriptBuilder(); sb.EmitDynamicCall(NativeContract.NEO.Hash, "registerCandidate", publicKey); - - return await SignAndBroadcastTx(sb.ToArray(), account); + return await SignAndBroadcastTxWithSender(sb.ToArray(), account, account); } diff --git a/neo3-gui/neo3-gui/config.testnet.json b/neo3-gui/neo3-gui/config.testnet.json index 63791b4..8ffc58a 100644 --- a/neo3-gui/neo3-gui/config.testnet.json +++ b/neo3-gui/neo3-gui/config.testnet.json @@ -1,48 +1,45 @@ { "ApplicationConfiguration": { "Logger": { - "Path": "Logs", - "ConsoleOutput": true, - "Active": true + "Path": "Logs_{0}", + "ConsoleOutput": false, + "Active": false }, "Storage": { "Engine": "LevelDBStore", - "Path": "Data_LevelDB_6713213" + "Path": "Data_LevelDB_827601742" }, "P2P": { - "Port": 21333, - "WsPort": 21334 + "Port": 30333, + "WsPort": 30334 }, "UnlockWallet": { - "Path": "0.json", - "Password": "123456", - "IsActive": true + "Path": "", + "Password": "", + "IsActive": false }, "PluginURL": "https://github.com/neo-project/neo-modules/releases/download/v{1}/{0}.zip" }, "ProtocolConfiguration": { - "Magic": 6713213, + "Magic": 827601742, "MillisecondsPerBlock": 15000, "MaxTraceableBlocks": 2102400, "ValidatorsCount": 7, "StandbyCommittee": [ - "02179543000184781e5447b3f0fbace664ea92b7e31227c8e71bc4e7cdafccdb8e", - "038415d0be8dc12b61d3e3b76b98f464dfab7fddee74271c35e2de624bb51023a6", - "03c9b1c89c6e2d4abd629a2db8b7d03aced518a56793bc90f4985ef7ed3f1b481a", - "0302242b1dced63e1bf7eb14876f7ef026b79567f9c5be83de1943dd185ec28e68", - "025e8494903b93dc369f08a2bd7e221f574c75d9675591f04907cba9daeeb83d10", - "03e8ab5186e1deabcd10ec0e509ded4fffade6fddf534ac3e0506268bae3fd44a6", - "020df8858b66ff4d7b0a6a68d11ddedcc7d90d2a64ffa2cd087c4c5dabf4150b40", - "02f5f04a6036caedd68b5bd36e33105c0e9f43c0592e9f9f2188b1659be993bb5e", - "0279ed5e9ed91547e332a4f27135eebff5daab6c978b57992d8ee0359ccb9f5e8b", - "02ff249d06faaf0b5ba865e1531bfabe07f89aef39ab59082e3bc140be0318055d" + "023e9b32ea89b94d066e649b124fd50e396ee91369e8e2a6ae1b11c170d022256d", + "03009b7540e10f2562e5fd8fac9eaec25166a58b26e412348ff5a86927bfac22a2", + "02ba2c70f5996f357a43198705859fae2cfea13e1172962800772b3d588a9d4abd", + "03408dcd416396f64783ac587ea1e1593c57d9fea880c8a6a1920e92a259477806", + "02a7834be9b32e2981d157cb5bbd3acb42cfd11ea5c3b10224d7a44e98c5910f1b", + "0214baf0ceea3a66f17e7e1e839ea25fd8bed6cd82e6bb6e68250189065f44ff01", + "030205e9cefaea5a1dfc580af20c8d5aa2468bb0148f1a5e4605fc622c80e604ba" ], "SeedList": [ - "seed1t.neo.org:21333", - "seed2t.neo.org:21333", - "seed3t.neo.org:21333", - "seed4t.neo.org:21333", - "seed5t.neo.org:21333" + "seed1t.neo.org:20333", + "seed2t.neo.org:20333", + "seed3t.neo.org:20333", + "seed4t.neo.org:20333", + "seed5t.neo.org:20333" ] } -} \ No newline at end of file +}