Skip to content

Commit

Permalink
NegativeUNL, AMMInfo (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
Platonenkov authored May 10, 2024
1 parent 1729165 commit 27659c0
Show file tree
Hide file tree
Showing 45 changed files with 2,403 additions and 313 deletions.
121 changes: 61 additions & 60 deletions .ci-config/rippled.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -105,67 +105,68 @@ validators.txt
# Note: The version of rippled you use this config with must have an implementation for the amendments you attempt to enable or it will crash.
# If you need the version of rippled to be more up to date, you may need to make a comment on this repo: https://github.com/WietseWind/docker-rippled

[amendments]
[features]
# Devnet amendments as of June 28th, 2023
B4E4F5D2D6FB84DF7399960A732309C9FD530EAE5941838160042833625A6076 NegativeUNL
DF8B4536989BDACE3F934F29423848B9F1D76D09BE6A1FCFE7E7F06AA26ABEAD fixRemoveNFTokenAutoTrustLine
3C43D9A973AA4443EF3FC38E42DD306160FBFFDAB901CD8BAA15D09F2597EB87 NonFungibleTokensV1
98DECF327BF79997AEC178323AD51A830E457BFC6D454DAF3E46E5EC42DC619F CheckCashMakesTrustLine
B6B3EEDC0267AB50491FDC450A398AF30DBCD977CECED8BEF2499CAB5DAC19E2 fixRmSmallIncreasedQOffers
452F5906C46D46F407883344BFDD90E672B672C5E9943DB4891E3A34FEEEB9DB fixSTAmountCanonicalize
AF8DF7465C338AE64B1E937D6C8DA138C0D63AD5134A68792BBBE1F63356C422 FlowSortStrands
955DF3FA5891195A9DAEFA1DDC6BB244B545DDE1BAA84CBB25D5F12A8DA68A0C TicketBatch
B4D44CC3111ADD964E846FC57760C8B50FFCD5A82C86A72756F6B058DDDF96AD fix1201
89308AF3B8B10B7192C4E613E1D2E4D9BA64B2EE2D5232402AE82A6A7220D953 fixQualityUpperBound
3012E8230864E95A58C60FD61430D7E1B4D3353195F2981DC12B0C7C0950FFAC FlowCross
DC9CA96AEA1DCF83E527D1AFC916EFAF5D27388ECA4060A88817C1238CAEE0BF EnforceInvariants
B9E739B8296B4A1BB29BE990B17D66E21B62A300A909F25AC55C22D6C72E1F9D fix1523
1F4AFA8FA1BC8827AD4C0F682C03A8B671DCDF6B5C4DE36D44243A684103EF88 HardenedValidations
3CBC5C4E630A1B82380295CDA84B32B49DD066602E74E39B85EF64137FA65194 DepositPreauth
586480873651E106F1D6339B0C4A8945BA705A777F3F4524626FF1FC07EFE41D MultiSignReserve
58BE9B5968C4DA7C59BA900961828B113E5490699B21877DEF9A31E9D0FE5D5F fix1623
42426C4D4F1009EE67080A9B7965B44656D7714D104A72F9B4369F97ABF044EE FeeEscalation
08DE7D96082187F6E6578530258C77FAABABE4C20474BDB82F04B021F1A68647 PayChan
67A34F2CF55BFC0F93AACD5B281413176FEE195269FA6D95219A2DF738671172 fix1513
00C1FC4A53E60AB02C864641002B3172F38677E29C26C5406685179B37E1EDAC RequireFullyCanonicalSig
CA7C02118BA27599528543DFE77BA6838D1B0F43B447D4D7F53523CE6A0E9AC2 fix1543
532651B4FD58DF8922A49BA101AB3E996E5BFBF95A913B3E392504863E63B164 TickSize
25BA44241B3BD880770BFA4DA21C7180576831855368CBEC6A3154FDE4A7676E fix1781
8F81B066ED20DAECA20DF57187767685EEF3980B228E0667A650BAF24426D3B4 fixCheckThreading
5D08145F0A4983F23AFFFF514E83FAD355C5ABFBB6CAB76FB5BC8519FF5F33BE fix1515
1562511F573A19AE9BD103B5D6B9E01B3B46805AEC5D3C4805C902B514399146 CryptoConditions
1D3463A5891F9E589C5AE839FFAC4A917CE96197098A1EF22304E1BC5B98A454 fix1528
621A0B264970359869E3C0363A899909AAB7A887C8B73519E4ECF952D33258A8 fixPayChanRecipientOwnerDir
CC5ABAE4F3EC92E94A59B1908C2BE82D2228B6485C00AFF8F22DF930D89C194E SortedDirectories
FBD513F1B893AC765B78F250E6FFA6A11B573209D1842ADC787C850696741288 fix1578
7117E2EC2DBF119CA55181D69819F1999ECEE1A0225A7FD2B9ED47940968479C fix1571
4F46DF03559967AC60F2EB272FEFE3928A7594A45FF774B87A7E540DB0F8F068 fixAmendmentMajorityCalc
2CD5286D8D687E98B41102BDD797198E81EA41DF7BD104E6561FEB104EFF2561 fixTakerDryOfferRemoval
C4483A1896170C66C098DEA5B0E024309C60DC960DE5F01CD7AF986AA3D9AD37 fixMasterKeyAsRegularKey
740352F2412A9909880C23A559FCECEDA3BE2126FED62FC7660D628A06927F11 Flow
07D43DCE529B15A10827E5E04943B496762F9A88E3268269D69C44BE49E21104 Escrow
6781F8368C4771B83E8B821D88F580202BCB4228075297B19E4FDC5233F1EFDC TrustSetAuth
30CD365592B8EE40489BA01AE2F7555CAC9C983145871DC82A42A31CF5BAE7D9 DeletableAccounts
F64E1EABBE79D55B3BB82020516CEC2C582A98A6BFE20FBE9BB6A0D233418064 DepositAuth
E2E6F2866106419B88C50045ACE96368558C345566AC8F2BDF5A5B5587F0E6FA fix1368
6C92211186613F9647A89DFFBAB8F94C99D4C7E956D495270789128569177DA1 fix1512
42EEA5E28A97824821D4EF97081FE36A54E9593C6E4F20CBAE098C69D2E072DC fix1373
4C97EBA926031A7CF7D7B36FDE3ED66DDA5421192D63DE53FFB46E43B9DC8373 MultiSign
157D2D480E006395B76F948E3E07A45A05FE10230D88A7993C71F97AE4B1F2D1 Checks
32A122F1352A4C7B3A6D790362CC34749C5E57FCE896377BFDC6CCD14F6CD627 NonFungibleTokensV1_1
NegativeUNL
fixRemoveNFTokenAutoTrustLine
NonFungibleTokensV1
CheckCashMakesTrustLine
fixRmSmallIncreasedQOffers
fixSTAmountCanonicalize
FlowSortStrands
TicketBatch
fix1201
fixQualityUpperBound
FlowCross
EnforceInvariants
fix1523
HardenedValidations
DepositPreauth
MultiSignReserve
fix1623
FeeEscalation
PayChan
fix1513
RequireFullyCanonicalSig
fix1543
TickSize
fix1781
fixCheckThreading
fix1515
CryptoConditions
fix1528
fixPayChanRecipientOwnerDir
SortedDirectories
fix1578
fix1571
fixAmendmentMajorityCalc
fixTakerDryOfferRemoval
fixMasterKeyAsRegularKey
Flow
Escrow
TrustSetAuth
DeletableAccounts
DepositAuth
fix1368
fix1512
fix1373
MultiSign
Checks
NonFungibleTokensV1_1
# 1.10.0 Amendments
47C3002ABA31628447E8E9A8B315FAA935CE30183F9A9B86845E469CA2CDC3DF DisallowIncoming
73761231F7F3D94EC3D8C63D91BDD0D89045C6F71B917D1925C01253515A6669 fixNonFungibleTokensV1_2
F1ED6B4A411D8B872E65B9DCB4C8B100375B0DD3D62D07192E011D6D7F339013 fixTrustLinesToSelf
2E2FB9CF8A44EB80F4694D38AADAE9B8B7ADAFD2F092E10068E61C98C4F092B0 fixUniversalNumber
75A7E01C505DD5A179DFE3E000A9B6F1EDDEB55A12F95579A23E15B15DC8BE5A ImmediateOfferKilled
93E516234E35E08CA689FA33A6D38E103881F8DCB53023F728C307AA89D515A7 XRPFees
DisallowIncoming
fixNonFungibleTokensV1_2
fixTrustLinesToSelf
fixUniversalNumber
ImmediateOfferKilled
XRPFees
# 1.11.0 Amendments
B2A4DB846F0891BF2C76AB2F2ACC8F5B4EC64437135C6E56F3F859DE5FFD5856 ExpandedSignerList
# 1.12.0-b1 Amendments
56B241D7A43D40354D02A9DC4C8DF5C7A1F930D92A9035C4E12291B3CA3E1C2B featureClawback
27CD95EE8E1E5A537FF2F89B6CEB7C622E78E9374EBD7DCBEDFAE21CD6F16E0A fixReducedOffersV1
ExpandedSignerList
# 1.12.0 Amendments
8CC0774A3BF66D1D22E76BBDA8E8A232E6B6313834301B3B23E8601196AE6455 AMM
# Added August 9th, 2023
AE35ABDEFBDE520372B31C957020B34A7A4A9DC3115A69803A44016477C84D6E fixNFTokenRemint
AMM
Clawback
fixReducedOffersV1
fixNFTokenRemint
# 2.0.0 Amendments
XChainBridge
DID
11 changes: 7 additions & 4 deletions .github/workflows/dotnet.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

name: .NET CI

env:
RIPPLED_DOCKER_IMAGE: rippleci/rippled:2.0.0-b4

on:
push:
branches: [ main ]
Expand Down Expand Up @@ -49,8 +52,8 @@ jobs:
- uses: actions/checkout@v3

- name: Run docker in background
run: |
docker run --detach --rm --name rippled-service -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/config/" --health-cmd="wget localhost:6006 || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env "ENV_ARGS=-a --start" --env GITHUB_ACTIONS=true --env CI=true xrpllabsofficial/xrpld:1.12.0
run: |
docker run --detach --rm --name rippled-service -p 6006:6006 --volume "${{ github.workspace }}/.ci-config/":"/opt/ripple/etc/" --health-cmd="wget localhost:6006 || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s --env GITHUB_ACTIONS=true --env CI=true ${{ env.RIPPLED_DOCKER_IMAGE }} /opt/ripple/bin/rippled -a --conf /opt/ripple/etc/rippled.cfg
- name: Use .NET "${{ matrix.dotnet }}"
uses: actions/setup-dotnet@v3
Expand All @@ -67,5 +70,5 @@ jobs:
PORT: ${{ job.services.rippled.ports['6006'] }}

- name: Stop docker container
if: always()
run: docker stop rippled-service
if: always()
run: docker stop rippled-service
1 change: 1 addition & 0 deletions Base/Xrpl.BinaryCodec/Binary/BinarySerializer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Xrpl.BinaryCodec.Enums;
using Xrpl.BinaryCodec.Types;

//https://github.com/XRPLF/xrpl.js/blob/8a9a9bcc28ace65cde46eed5010eb8927374a736/packages/ripple-binary-codec/src/serdes/binary-serializer.ts#L52

Expand Down
9 changes: 9 additions & 0 deletions Base/Xrpl.BinaryCodec/Binary/BytesList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ public byte[] Bytes()
AddBytes(bytes, 0);
return bytes;
}
/// <summary> Get all bytes </summary>
/// <returns>Bytes</returns>
public byte[] ToBytes()
{
var n = BytesLength();
var bytes = new byte[n];
AddBytes(bytes, 0);
return bytes;
}
/// <summary> Hex Lookup </summary>
public static string[] HexLookup = new string[256];
static BytesList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//todo not found doc

namespace Xrpl.BinaryCodec.Types
namespace Xrpl.BinaryCodec.Enums
{
public class EngineResult : SerializedEnumItem<byte>
{
Expand Down Expand Up @@ -58,6 +58,11 @@ private static EngineResult Add(string name, int ordinal, string description)
public static readonly EngineResult temUNCERTAIN = Add(nameof(temUNCERTAIN), -272, "In process of determining result. Never returned.");
public static readonly EngineResult temUNKNOWN = Add(nameof(temUNKNOWN), -271, "The transactions requires logic not implemented yet.");

public static readonly EngineResult temSEQ_AND_TICKET = Add(nameof(temSEQ_AND_TICKET), -263, "");
public static readonly EngineResult temBAD_NFTOKEN_TRANSFER_FEE = Add(nameof(temBAD_NFTOKEN_TRANSFER_FEE), -262, "");
public static readonly EngineResult temBAD_AMM_OPTIONS = Add(nameof(temBAD_AMM_OPTIONS), -261, "");
public static readonly EngineResult temBAD_AMM_TOKENS = Add(nameof(temBAD_AMM_TOKENS), -260, "");

public static readonly EngineResult tefFAILURE = Add(nameof(tefFAILURE), -199, "Failed to apply.");
public static readonly EngineResult tefALREADY = Add(nameof(tefALREADY), -198, "The exact transaction was already in this ledger.");
public static readonly EngineResult tefBAD_ADD_AUTH = Add(nameof(tefBAD_ADD_AUTH), -197, "Not authorized to add account.");
Expand All @@ -83,6 +88,9 @@ private static EngineResult Add(string name, int ordinal, string description)
public static readonly EngineResult terPRE_SEQ = Add(nameof(terPRE_SEQ), -92, "Missing/inapplicable prior transaction.");
public static readonly EngineResult terLAST = Add(nameof(terLAST), -91, "Process last.");
public static readonly EngineResult terNO_RIPPLE = Add(nameof(terNO_RIPPLE), -90, "Process last.");
public static readonly EngineResult terQUEUED = Add(nameof(terQUEUED), -89, "");
public static readonly EngineResult terPRE_TICKET = Add(nameof(terPRE_TICKET), -88, "");
public static readonly EngineResult terNO_AMM = Add(nameof(terNO_AMM), -87, "");

public static readonly EngineResult tesSUCCESS = Add(nameof(tesSUCCESS), 0, "The transaction was applied.");
public static readonly EngineResult tecCLAIM = Add(nameof(tecCLAIM), 100, "Fee claimed. Sequence used. No action.");
Expand Down Expand Up @@ -116,7 +124,22 @@ private static EngineResult Add(string name, int ordinal, string description)
public static readonly EngineResult tecDST_TAG_NEEDED = Add(nameof(tecDST_TAG_NEEDED), 143, "A destination tag is required.");
public static readonly EngineResult tecINTERNAL = Add(nameof(tecINTERNAL), 144, "An internal error has occurred during processing.");
public static readonly EngineResult tecOVERSIZE = Add(nameof(tecOVERSIZE), 145, "Object exceeded serialization limits.");


public static readonly EngineResult tecCANT_ACCEPT_OWN_NFTOKEN_OFFER = Add(nameof(tecCANT_ACCEPT_OWN_NFTOKEN_OFFER), 158, "");
public static readonly EngineResult tecINSUFFICIENT_FUNDS = Add(nameof(tecINSUFFICIENT_FUNDS), 159, "");
public static readonly EngineResult tecOBJECT_NOT_FOUND = Add(nameof(tecOBJECT_NOT_FOUND), 160, "");
public static readonly EngineResult tecINSUFFICIENT_PAYMENT = Add(nameof(tecINSUFFICIENT_PAYMENT), 161, "");
public static readonly EngineResult tecUNFUNDED_AMM = Add(nameof(tecUNFUNDED_AMM), 162, "");
public static readonly EngineResult tecAMM_BALANCE = Add(nameof(tecAMM_BALANCE), 163, "");
public static readonly EngineResult tecAMM_FAILED_DEPOSIT = Add(nameof(tecAMM_FAILED_DEPOSIT), 164, "");
public static readonly EngineResult tecAMM_FAILED_WITHDRAW = Add(nameof(tecAMM_FAILED_WITHDRAW), 165, "");
public static readonly EngineResult tecAMM_INVALID_TOKENS = Add(nameof(tecAMM_INVALID_TOKENS), 166, "");
public static readonly EngineResult tecAMM_EXISTS = Add(nameof(tecAMM_EXISTS), 167, "");
public static readonly EngineResult tecAMM_FAILED_BID = Add(nameof(tecAMM_FAILED_BID), 168, "");
public static readonly EngineResult tecAMM_FAILED_VOTE = Add(nameof(tecAMM_FAILED_VOTE), 169, "");



// ReSharper restore InconsistentNaming
public bool ShouldClaimFee()
{
Expand Down
Loading

0 comments on commit 27659c0

Please sign in to comment.